ReactOS  0.4.15-dev-3451-gf606fec
iputils.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int split_ip (char *, u8b *, int)
 
int get_ip (char *, u32b *)
 

Function Documentation

◆ get_ip()

int get_ip ( char ,
u32b  
)

Definition at line 35 of file iputils.c.

36 {
37  /* Don't touch this, unless you like pointer aritmethic */
38 
39  *dest = 0;
40 
41  if( !text )
42  return -1;
43 
44  while( *text != '\0' )
45  {
46  if( *text == '.' )
47  {
48  *dest = *dest << 8;
49  text++;
50  continue;
51  }
52  *dest *= 10;
53  *dest += (u8b)(*text-48);
54  /* 48 is not a hack, is just the code of 0 */
55  text++;
56  }
57 
58  return 0;
59 }
const WCHAR * text
Definition: package.c:1827
static char * dest
Definition: rtl.c:135
unsigned char u8b
Definition: datatypes.h:4

◆ split_ip()

int split_ip ( char ,
u8b ,
int   
)

Definition at line 6 of file iputils.c.

7 {
8  int dotcount;
9 
10  /* Don't touch this, unless you like pointer aritmethic */
11 
12  *dest = 0;
13 
14  if( !text )
15  return -1;
16 
17  for( dotcount = 0; (dotcount < place) && ( text ); text++ )
18  if( *text == '.' )
19  dotcount++;
20 
21  if( !text )
22  return -2;
23 
24  while(( *text != '.' ) && ( *text != '\0' ))
25  {
26  *dest *= 10;
27  *dest += (u8b)(*text-48);
28  /* 48 is not a hack, is just the code of 0 */
29  text++;
30  }
31 
32  return 0;
33 }
const WCHAR * text
Definition: package.c:1827
static char * place
Definition: getopt.c:55
static char * dest
Definition: rtl.c:135
unsigned char u8b
Definition: datatypes.h:4

Referenced by init_leases_list().