lcrzo_tcpopt(3)

NAME
lcrzo_tcpopt - lcrzo library : TCP options

CONTENTS
/*    Laurent Constantin's network library (lcrzo)
                 lcrzo_tcppopt module
  Functions herein allow to create and decode TCP options.
*/
/*-------------------------------------------------------------*/
/* define an TCP option type */
#define LCRZO_TCPOPT_MAXBYTES 40
typedef lcrzo_uint8 lcrzo_tcpopt[LCRZO_TCPOPT_MAXBYTES];
typedef const lcrzo_tcpopt lcrzo_consttcpopt;
/* this define permits to verify that there is no buffer overflow
   before setting a lcrzo_tcpopt */
#define lcrzo_tcpopt_verifbof(nbocttcpopt) if(nbocttcpopt>LCRZO_TCPOPT_MAXBYTES)return(LCRZO_ERR_PAOVERFLOW)
/*-------------------------------------------------------------*/
/* Name : lcrzo_tcpopt_init_mixed
   Description :
     Initialize an IP option, with data presented
     in mixed form
   Input parameter(s) :
     mixed : mixed string to use
   Input/output parameter(s) :
   Output parameter(s) :
     tcpopt : lcrzo_tcpopt set with the option
     *ptcpoptsize : size reached by tcpopt
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : mixed is too long to be put
                                 in tcpopt
*/
int lcrzo_tcpopt_init_mixed(lcrzo_constmixed mixed,
			    lcrzo_tcpopt tcpopt,
			    lcrzo_uint8 *ptcpoptsize);
/*-------------------------------------------------------------*/
/* Name : lcrzo_tcpopt_init_stdin
   Description :
     Initialize an IP option, with data presented
     in mixed form, and entered by the user
   Input parameter(s) :
     message : message to print before asking user
     defaulmixed : mixed string to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     tcpopt : lcrzo_tcpopt set with the option
     *ptcpoptsize : size reached by tcpopt
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_tcpopt_init_stdin(lcrzo_conststring message,
		       lcrzo_constmixed defaultmixed,
		       lcrzo_tcpopt tcpopt,
		       lcrzo_uint8 *ptcpoptsize);

SEE ALSO
lcrzo(3), lcrzo_types(3), lcrzo_data(3), lcrzo_string(3), lcrzo_time(3), lcrzo_file(3), lcrzo_address(3), lcrzo_device(3), lcrzo_list(3), lcrzo_process(3), lcrzo_ipc(3), lcrzo_header(3), lcrzo_ipopt(3), lcrzo_tcpopt(3), lcrzo_packet(3), lcrzo_icmp(3), lcrzo_print(3), lcrzo_record(3), lcrzo_conf(3), lcrzo_spoof(3), lcrzo_sniff(3), lcrzo_sock(3), lcrzo_wait(3), lcrzo_global(3), lcrzo_error(3) lcrzo_misc(3), lcrzo_obso(3),