lcrzo_global(3)

NAME
lcrzo_global - lcrzo library : global parameters

CONTENTS
/*    Laurent Constantin's network library (lcrzo)
                 lcrzo_global module
  Functions herein allow to specify global functionnalities.
*/
/*-------------------------------------------------------------*/
/***************************************************************
 * Note about the following functions :                         *
 * The default values are correct for most applications.       *
 * You should modify their parameters only if you know         *
 * what you are doing.                                         *
 ***************************************************************/
/*-------------------------------------------------------------*/
/* select the language */
#define LCRZO_GLOBAL_LANG_EN 1
#define LCRZO_GLOBAL_LANG_FR 2
int lcrzo_global_set_language(lcrzo_int16 language);
int lcrzo_global_get_language(lcrzo_int16 *planguage);
/*-------------------------------------------------------------*/
/* change the backlog for tcp servers */
int lcrzo_global_set_sock_tcpser_backlog(lcrzo_uint8 backlog);
int lcrzo_global_get_sock_tcpser_backlog(lcrzo_uint8 *pbacklog);
/*-------------------------------------------------------------*/
/* change thresholds for lcrzo_time_sleep */
int lcrzo_global_set_time_sleep_1threshold(lcrzo_uint32 threshold);
int lcrzo_global_set_time_sleep_2threshold(lcrzo_uint32 threshold);
int lcrzo_global_set_time_sleep_3threshold(lcrzo_uint32 threshold);
int lcrzo_global_get_time_sleep_1threshold(lcrzo_uint32 *pthreshold);
int lcrzo_global_get_time_sleep_2threshold(lcrzo_uint32 *pthreshold);
int lcrzo_global_get_time_sleep_3threshold(lcrzo_uint32 *pthreshold);
/*-------------------------------------------------------------*/
/* when open a record, decide if the file must exist or not */
int lcrzo_global_set_record_open_existentfile(lcrzo_bool yesitmustbe);
int lcrzo_global_set_record_open_newfile(lcrzo_bool yesitmustbe);
int lcrzo_global_get_record_open_existentfile(lcrzo_bool *pyesitmustbe);
int lcrzo_global_get_record_open_newfile(lcrzo_bool *pyesitmustbe);
/*-------------------------------------------------------------*/
/* decide if the library has to recompute header fields */
int lcrzo_global_set_hdr_compfields(lcrzo_bool yes);
int lcrzo_global_get_hdr_compfields(lcrzo_bool *pyes);
int lcrzo_global_set_hdr_cf_ethtype(lcrzo_bool yes);
int lcrzo_global_get_hdr_cf_ethtype(lcrzo_bool *pyes);
int lcrzo_global_set_hdr_cf_iptotlen(lcrzo_bool yes);
int lcrzo_global_get_hdr_cf_iptotlen(lcrzo_bool *pyes);
int lcrzo_global_set_hdr_cf_ipihl(lcrzo_bool yes);
int lcrzo_global_get_hdr_cf_ipihl(lcrzo_bool *pyes);
int lcrzo_global_set_hdr_cf_ipcheck(lcrzo_bool yes);
int lcrzo_global_get_hdr_cf_ipcheck(lcrzo_bool *pyes);
int lcrzo_global_set_hdr_cf_ipprotocol(lcrzo_bool yes);
int lcrzo_global_get_hdr_cf_ipprotocol(lcrzo_bool *pyes);
int lcrzo_global_set_hdr_cf_udplen(lcrzo_bool yes);
int lcrzo_global_get_hdr_cf_udplen(lcrzo_bool *pyes);
int lcrzo_global_set_hdr_cf_udpcheck(lcrzo_bool yes);
int lcrzo_global_get_hdr_cf_udpcheck(lcrzo_bool *pyes);
int lcrzo_global_set_hdr_cf_tcpdoff(lcrzo_bool yes);
int lcrzo_global_get_hdr_cf_tcpdoff(lcrzo_bool *pyes);
int lcrzo_global_set_hdr_cf_tcpcheck(lcrzo_bool yes);
int lcrzo_global_get_hdr_cf_tcpcheck(lcrzo_bool *pyes);
int lcrzo_global_set_hdr_cf_icmpcheck(lcrzo_bool yes);
int lcrzo_global_get_hdr_cf_icmpcheck(lcrzo_bool *pyes);
/*-------------------------------------------------------------*/
/* decide what addresses to use for internal spoofing */
/* random */
#define LCRZO_INTSPOOF_TYPE_RAND 0
/* random, but constant over the various calls */
#define LCRZO_INTSPOOF_TYPE_RANDCONST 1
/* user specified */
#define LCRZO_INTSPOOF_TYPE_USER 2
/* computed for the best value */
#define LCRZO_INTSPOOF_TYPE_COMP 3
/* computed for the best value, and keep this value */
#define LCRZO_INTSPOOF_TYPE_COMPCONST 4
/* use the Ethernet and IP address of the device */
#define LCRZO_INTSPOOF_TYPE_CONF 5
int lcrzo_global_set_intspoof_eth_type(lcrzo_uint8 intspoof_eth_type);
int lcrzo_global_get_intspoof_eth_type(lcrzo_uint8 *pintspoof_eth_type);
int lcrzo_global_set_intspoof_eth_address(lcrzo_constetha eth_address);
int lcrzo_global_get_intspoof_eth_address(lcrzo_etha intspoof_eth_address);
int lcrzo_global_set_intspoof_ip_type(lcrzo_uint8 intspoof_ip_type);
int lcrzo_global_get_intspoof_ip_type(lcrzo_uint8 *pintspoof_ip_type);
int lcrzo_global_set_intspoof_ip_address(lcrzo_constetha intspoof_ip_address);
int lcrzo_global_get_intspoof_ip_address(lcrzo_etha intspoof_ip_address);
/*-------------------------------------------------------------*/
/* timeout for hs<-->ipa resolution */
int lcrzo_global_set_resolver_timeout(lcrzo_uint8 timeout);
int lcrzo_global_get_resolver_timeout(lcrzo_uint8 *ptimeout);
/*-------------------------------------------------------------*/
/* if we want virtual clients/servers to answer to arp/rarp/ping */
int lcrzo_global_set_sock_virt_answeralive(lcrzo_bool answeralive);
int lcrzo_global_get_sock_virt_answeralive(lcrzo_bool *pansweralive);
/*-------------------------------------------------------------*/
/* if we are sensitive to case in regular expressions of
    lcrzo_data and lcrzo_string functions */
int lcrzo_global_set_data_regexp_casesensitive(lcrzo_bool casesensitive);
int lcrzo_global_get_data_regexp_casesensitive(lcrzo_bool *pcasesensitive);
/*-------------------------------------------------------------*/
/***************************************************************
 * Note about the following functions :                         *
 * They values can be overwritten by local functions.          *
 ***************************************************************/
/*-------------------------------------------------------------*/
/* change timeouts for sniff */
int lcrzo_global_set_sniff_ipreas1timeout(lcrzo_uint16 timeout);
int lcrzo_global_set_sniff_ipreas2timeout(lcrzo_uint16 timeout);
int lcrzo_global_set_sniff_tcpreor1timeout(lcrzo_uint16 timeout);
int lcrzo_global_set_sniff_tcpreor2timeout(lcrzo_uint16 timeout);
int lcrzo_global_get_sniff_ipreas1timeout(lcrzo_uint16 *ptimeout);
int lcrzo_global_get_sniff_ipreas2timeout(lcrzo_uint16 *ptimeout);
int lcrzo_global_get_sniff_tcpreor1timeout(lcrzo_uint16 *ptimeout);
int lcrzo_global_get_sniff_tcpreor2timeout(lcrzo_uint16 *ptimeout);
/*-------------------------------------------------------------*/
/* change the IP fragmentation size */
int lcrzo_global_set_spoof_fragoctosize(lcrzo_uint16 fragoctosize);
int lcrzo_global_get_spoof_fragoctosize(lcrzo_uint16 *pfragoctosize);
/*-------------------------------------------------------------*/
/* decide if packets are to be printed before spoofing */
int lcrzo_global_set_spoof_printbeforesending(lcrzo_bool printbeforesending);
int lcrzo_global_get_spoof_printbeforesending(lcrzo_bool *pprintbeforesending);
/*-------------------------------------------------------------*/
/* define the printprofile to use when printing spoofed packets */
int lcrzo_global_set_spoof_printprofile(lcrzo_printprofile printprofile);
int lcrzo_global_get_spoof_printprofile(lcrzo_printprofile *pprintprofile);
/*-------------------------------------------------------------*/
/* if we spoof ethernet packet when the user wants to only
     spoof IP. This is very useful on systems like Solaris
     which modify IP header values. */
int lcrzo_global_set_spoof_useethforip(lcrzo_bool useethforip);
int lcrzo_global_get_spoof_useethforip(lcrzo_bool *puseethforip);
/*-------------------------------------------------------------*/
/* function to display user specific error */
int lcrzo_global_set_err_displayfunction(int (*pfunc)(int ret));
int lcrzo_global_get_err_displayfunction(int (**ppfunc)(int ret));

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),