Functions

ip_addr.c File Reference

inernal ip addresses representation functions. More...

#include <stdlib.h>
#include <stdio.h>
#include "ip_addr.h"
#include "dprint.h"
#include "mem/mem.h"
#include "resolve.h"
#include "trim.h"
Include dependency graph for ip_addr.c:

Go to the source code of this file.

Functions


Detailed Description

Module: SIP-router core

Definition in file ip_addr.c.


Function Documentation

char* get_proto_name ( unsigned int  proto  ) 
Parameters:
proto - protocol number
Returns:
string with the protocol name or "unknown".

Definition at line 340 of file ip_addr.c.

Referenced by core_sockets_list().

Here is the caller graph for this function:

int mk_net ( struct net *  n,
struct ip_addr *  ip,
struct ip_addr *  mask 
)

This function will not print any error messages or allocate memory (as opposed to mk_new_net() above).

Parameters:
n - destination net structure
ip 
mask 
Returns:
-1 on error (af mismatch), 0 on success

Definition at line 124 of file ip_addr.c.

Referenced by mk_net_bitlen(), and mk_net_str().

Here is the caller graph for this function:

int mk_net_bitlen ( struct net *  n,
struct ip_addr *  ip,
unsigned int  bitlen 
)

This function will not print any error messages or allocate memory (as opposed to mk_new_net_bitlen() above).

Parameters:
n - destination net structure
ip 
bitlen 
Returns:
-1 on error (af mismatch), 0 on success

Definition at line 152 of file ip_addr.c.

References mk_net().

Referenced by mk_net_str().

Here is the call graph for this function:

Here is the caller graph for this function:

int mk_net_str ( struct net *  dst,
str s 
)
Parameters:
dst - net structure that will be filled
s - string of the form "ip", "ip/mask_len" or "ip/ip_mak".
Returns:
-1 on error, 0 on succes

Definition at line 176 of file ip_addr.c.

References _str::len, mk_net(), mk_net_bitlen(), and _str::s.

Here is the call graph for this function: