EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
Functions
mcast.c File Reference

File containing the implementation of mDNS utils. More...

#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <net/if.h>
#include <signal.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <syslog.h>
#include <unistd.h>
#include "../utils/log.h"
#include "../utils/sockctl.h"
#include "mcast.h"
Include dependency graph for mcast.c:

Functions

int join_mcast (int fd, const struct sockaddr_storage *sa, socklen_t sa_len, uint32_t ifindex)
 Join a multicast socket. More...
 
int create_recv_mcast (const struct sockaddr_storage *sa, socklen_t sa_len, uint32_t ifindex)
 Create a receive multicast socket. More...
 
int create_send_mcast (const struct sockaddr_storage *sa, socklen_t sa_len, uint32_t ifindex)
 Create a send multicast socket. More...
 

Detailed Description

File containing the implementation of mDNS utils.

Author
Alexandru Mereacre
Date
2021

Function Documentation

◆ create_recv_mcast()

int create_recv_mcast ( const struct sockaddr_storage *  sa,
socklen_t  sa_len,
uint32_t  ifindex 
)

Create a receive multicast socket.

Parameters
saThe socket address
sa_lenThe socket address length
ifindexThe interface index
Returns
0 on success, -1 on failuer

◆ create_send_mcast()

int create_send_mcast ( const struct sockaddr_storage *  sa,
socklen_t  sa_len,
uint32_t  ifindex 
)

Create a send multicast socket.

Parameters
saThe socket address
sa_lenThe socket address length
ifindexThe interface index
Returns
0 on success, -1 on failuer

◆ join_mcast()

int join_mcast ( int  fd,
const struct sockaddr_storage *  sa,
socklen_t  sa_len,
uint32_t  ifindex 
)

Join a multicast socket.

Parameters
fdThe socket descriptor
saThe socket address
sa_lenThe socket address length
ifindexThe interface index
Returns
0 on success, -1 on failuer