lcrzo_address(3)

NAME
lcrzo_address - lcrzo library : addresses (hostname, IP, Ethernet)

CONTENTS
/*    Laurent Constantin's network library (lcrzo)
                 lcrzo_address module
  Functions herein allow address creation and conversion.
*/
/*-------------------------------------------------------------*/
/*                         ADDRESS TYPES                         */
/*-------------------------------------------------------------*/
/* to store a computer name as a string like "machine.entr.fr" */
#define LCRZO_HS_MAXBYTES 240
typedef char lcrzo_hs[LCRZO_HS_MAXBYTES+1]; /* +1 for/pour '\0'*/
typedef const lcrzo_hs lcrzo_consths;
/* to store an IP address as a string like "193.52.95.43" */
#define LCRZO_IPS_MAXBYTES 15
typedef char lcrzo_ips[LCRZO_IPS_MAXBYTES+1]; /*+1 for/pour '\0'*/
typedef const lcrzo_ips lcrzo_constips;
/* to store an IP address as an array like [ii][ii][ii][ii] */
#define LCRZO_IPA_MAXBYTES 4
typedef lcrzo_uint8 lcrzo_ipa[LCRZO_IPA_MAXBYTES];
typedef const lcrzo_ipa lcrzo_constipa;
/* to store an IP address as a 32 bits integer like 0x3456329D
  (it is in host byte order (and not in network byte order)) */
typedef lcrzo_uint32 lcrzo_ipl;
/* to store an Ethernet address as a string like "8:0:20:74:dc:2e" */
#define LCRZO_ETHS_MAXBYTES 17
typedef char lcrzo_eths[LCRZO_ETHS_MAXBYTES+1]; /*+1for/pour'\0'*/
typedef const lcrzo_eths lcrzo_consteths;
/* to store an Ethernet address as an array like
   [ii][ii][ii][ii][ii][ii] */
#define LCRZO_ETHA_MAXBYTES 6
typedef lcrzo_uint8 lcrzo_etha[LCRZO_ETHA_MAXBYTES];
typedef const lcrzo_etha lcrzo_constetha;
/*-------------------------------------------------------------*/
/* this define permits to verify that there is no buffer overflow
   before setting a lcrzo_hs */
#define lcrzo_hs_verifbof(hs) if(strlen(hs)>LCRZO_HS_MAXBYTES)return(LCRZO_ERR_PAOVERFLOW)
/* Name : lcrzo_hs_init
   Description :
     Initialize an lcrzo_hs address
   Input parameter(s) :
     inhs : string containing the host name
   Input/output parameter(s) :
   Output parameter(s) :
     ouths : lcrzo_hs set with inhs
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : all the data can't be put in ouths
*/
int lcrzo_hs_init(lcrzo_conststring instring,
		  lcrzo_hs ouths);
/* Name : lcrzo_hs_init_hs
   Description :
     Initialize an lcrzo_hs address
   Input parameter(s) :
     inhs : lcrzo_hs containing the host name
   Input/output parameter(s) :
   Output parameter(s) :
     ouths : lcrzo_hs set with inhs
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : all the data can't be put in ouths
*/
int lcrzo_hs_init_hs(lcrzo_consths inhs,
		     lcrzo_hs ouths);
/* Name : lcrzo_hs_initdefault
   Description :
     Initialize a default lcrzo_hs address
   Input parameter(s) :
   Input/output parameter(s) :
   Output parameter(s) :
     hs : lcrzo_hs set with "" (default value)
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_hs_initdefault(lcrzo_hs hs);
/* Name : lcrzo_hs_init_ips
   Description :
     Convert a lcrzo_ips to a lcrzo_hs
   Input parameter(s) :
     ips : lcrzo_ips to convert
   Input/output parameter(s) :
   Output parameter(s) :
     hs : lcrzo_hs set with ips value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_hs_init_ips(lcrzo_constips ips, lcrzo_hs hs);
/* Name : lcrzo_hs_init_ipa
   Description :
     Convert a lcrzo_ipa to a lcrzo_hs
   Input parameter(s) :
     ipa : lcrzo_ipa to convert
   Input/output parameter(s) :
   Output parameter(s) :
     hs : lcrzo_hs set with ipa value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_hs_init_ipa(lcrzo_constipa ipa, lcrzo_hs hs);
/* Name : lcrzo_hs_init_ipl
   Description :
     Convert a lcrzo_ipl to a lcrzo_hs
   Input parameter(s) :
     ipl : lcrzo_ipl to convert
   Input/output parameter(s) :
   Output parameter(s) :
     hs : lcrzo_hs set with ipl value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_hs_init_ipl(lcrzo_ipl ipl, lcrzo_hs hs);
/* Name : lcrzo_hs_init_eths
   Description :
     Convert a lcrzo_eths to a lcrzo_hs
   Input parameter(s) :
     eths : lcrzo_eths to convert
   Input/output parameter(s) :
   Output parameter(s) :
     hs : lcrzo_hs set with eths value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_hs_init_eths(lcrzo_consteths eths, lcrzo_hs hs);
/* Name : lcrzo_hs_init_etha
   Description :
     Convert a lcrzo_etha to a lcrzo_hs
   Input parameter(s) :
     etha : lcrzo_etha to convert
   Input/output parameter(s) :
   Output parameter(s) :
     hs : lcrzo_hs set with etha value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_hs_init_etha(lcrzo_constetha etha, lcrzo_hs hs);
/* Name : lcrzo_hs_equal
   Description :
     Verify if two lcrzo_hs are equal
   Input parameter(s) :
     hs1 : lcrzo_hs to compare with hs2
     hs2 : lcrzo_hs to compare with hs1
   Input/output parameter(s) :
   Output parameter(s) :
   Normal return values :
     0 : if hs1 and hs2 are different
     1 : if hs1 and hs2 are equal
*/
lcrzo_bool lcrzo_hs_equal(lcrzo_consths hs1, lcrzo_consths hs2);
/* Name : lcrzo_hs_cmp
   Description :
     Compare two lcrzo_hs
   Input parameter(s) :
     hs1 : lcrzo_hs to compare with hs2
     hs2 : lcrzo_hs to compare with hs1
   Input/output parameter(s) :
   Output parameter(s) :
   Normal return values :
     -1 : hs1<hs2
      0 : if hs1 and hs2 are equal
     +1 : hs1>hs2
*/
lcrzo_int8 lcrzo_hs_cmp(lcrzo_consths hs1, lcrzo_consths hs2);
/* Name : lcrzo_hs_init_stdin
   Description :
     Initialize an lcrzo_hs with the address entered by the
     user through the keyboard
   Input parameter(s) :
     message : message to print before
     defaulths : default lcrzo_hs to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     hs : lcrzo_hs set with user's string
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_hs_init_stdin(lcrzo_conststring message,
			lcrzo_consths defaulths,
			lcrzo_hs hs);
/*-------------------------------------------------------------*/
/* this define permits to verify that there is no buffer overflow
   before setting a lcrzo_ips */
#define lcrzo_ips_verifbof(ips) if(strlen(ips)>LCRZO_IPS_MAXBYTES)return(LCRZO_ERR_PAOVERFLOW)
/* Name : lcrzo_ips_init
   Description :
     Initialize an lcrzo_ips address
   Input parameter(s) :
     inips : string containing the host name
   Input/output parameter(s) :
   Output parameter(s) :
     outips : lcrzo_ips set with inips
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : all the data can't be put in outips
*/
int lcrzo_ips_init(lcrzo_conststring inips,
		   lcrzo_ips outips);
/* Name : lcrzo_ips_init_ips
   Description :
     Initialize an lcrzo_ips address
   Input parameter(s) :
     inips : lcrzo_ips containing the host name
   Input/output parameter(s) :
   Output parameter(s) :
     outips : lcrzo_ips set with inips
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : all the data can't be put in outips
*/
int lcrzo_ips_init_ips(lcrzo_constips inips,
		       lcrzo_ips outips);
/* Name : lcrzo_ips_initdefault
   Description :
     Initialize a default lcrzo_ips address
   Input parameter(s) :
   Input/output parameter(s) :
   Output parameter(s) :
     ips : lcrzo_ips set with "0.0.0.0" (default value)
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_ips_initdefault(lcrzo_ips ips);
/* Name : lcrzo_ips_init_hs
   Description :
     Convert a lcrzo_hs to a lcrzo_ips
   Input parameter(s) :
     hs : lcrzo_hs to convert
   Input/output parameter(s) :
   Output parameter(s) :
     ips : lcrzo_ips set with hs value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_ips_init_hs(lcrzo_consths hs, lcrzo_ips ips);
/* Name : lcrzo_ips_init_ipa
   Description :
     Convert a lcrzo_ipa to a lcrzo_ips
   Input parameter(s) :
     ipa : lcrzo_ipa to convert
   Input/output parameter(s) :
   Output parameter(s) :
     ips : lcrzo_ips set with ipa value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_ips_init_ipa(lcrzo_constipa ipa, lcrzo_ips ips);
/* Name : lcrzo_ips_init_ipl
   Description :
     Convert a lcrzo_ipl to a lcrzo_ips
   Input parameter(s) :
     ipl : lcrzo_ipl to convert
   Input/output parameter(s) :
   Output parameter(s) :
     ips : lcrzo_ips set with ipl value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_ips_init_ipl(lcrzo_ipl ipl, lcrzo_ips ips);
/* Name : lcrzo_ips_init_eths
   Description :
     Convert a lcrzo_eths to a lcrzo_ips
   Input parameter(s) :
     eths : lcrzo_eths to convert
   Input/output parameter(s) :
   Output parameter(s) :
     ips : lcrzo_ips set with eths value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_ips_init_eths(lcrzo_consteths eths, lcrzo_ips ips);
/* Name : lcrzo_ips_init_etha
   Description :
     Convert a lcrzo_etha to a lcrzo_ips
   Input parameter(s) :
     etha : lcrzo_etha to convert
   Input/output parameter(s) :
   Output parameter(s) :
     ips : lcrzo_ips set with etha value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_ips_init_etha(lcrzo_constetha etha, lcrzo_ips ips);
/* Name : lcrzo_ips_equal
   Description :
     Verify if two lcrzo_ips are equal
   Input parameter(s) :
     ips1 : lcrzo_ips to compare with ips2
     ips2 : lcrzo_ips to compare with ips1
   Input/output parameter(s) :
   Output parameter(s) :
   Normal return values :
     0 : if ips1 and ips2 are different
     1 : if ips1 and ips2 are equal
*/
lcrzo_bool lcrzo_ips_equal(lcrzo_constips ips1, lcrzo_constips ips2);
/* Name : lcrzo_ips_cmp
   Description :
     Compare two lcrzo_ips
   Input parameter(s) :
     ips1 : lcrzo_ips to compare with ips2
     ips2 : lcrzo_ips to compare with ips1
   Input/output parameter(s) :
   Output parameter(s) :
   Normal return values :
     -1 : ips1<ips2
      0 : if ips1 and ips2 are equal
     +1 : ips1>ips2
*/
lcrzo_int8 lcrzo_ips_cmp(lcrzo_constips ips1, lcrzo_constips ips2);
/* Name : lcrzo_ips_init_stdin
   Description :
     Initialize an lcrzo_ips with the address entered by the
     user through the keyboard
   Input parameter(s) :
     message : message to print before
     defaulths : default lcrzo_hs to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     ips : lcrzo_ips set with user's string
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_ips_init_stdin(lcrzo_conststring message,
			 lcrzo_consths defaulths,
			 lcrzo_ips ips);
/*-------------------------------------------------------------*/
/* Name : lcrzo_ipa_init
   Description :
     Initialize an lcrzo_ipa address
   Input parameter(s) :
     a,b,c,d : bytes of the IP address
   Input/output parameter(s) :
   Output parameter(s) :
     outipa : lcrzo_ipa set with a.b.c.d
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_ipa_init(lcrzo_uint8 a,
		   lcrzo_uint8 b,
		   lcrzo_uint8 c,
		   lcrzo_uint8 d,
		   lcrzo_ipa outipa);
/* Name : lcrzo_ipa_init_ipa
   Description :
     Initialize an lcrzo_ipa address
   Input parameter(s) :
     inipa : input lcrzo_ipa
   Input/output parameter(s) :
   Output parameter(s) :
     outipa : output lcrzo_ipa
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_ipa_init_ipa(lcrzo_constipa inipa,
		       lcrzo_ipa outipa);
/* Name : lcrzo_ipa_initdefault
   Description :
     Initialize a default lcrzo_ipa address
   Input parameter(s) :
   Input/output parameter(s) :
   Output parameter(s) :
     ipa : lcrzo_ipa set with [0][0][0][0] (default value)
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_ipa_initdefault(lcrzo_ipa ipa);
/* Name : lcrzo_ipa_init_hs
   Description :
     Convert a lcrzo_hs to a lcrzo_ipa
   Input parameter(s) :
     hs : lcrzo_hs to convert
   Input/output parameter(s) :
   Output parameter(s) :
     ipa : lcrzo_ipa set with hs value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_ipa_init_hs(lcrzo_consths hs, lcrzo_ipa ipa);
/* Name : lcrzo_ipa_init_ips
   Description :
     Convert a lcrzo_ips to a lcrzo_ipa
   Input parameter(s) :
     ips : lcrzo_ips to convert
   Input/output parameter(s) :
   Output parameter(s) :
     ipa : lcrzo_ipa set with ips value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_ipa_init_ips(lcrzo_constips ips, lcrzo_ipa ipa);
/* Name : lcrzo_ipa_init_ipl
   Description :
     Convert a lcrzo_ipl to a lcrzo_ipa
   Input parameter(s) :
     ipl : lcrzo_ipl to convert
   Input/output parameter(s) :
   Output parameter(s) :
     ipa : lcrzo_ipa set with ipl value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_ipa_init_ipl(lcrzo_ipl ipl, lcrzo_ipa ipa);
/* Name : lcrzo_ipa_init_eths
   Description :
     Convert a lcrzo_eths to a lcrzo_ipa
   Input parameter(s) :
     eths : lcrzo_eths to convert
   Input/output parameter(s) :
   Output parameter(s) :
     ipa : lcrzo_ipa set with eths value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_ipa_init_eths(lcrzo_consteths eths, lcrzo_ipa ipa);
/* Name : lcrzo_ipa_init_etha
   Description :
     Convert a lcrzo_etha to a lcrzo_ipa
   Input parameter(s) :
     etha : lcrzo_etha to convert
   Input/output parameter(s) :
   Output parameter(s) :
     ipa : lcrzo_ipa set with etha value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_ipa_init_etha(lcrzo_constetha etha, lcrzo_ipa ipa);
/* Name : lcrzo_ipa_equal
   Description :
     Verify if two lcrzo_ipa are equal
   Input parameter(s) :
     ipa1 : lcrzo_ipa to compare with ipa2
     ipa2 : lcrzo_ipa to compare with ipa1
   Input/output parameter(s) :
   Output parameter(s) :
   Normal return values :
     0 : if ipa1 and ipa2 are different
     1 : if ipa1 and ipa2 are equal
*/
lcrzo_bool lcrzo_ipa_equal(lcrzo_constipa ipa1, lcrzo_constipa ipa2);
/* Name : lcrzo_ipa_cmp
   Description :
     Compare two lcrzo_ipa
   Input parameter(s) :
     ipa1 : lcrzo_ipa to compare with ipa2
     ipa2 : lcrzo_ipa to compare with ipa1
   Input/output parameter(s) :
   Output parameter(s) :
   Normal return values :
     -1 : ipa1<ipa2
      0 : if ipa1 and ipa2 are equal
     +1 : ipa1>ipa2
*/
lcrzo_int8 lcrzo_ipa_cmp(lcrzo_constipa ipa1, lcrzo_constipa ipa2);
/* Name : lcrzo_ipa_init_stdin
   Description :
     Initialize an lcrzo_ipa with the address entered by the
     user through the keyboard
   Input parameter(s) :
     message : message to print before
     defaulths : default lcrzo_hs to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     ipa : lcrzo_ipa set with user's string
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_ipa_init_stdin(lcrzo_conststring message,
		    lcrzo_consths defaulths,
		    lcrzo_ipa ipa);
/*-------------------------------------------------------------*/
/* Name : lcrzo_ipl_init
   Description :
     Initialize an lcrzo_ipl address
   Input parameter(s) :
     a,b,c,d : bytes of the IP address
   Input/output parameter(s) :
   Output parameter(s) :
     *poutipl : lcrzo_ipl set with a.b.c.d
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_ipl_init(lcrzo_uint8 a,
		   lcrzo_uint8 b,
		   lcrzo_uint8 c,
		   lcrzo_uint8 d,
		   lcrzo_ipl *poutipl);
/* Name : lcrzo_ipl_init_ipl
   Description :
     Initialize an lcrzo_ipl address
   Input parameter(s) :
     inipl : input ipl
   Input/output parameter(s) :
   Output parameter(s) :
     *poutipl : lcrzo_ipl set with inipl
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_ipl_init_ipl(lcrzo_ipl inipl,
		       lcrzo_ipl *poutipl);
/* Name : lcrzo_ipl_initdefault
   Description :
     Initialize a default lcrzo_ipl address
   Input parameter(s) :
   Input/output parameter(s) :
   Output parameter(s) :
     *pipl : lcrzo_ipl set with 0x00000000 (default value)
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_ipl_initdefault(lcrzo_ipl *pipl);
/* Name : lcrzo_ipl_init_hs
   Description :
     Convert a lcrzo_hs to a lcrzo_ipl
   Input parameter(s) :
     hs : lcrzo_hs to convert
   Input/output parameter(s) :
   Output parameter(s) :
     *pipl : lcrzo_ipl set with hs value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_ipl_init_hs(lcrzo_consths hs, lcrzo_ipl *pipl);
/* Name : lcrzo_ipl_init_ips
   Description :
     Convert a lcrzo_ips to a lcrzo_ipl
   Input parameter(s) :
     ips : lcrzo_ips to convert
   Input/output parameter(s) :
   Output parameter(s) :
     *pipl : lcrzo_ipl set with ips value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_ipl_init_ips(lcrzo_constips ips, lcrzo_ipl *pipl);
/* Name : lcrzo_ipl_init_ipa
   Description :
     Convert a lcrzo_ipa to a lcrzo_ipl
   Input parameter(s) :
     ipa : lcrzo_ipa to convert
   Input/output parameter(s) :
   Output parameter(s) :
     *pipl : lcrzo_ipl set with ipa value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_ipl_init_ipa(lcrzo_constipa ipa, lcrzo_ipl *pipl);
/* Name : lcrzo_ipl_init_eths
   Description :
     Convert a lcrzo_eths to a lcrzo_ipl
   Input parameter(s) :
     eths : lcrzo_eths to convert
   Input/output parameter(s) :
   Output parameter(s) :
     *pipl : lcrzo_ipl set with eths value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_ipl_init_eths(lcrzo_consteths eths, lcrzo_ipl *pipl);
/* Name : lcrzo_ipl_init_etha
   Description :
     Convert a lcrzo_etha to a lcrzo_ipl
   Input parameter(s) :
     etha : lcrzo_etha to convert
   Input/output parameter(s) :
   Output parameter(s) :
     *pipl : lcrzo_ipl set with etha value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_ipl_init_etha(lcrzo_constetha etha, lcrzo_ipl *pipl);
/* Name : lcrzo_ipl_equal
   Description :
     Verify if two lcrzo_ipl are equal
   Input parameter(s) :
     ipl1 : lcrzo_ipl to compare with ipl2
     ipl2 : lcrzo_ipl to compare with ipl1
   Input/output parameter(s) :
   Output parameter(s) :
   Normal return values :
     0 : if ipl1 and ipl2 are different
     1 : if ipl1 and ipl2 are equal
*/
lcrzo_bool lcrzo_ipl_equal(lcrzo_ipl ipl1, lcrzo_ipl ipl2);
/* Name : lcrzo_ipl_cmp
   Description :
     Compare two lcrzo_ipl
   Input parameter(s) :
     ipl1 : lcrzo_ipl to compare with ipl2
     ipl2 : lcrzo_ipl to compare with ipl1
   Input/output parameter(s) :
   Output parameter(s) :
   Normal return values :
     -1 : ipl1<ipl2
      0 : if ipl1 and ipl2 are equal
     +1 : ipl1>ipl2
*/
lcrzo_int8 lcrzo_ipl_cmp(lcrzo_ipl ipl1, lcrzo_ipl ipl2);
/* Name : lcrzo_ipl_init_stdin
   Description :
     Initialize an lcrzo_ipl with the address entered by the
     user through the keyboard
   Input parameter(s) :
     message : message to print before
     defaulths : default lcrzo_hs to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     *pipl : lcrzo_ipl set with user's string
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_ipl_init_stdin(lcrzo_conststring message,
		    lcrzo_consths defaulths,
		    lcrzo_ipl *pipl);
/*-------------------------------------------------------------*/
/* this define permits to verify that there is no buffer overflow
   before setting a lcrzo_eths */
#define lcrzo_eths_verifbof(eths) if(strlen(eths)>LCRZO_ETHS_MAXBYTES)return(LCRZO_ERR_PAOVERFLOW)
/* Name : lcrzo_eths_init
   Description :
     Initialize an lcrzo_eths address
   Input parameter(s) :
     ineths : string containing the host name
   Input/output parameter(s) :
   Output parameter(s) :
     outeths : lcrzo_eths set with ineths
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : all the data can't be put in outeths
*/
int lcrzo_eths_init(lcrzo_conststring ineths,
		    lcrzo_eths outeths);
/* Name : lcrzo_eths_init_eths
   Description :
     Initialize an lcrzo_eths address
   Input parameter(s) :
     ineths : lcrzo_eths containing the host name
   Input/output parameter(s) :
   Output parameter(s) :
     outeths : lcrzo_eths set with ineths
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKDATATRUNCATED : all the data can't be put in outeths
*/
int lcrzo_eths_init_eths(lcrzo_consteths ineths,
			 lcrzo_eths outeths);
/* Name : lcrzo_eths_initdefault
   Description :
     Initialize a default lcrzo_eths address
   Input parameter(s) :
   Input/output parameter(s) :
   Output parameter(s) :
     eths : lcrzo_eths set with "00:00:00:00:00:00" (default value)
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_eths_initdefault(lcrzo_eths eths);
/* Name : lcrzo_eths_init_hs
   Description :
     Convert a lcrzo_hs to a lcrzo_eths
   Input parameter(s) :
     hs : lcrzo_hs to convert
   Input/output parameter(s) :
   Output parameter(s) :
     eths : lcrzo_eths set with hs value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_eths_init_hs(lcrzo_consths hs, lcrzo_eths eths);
/* Name : lcrzo_eths_init_ips
   Description :
     Convert a lcrzo_ips to a lcrzo_eths
   Input parameter(s) :
     ips : lcrzo_ips to convert
   Input/output parameter(s) :
   Output parameter(s) :
     eths : lcrzo_eths set with ips value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_eths_init_ips(lcrzo_constips ips, lcrzo_eths eths);
/* Name : lcrzo_eths_init_ipa
   Description :
     Convert a lcrzo_ipa to a lcrzo_eths
   Input parameter(s) :
     ipa : lcrzo_ipa to convert
   Input/output parameter(s) :
   Output parameter(s) :
     eths : lcrzo_eths set with ipa value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_eths_init_ipa(lcrzo_constipa ipa, lcrzo_eths eths);
/* Name : lcrzo_eths_init_ipl
   Description :
     Convert a lcrzo_ipl to a lcrzo_eths
   Input parameter(s) :
     ipl : lcrzo_ipl to convert
   Input/output parameter(s) :
   Output parameter(s) :
     eths : lcrzo_eths set with ipl value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_eths_init_ipl(lcrzo_ipl ipl, lcrzo_eths eths);
/* Name : lcrzo_eths_init_etha
   Description :
     Convert a lcrzo_etha to a lcrzo_eths
   Input parameter(s) :
     etha : lcrzo_etha to convert
   Input/output parameter(s) :
   Output parameter(s) :
     eths : lcrzo_eths set with etha value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_eths_init_etha(lcrzo_constetha etha, lcrzo_eths eths);
/* Name : lcrzo_eths_equal
   Description :
     Verify if two lcrzo_eths are equal
   Input parameter(s) :
     eths1 : lcrzo_eths to compare with eths2
     eths2 : lcrzo_eths to compare with eths1
   Input/output parameter(s) :
   Output parameter(s) :
   Normal return values :
     0 : if eths1 and eths2 are different
     1 : if eths1 and eths2 are equal
*/
lcrzo_bool lcrzo_eths_equal(lcrzo_consteths eths1, lcrzo_consteths eths2);
/* Name : lcrzo_eths_cmp
   Description :
     Compare two lcrzo_eths
   Input parameter(s) :
     eths1 : lcrzo_eths to compare with eths2
     eths2 : lcrzo_eths to compare with eths1
   Input/output parameter(s) :
   Output parameter(s) :
   Normal return values :
     -1 : eths1<eths2
      0 : if eths1 and eths2 are equal
     +1 : eths1>eths2
*/
lcrzo_int8 lcrzo_eths_cmp(lcrzo_consteths eths1, lcrzo_consteths eths2);
/* Name : lcrzo_eths_init_stdin
   Description :
     Initialize an lcrzo_eths with the address entered by the
     user through the keyboard
   Input parameter(s) :
     message : message to print before
     defaulteths : default lcrzo_eths to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     eths : lcrzo_eths set with user's string
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_eths_init_stdin(lcrzo_conststring message,
			  lcrzo_consteths defaulteths,
			  lcrzo_eths eths);
/*-------------------------------------------------------------*/
/* Name : lcrzo_etha_init
   Description :
     Initialize an lcrzo_etha address
   Input parameter(s) :
     a,b,c,d,e,f : bytes of the Ethernet address
   Input/output parameter(s) :
   Output parameter(s) :
     outetha : lcrzo_etha set with a:b:c:d:e:f
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_etha_init(lcrzo_uint8 a,
		    lcrzo_uint8 b,
		    lcrzo_uint8 c,
		    lcrzo_uint8 d,
		    lcrzo_uint8 e,
		    lcrzo_uint8 f,
		    lcrzo_etha outetha);
/* Name : lcrzo_etha_init_etha
   Description :
     Initialize an lcrzo_etha address
   Input parameter(s) :
     inetha : input etha
   Input/output parameter(s) :
   Output parameter(s) :
     outetha : lcrzo_etha set with inetha
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_etha_init_etha(lcrzo_constetha inetha,
			 lcrzo_etha outetha);
/* Name : lcrzo_etha_initdefault
   Description :
     Initialize a default lcrzo_etha address
   Input parameter(s) :
   Input/output parameter(s) :
   Output parameter(s) :
     etha : lcrzo_etha set with [0][0][0][0] (default value)
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_etha_initdefault(lcrzo_etha etha);
/* Name : lcrzo_etha_init_hs
   Description :
     Convert a lcrzo_hs to a lcrzo_etha
   Input parameter(s) :
     hs : lcrzo_hs to convert
   Input/output parameter(s) :
   Output parameter(s) :
     etha : lcrzo_etha set with hs value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_etha_init_hs(lcrzo_consths hs, lcrzo_etha etha);
/* Name : lcrzo_etha_init_ips
   Description :
     Convert a lcrzo_ips to a lcrzo_etha
   Input parameter(s) :
     ips : lcrzo_ips to convert
   Input/output parameter(s) :
   Output parameter(s) :
     etha : lcrzo_etha set with ips value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_etha_init_ips(lcrzo_constips ips, lcrzo_etha etha);
/* Name : lcrzo_etha_init_ipa
   Description :
     Convert a lcrzo_ipa to a lcrzo_etha
   Input parameter(s) :
     ipa : lcrzo_ipa to convert
   Input/output parameter(s) :
   Output parameter(s) :
     etha : lcrzo_etha set with ipa value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_etha_init_ipa(lcrzo_constipa ipa, lcrzo_etha etha);
/* Name : lcrzo_etha_init_ipl
   Description :
     Convert a lcrzo_ipl to a lcrzo_etha
   Input parameter(s) :
     ipl : lcrzo_ipl to convert
   Input/output parameter(s) :
   Output parameter(s) :
     etha : lcrzo_etha set with ipl value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_etha_init_ipl(lcrzo_ipl ipl, lcrzo_etha etha);
/* Name : lcrzo_etha_init_eths
   Description :
     Convert a lcrzo_eths to a lcrzo_etha
   Input parameter(s) :
     eths : lcrzo_eths to convert
   Input/output parameter(s) :
   Output parameter(s) :
     etha : lcrzo_etha set with eths value
   Normal return values :
     LCRZO_ERR_OK : ok
     LCRZO_ERR_OKUNRESOLVED : the address could not be resolved
*/
int lcrzo_etha_init_eths(lcrzo_consteths eths, lcrzo_etha etha);
/* Name : lcrzo_etha_equal
   Description :
     Verify if two lcrzo_etha are equal
   Input parameter(s) :
     etha1 : lcrzo_etha to compare with etha2
     etha2 : lcrzo_etha to compare with etha1
   Input/output parameter(s) :
   Output parameter(s) :
   Normal return values :
     0 : if etha1 and etha2 are different
     1 : if etha1 and etha2 are equal
*/
lcrzo_bool lcrzo_etha_equal(lcrzo_constetha etha1, lcrzo_constetha etha2);
/* Name : lcrzo_etha_cmp
   Description :
     Compare two lcrzo_etha
   Input parameter(s) :
     etha1 : lcrzo_etha to compare with etha2
     etha2 : lcrzo_etha to compare with etha1
   Input/output parameter(s) :
   Output parameter(s) :
   Normal return values :
     -1 : etha1<etha2
      0 : if etha1 and etha2 are equal
     +1 : etha1>etha2
*/
lcrzo_int8 lcrzo_etha_cmp(lcrzo_constetha etha1, lcrzo_constetha etha2);
/* Name : lcrzo_etha_init_stdin
   Description :
     Initialize an lcrzo_etha with the address entered by the
     user through the keyboard
   Input parameter(s) :
     message : message to print before
     defaulteths : default lcrzo_eths to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     etha : lcrzo_etha set with user's string
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_etha_init_stdin(lcrzo_conststring message,
		     lcrzo_consteths defaulteths,
		     lcrzo_etha etha);
/*-------------------------------------------------------------*/
/* definition of an Ethernet range*/
#define LCRZO_ETHRANGE_MAXBYTES  35
typedef char lcrzo_ethrange[LCRZO_ETHRANGE_MAXBYTES+1]; /*+1 for/pour '\0'*/
typedef const lcrzo_ethrange lcrzo_constethrange;
/* examples of a lcrzo_ethrange :*/
/*  lcrzo_ethrange              :     ethinf        ethsup
  a:b:c:d:e:f                   :   a:b:c:d:e:f   a:b:c:d:e:f
  1:2:3:4:5:6-a:b:c:d:e:f       :   1:2:3:4:5:6   a:b:c:d:e:f
  1:2:3:4:5:0/FF:FF:FF:FF:FF:0  :   1:2:3:4:5:0   1:2:3:4:5:FF
  1:2:3:4:5:0/40                :   1:2:3:4:5:0   1:2:3:4:5:FF
  1:2:3:4:5/FF:FF:FF:FF:FF:0    :   1:2:3:4:5:0   1:2:3:4:5:FF
  1:2:3:4:5/40                  :   1:2:3:4:5:0   1:2:3:4:5:FF
  1:2:3:4:5:0%FF:FF:FF:FF:FF:0  :   1:2:3:4:5:1   1:2:3:4:5:FE
  1:2:3:4:5:0%40                :   1:2:3:4:5:1   1:2:3:4:5:FE
  1:2:3:4:5%FF:FF:FF:FF:FF:0    :   1:2:3:4:5:1   1:2:3:4:5:FE
  1:2:3:4:5%40                  :   1:2:3:4:5:1   1:2:3:4:5:FE
*/
/* note : '%' has the same meaning as '/', except that the
  broadcast adresses are excluded from range.*/
/* Name : lcrzo_etha_init_ethrange
   Description :
     Conversion from a lcrzo_ethrange to two lcrzo_etha
   Input parameter(s) :
     range : lcrzo_ethrange to convert
   Input/output parameter(s) :
   Output parameter(s) :
     ethainf : inferior value of the range
     ethasup : superior value of the range
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_etha_init_ethrange(lcrzo_constethrange range,
			     lcrzo_etha ethainf,
			     lcrzo_etha ethasup);
/* Name : lcrzo_ethrange_init_etha
   Description :
     Conversion from two lcrzo_etha to a lcrzo_ethrange
   Input parameter(s) :
     ethainf : inferior value of the range
     ethasup : superior value of the range
   Input/output parameter(s) :
   Output parameter(s) :
     range : lcrzo_ethrange ethainf-ethasup
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_ethrange_init_etha(lcrzo_etha ethainf,
			     lcrzo_etha ethasup,
			     lcrzo_ethrange range);
/* Name : lcrzo_ethrange_init_stdin
   Description :
     Initialize an lcrzo_ethrange with the address entered by the
     user through the keyboard
   Input parameter(s) :
     message : message to print before
     defaultrange : default lcrzo_ethrange to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     ethrange : lcrzo_ethrange set with user's string
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_ethrange_init_stdin(lcrzo_conststring message,
			      lcrzo_conststring defaultrange,
			      lcrzo_ethrange ethrange);
/*-------------------------------------------------------------*/
/* definition of an IP range */
#define LCRZO_IPRANGE_MAXBYTES   31
typedef char  lcrzo_iprange[LCRZO_IPRANGE_MAXBYTES+1]; /* +1 for/pour '\0' */
typedef const lcrzo_iprange lcrzo_constiprange;
/* examples of a lcrzo_iprange : */
/*  lcrzo_iprange               :     iplinf     iplsup
  1.2.3.4                       :     1.2.3.4     1.2.3.4
  1.2.3.4-5.6.7.8               :     1.2.3.4     5.6.7.8
  1.2.3.0/255.255.255.0         :     1.2.3.0   1.2.3.255
  1.2.3.0/24                    :     1.2.3.0   1.2.3.255
  1.2.3/255.255.255.0           :     1.2.3.0   1.2.3.255
  1.2.3/24                      :     1.2.3.0   1.2.3.255
  1.2.3.0%255.255.255.O         :     1.2.3.1   1.2.3.254
  1.2.3.0%24                    :     1.2.3.1   1.2.3.254
  1.2.3%255.255.255.O           :     1.2.3.1   1.2.3.254
  1.2.3%24                      :     1.2.3.1   1.2.3.254
*/
/* note : '%' has the same meaning as '/', except that the
  broadcast adresses are excluded from range.*/
/* Name : lcrzo_ipl_init_iprange
   Description :
     Conversion from a lcrzo_iprange to two IP addresses
   Input parameter(s) :
     range : lcrzo_iprange to convert
   Input/output parameter(s) :
   Output parameter(s) :
     *piplinf : inferior value of the range
     *piplsup : superior value of the range
   Normal return values :
     LCRZO_ERR_OK : ok
*/
/*
  It is possible to use a hostname range as input. In this case the
  separator is '=' (because '-' is a valid hostname separator). For
  example : */
/*  www.server.com
    hostname1=hostname2
    1.2.3.4=hostname2
    hostname1=5.6.7.8
*/
int lcrzo_ipl_init_iprange(lcrzo_conststring range,
			   lcrzo_ipl *piplinf,
			   lcrzo_ipl *piplsup);
/* Name : lcrzo_iprange_init_ipl
   Description :
     Conversion from two lcrzo_ipl to a lcrzo_iprange
   Input parameter(s) :
     iplinf : inferior value of the range
     iplsup : superior value of the range
   Input/output parameter(s) :
   Output parameter(s) :
     range : lcrzo_iprange iplinf-iplsup
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_iprange_init_ipl(lcrzo_ipl iplinf,
			   lcrzo_ipl iplsup,
			   lcrzo_iprange range);
/* Name : lcrzo_iprange_init_stdin
   Description :
     Initialize an lcrzo_iprange with the address entered by the
     user through the keyboard
   Input parameter(s) :
     message : message to print before
     defaultrange : default lcrzo_iprange to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     iprange : lcrzo_iprange set with user's string
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_iprange_init_stdin(lcrzo_conststring message,
			     lcrzo_conststring defaultrange,
			     lcrzo_iprange iprange);
/*-------------------------------------------------------------*/
/* definition of a port range */
#define LCRZO_PORTRANGE_MAXBYTES 11
typedef char  lcrzo_portrange[LCRZO_PORTRANGE_MAXBYTES+1]; /*+1for/pour'\0'*/
typedef const lcrzo_portrange lcrzo_constportrange;
/* examples of a lcrzo_iprange : */
/*lcrzo_portrange : portinf  portsup
  23              :    23        23
  23-25           :    23        25
  23-             :    23     65535
  0-21            :     0        21
  1-21            :     1        21
  -21             :     1        21
  -               :     1     65535
*/
/* note : the default inferior port is 1 and not 0.*/
/* Name : lcrzo_port_init_portrange
   Description :
     Conversion from a lcrzo_portrange to two ports
   Input parameter(s) :
     range : lcrzo_portrange to convert
   Input/output parameter(s) :
   Output parameter(s) :
     *pportinf : inferior value of the range
     *pportsup : superior value of the range
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_port_init_portrange(lcrzo_constportrange range,
			      lcrzo_uint16 *pportinf,
			      lcrzo_uint16 *pportsup);
/* Name : lcrzo_portrange_init_port
   Description :
     Conversion from two ports to a lcrzo_portrange
   Input parameter(s) :
     portinf : inferior value of the range
     portsup : superior value of the range
   Input/output parameter(s) :
   Output parameter(s) :
     range : lcrzo_portrange portinf-portsup
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_portrange_init_port(lcrzo_uint16 portinf,
			      lcrzo_uint16 portsup,
			      lcrzo_portrange range);
/* Name : lcrzo_portrange_init_stdin
   Description :
     Initialize an lcrzo_portrange with the address entered by the
     user through the keyboard
   Input parameter(s) :
     message : message to print before
     defaultrange : default lcrzo_portrange to use if user enters nothing
   Input/output parameter(s) :
   Output parameter(s) :
     portrange : lcrzo_portrange set with user's string
   Normal return values :
     LCRZO_ERR_OK : ok
*/
int lcrzo_portrange_init_stdin(lcrzo_conststring message,
			       lcrzo_conststring defaultrange,
			       lcrzo_portrange portrange);

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