ucspi-tcp6 1.13.02
ucspi-tcp6
Loading...
Searching...
No Matches
Macros | Functions
ip4_bit.c File Reference
#include "ip.h"
#include "byte.h"
#include "scan.h"
#include "str.h"
#include "fmt.h"
#include "ip_bit.h"
Include dependency graph for ip4_bit.c:

Go to the source code of this file.

Macros

#define BITSUBSTITUTION
 

Functions

int ip4_bitstring (stralloc *ip4string, char *ip, unsigned int prefix)
 
int bitstring_ip4 (stralloc *ip4addr, stralloc *ip4string)
 

Macro Definition Documentation

◆ BITSUBSTITUTION

#define BITSUBSTITUTION

Definition at line 13 of file ip4_bit.c.

Function Documentation

◆ bitstring_ip4()

int bitstring_ip4 ( stralloc *  ip4addr,
stralloc *  ip4string 
)

/fn bitstring_ip4 /brief This function takes an IPv4 bitstring and translates it to an IPv4 address + prefix /param in: ip4string The source address (with '_' start token). /param out: ip4addr 0-terminated estination IPv4 address + net prefix (eg. 127.0.0.0/16). /return -1: lack of memory; 1: non valid IPv4 address; 0: successful converted.

Definition at line 69 of file ip4_bit.c.

Here is the caller graph for this function:

◆ ip4_bitstring()

int ip4_bitstring ( stralloc *  ip4string,
char *  ip,
unsigned int  prefix 
)

/fn ip4_bitstring /brief This function converts a IPv4 address into its binary representation with given prefix len /param out: ip4string 0-terminated destination address. /param in: ip4address The source address. /param in: prefix The net prefix bits (maximum 32 bits for IPv4). /return -1: lack of memory; 1: non valid IP address; 0: successful converted.

Definition at line 26 of file ip4_bit.c.

Here is the caller graph for this function: