socket_info.c File Reference

Find & manage listen addresses. More...

#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/utsname.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include "globals.h"
#include "socket_info.h"
#include "dprint.h"
#include "mem/mem.h"
#include "ut.h"
#include "resolve.h"
#include "name_alias.h"

Include dependency graph for socket_info.c:

Go to the source code of this file.

Defines

#define sock_listadd(head, el)
#define sock_listins(el, after)
#define sock_listrm(head, el)

Functions

int add_interfaces (char *if_name, int family, unsigned short port, unsigned short proto, struct socket_info **list)
int add_listen_iface (char *name, unsigned short port, unsigned short proto, enum si_flags flags)
struct socket_infofind_si (struct ip_addr *ip, unsigned short port, unsigned short proto)
int fix_all_socket_lists (void)
static int fix_socket_list (struct socket_info **list)
static void free_sock_info (struct socket_info *si)
static char * get_proto_name (unsigned short proto)
struct socket_infogrep_sock_info (str *host, unsigned short port, unsigned short proto)
int new_sock2list (char *name, unsigned short port, unsigned short proto, enum si_flags flags, struct socket_info **list)
static struct socket_infonew_sock_info (char *name, unsigned short port, unsigned short proto, enum si_flags flags)
void print_aliases (void)
void print_all_socket_lists (void)


Detailed Description

Find & manage listen addresses.

Definition in file socket_info.c.


Define Documentation

#define sock_listadd ( head,
el   ) 

Definition at line 66 of file socket_info.c.

Referenced by new_sock2list().

#define sock_listins ( el,
after   ) 

Definition at line 80 of file socket_info.c.

#define sock_listrm ( head,
el   ) 

Value:

do {\
      if (*(head)==(el)) *(head)=(el)->next; \
      if ((el)->next) (el)->next->prev=(el)->prev; \
      if ((el)->prev) (el)->prev->next=(el)->next; \
   }while(0)

Definition at line 94 of file socket_info.c.

Referenced by fix_socket_list().


Function Documentation

int add_interfaces ( char *  if_name,
int  family,
unsigned short  port,
unsigned short  proto,
struct socket_info **  list 
)

int add_listen_iface ( char *  name,
unsigned short  port,
unsigned short  proto,
enum si_flags  flags 
)

Definition at line 329 of file socket_info.c.

References get_sock_info_list(), LM_ERR, new_sock2list(), next_proto(), port_no, PROTO_TLS, and PROTO_UDP.

Referenced by fix_all_socket_lists(), and main().

struct socket_info* find_si ( struct ip_addr ip,
unsigned short  port,
unsigned short  proto 
) [read]

int fix_all_socket_lists ( void   ) 

static int fix_socket_list ( struct socket_info **  list  )  [static]

static void free_sock_info ( struct socket_info si  )  [static]

static char* get_proto_name ( unsigned short  proto  )  [static]

Definition at line 143 of file socket_info.c.

References PROTO_NONE, PROTO_SCTP, PROTO_TCP, PROTO_TLS, and PROTO_UDP.

Referenced by fix_socket_list(), print_aliases(), and print_all_socket_lists().

struct socket_info* grep_sock_info ( str host,
unsigned short  port,
unsigned short  proto 
) [read]

int new_sock2list ( char *  name,
unsigned short  port,
unsigned short  proto,
enum si_flags  flags,
struct socket_info **  list 
)

Definition at line 309 of file socket_info.c.

References LM_ERR, new_sock_info(), and sock_listadd.

Referenced by add_interfaces(), and add_listen_iface().

static struct socket_info* new_sock_info ( char *  name,
unsigned short  port,
unsigned short  proto,
enum si_flags  flags 
) [static, read]

void print_aliases ( void   ) 

void print_all_socket_lists ( void   ) 


Generated on Thu May 24 12:00:42 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6