reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Udp.cxx File Reference
#include "rutil/ResipAssert.h"
#include <cstdio>
#include <cstring>
#include <errno.h>
#include <iostream>
#include <cstdlib>
#include <time.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netdb.h>
#include <string.h>
#include "rutil/stun/Udp.hxx"

Go to the source code of this file.

Functions

resip::Socket openPort (unsigned short port, unsigned int interfaceIp, bool verbose)
 Open a UDP socket to receive on the given port - if port is 0, pick a a port, if interfaceIp!=0 then use ONLY the interface specified instead of all of them

 
bool getMessage (resip::Socket fd, char *buf, int *len, uint32_t *srcIp, unsigned short *srcPort, bool verbose)
 recive a UDP message
 
bool sendMessage (resip::Socket fd, char *buf, int l, unsigned int dstIp, unsigned short dstPort, bool verbose)
 send a UDP message
 

Function Documentation

◆ getMessage()

bool getMessage ( resip::Socket  fd,
char *  buf,
int *  len,
uint32_t *  srcIp,
unsigned short *  srcPort,
bool  verbose 
)

recive a UDP message

Definition at line 118 of file Udp.cxx.

◆ openPort()

resip::Socket openPort ( unsigned short  port,
unsigned int  interfaceIp,
bool  verbose 
)

Open a UDP socket to receive on the given port - if port is 0, pick a a port, if interfaceIp!=0 then use ONLY the interface specified instead of all of them

Definition at line 38 of file Udp.cxx.

◆ sendMessage()

bool sendMessage ( resip::Socket  fd,
char *  buf,
int  l,
unsigned int  dstIp,
unsigned short  dstPort,
bool  verbose 
)

send a UDP message

Definition at line 187 of file Udp.cxx.