Functions

socket_info.c File Reference

SIP-router core ::Module: SIP-router core. 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.

Functions


Detailed Description

Definition in file socket_info.c.


Function Documentation

int socket2str ( char *  s,
int *  len,
struct socket_info *  si 
)

This function converts the transport protocol, the IP address and the port number in a comma delimited string of form proto:ip:port. The resulting string is NOT zero terminated

Parameters:
s is a pointer to the destination memory buffer
len is a pointer to an integer variable. Initially the variable should contain the size of the buffer in s. The value of the variable will be changed to the length of the resulting string on success and to the desired size of the destination buffer if it is too small
si is a pointer to the socket_info structure to be printed
Returns:
-1 on error and 0 on success

Definition at line 370 of file socket_info.c.