From: Maarten T. <mth...@ci...> - 2005-10-27 17:31:14
|
Hi, > BANNER: > S: 200-RAP <RAP-VERSION> <HOSTNAME> <RADMIND-VERSION> radmind > access protocol "\r\n" > S: 200 COMPRESS <MECHANISM> [MECHANISM...] "\r\n" > These lines get read by the client in connectsn2(). So connectsn2 needs to save these for later use. So we need a new variable to connectsn where it can save the compression info or other capabilities. We can also remove the capabilities from the header and let the client ask for them explicitly through a new command, e.g. "CAPAbilities". I favor the first option: BANNER: S: 200-RAP <RAP-VERSION> <HOSTNAME> <RADMIND-VERSION> radmind access protocol "\r\n" S: 200 CAPABILITY <ITEM> [ITEM...] "\r\n" connectsn2() calls a function extract_capabilties which puts these in an array and returns a pointer. Connectsn2() saves the array in an pointer that it receives as an argument (of course connectsn() will need to change too): connectsn2( struct sockaddr_in *sin, char **capa ) ) { ... line = snet_getline_multi(...); capa = extract_capabilities(line); return ... } Agreed? -- maarten |