| EDGESEC
    0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
    Secure router - reference implementation | 
File containing the implementation of mDNS service structures. More...
#include <stdint.h>#include <stdio.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <errno.h>#include <fcntl.h>#include <inttypes.h>#include <pthread.h>#include <signal.h>#include <string.h>#include <sys/ioctl.h>#include <syslog.h>#include <unistd.h>#include <eloop.h>#include <uthash.h>#include "../capture/middlewares/header_middleware/mdns_decoder.h"#include "../capture/middlewares/header_middleware/packet_queue.h"#include "../capture/pcap_service.h"#include "../supervisor/cmd_processor.h"#include "../supervisor/supervisor_config.h"#include "../utils/hashmap.h"#include "../utils/iface_mapper.h"#include "../utils/ifaceu.h"#include "../utils/log.h"#include "../utils/net.h"#include "../utils/sockctl.h"#include "../utils/squeue.h"#include "mcast.h"#include "mdns_service.h"| Macros | |
| #define | MDNS_PORT 5353 | 
| #define | MDNS_ADDR4 (uint32_t)0xE00000FB /* 224.0.0.251 */ | 
| #define | MDNS_ADDR6_INIT | 
| #define | MDNS_PCAP_BUFFER_TIMEOUT 10 | 
| Functions | |
| int | sockaddr2str (struct sockaddr_storage *sa, char *buffer, uint16_t *port) | 
| void | close_reflector_if (struct reflection_list *rif) | 
| int | forward_reflector_if6 (uint8_t *send_buf, size_t len, struct reflection_list *rif) | 
| int | forward_reflector_if4 (uint8_t *send_buf, size_t len, struct reflection_list *rif) | 
| void | eloop_reflector_handler (int sock, void *eloop_ctx, void *sock_ctx) | 
| int | register_reflector_if6 (struct eloop_data *eloop, struct mdns_context *context) | 
| int | register_reflector_if4 (struct eloop_data *eloop, struct mdns_context *context) | 
| int | init_reflections (hmap_vlan_conn **vlan_mapper, struct mdns_context *context) | 
| int | close_mdns (struct mdns_context *context) | 
| Closes mDNS service.  More... | |
| int | create_domain_command (char *src_ip, char *dst_ip, char **out) | 
| int | send_bridge_command (struct mdns_context *context, struct tuple_packet *tp) | 
| void | mdns_pcap_callback (const void *ctx, const void *pcap_ctx, char *ltype, struct pcap_pkthdr *header, uint8_t *packet) | 
| void | eloop_read_mdns_fd_handler (int sock, void *eloop_ctx, void *sock_ctx) | 
| int | run_mdns_capture (struct eloop_data *eloop, struct mdns_context *context) | 
| int | run_mdns (struct mdns_context *context) | 
| Runs the mDNS forwarder service.  More... | |
| void | free_mdns_context (struct mdns_context *context) | 
| int | init_mdns_context (struct mdns_conf *mdns_config, char *supervisor_control_path, hmap_vlan_conn *vlan_mapper, struct mdns_context *context) | 
| void * | mdns_thread (void *arg) | 
| int | run_mdns_thread (struct mdns_conf *mdns_config, char *supervisor_control_path, hmap_vlan_conn *vlan_mapper, pthread_t *id) | 
| Runs the mDNS forwarder service thread.  More... | |
File containing the implementation of mDNS service structures.
| #define MDNS_ADDR4 (uint32_t)0xE00000FB /* 224.0.0.251 */ | 
| #define MDNS_ADDR6_INIT | 
| #define MDNS_PCAP_BUFFER_TIMEOUT 10 | 
| #define MDNS_PORT 5353 | 
| int close_mdns | ( | struct mdns_context * | context | ) | 
Closes mDNS service.
| context | The mDNS context structure | 
| void close_reflector_if | ( | struct reflection_list * | rif | ) | 
| int create_domain_command | ( | char * | src_ip, | 
| char * | dst_ip, | ||
| char ** | out | ||
| ) | 
| void eloop_read_mdns_fd_handler | ( | int | sock, | 
| void * | eloop_ctx, | ||
| void * | sock_ctx | ||
| ) | 
| void eloop_reflector_handler | ( | int | sock, | 
| void * | eloop_ctx, | ||
| void * | sock_ctx | ||
| ) | 
| int forward_reflector_if4 | ( | uint8_t * | send_buf, | 
| size_t | len, | ||
| struct reflection_list * | rif | ||
| ) | 
| int forward_reflector_if6 | ( | uint8_t * | send_buf, | 
| size_t | len, | ||
| struct reflection_list * | rif | ||
| ) | 
| void free_mdns_context | ( | struct mdns_context * | context | ) | 
| int init_mdns_context | ( | struct mdns_conf * | mdns_config, | 
| char * | supervisor_control_path, | ||
| hmap_vlan_conn * | vlan_mapper, | ||
| struct mdns_context * | context | ||
| ) | 
| int init_reflections | ( | hmap_vlan_conn ** | vlan_mapper, | 
| struct mdns_context * | context | ||
| ) | 
| void mdns_pcap_callback | ( | const void * | ctx, | 
| const void * | pcap_ctx, | ||
| char * | ltype, | ||
| struct pcap_pkthdr * | header, | ||
| uint8_t * | packet | ||
| ) | 
| void* mdns_thread | ( | void * | arg | ) | 
| int register_reflector_if4 | ( | struct eloop_data * | eloop, | 
| struct mdns_context * | context | ||
| ) | 
| int register_reflector_if6 | ( | struct eloop_data * | eloop, | 
| struct mdns_context * | context | ||
| ) | 
| int run_mdns | ( | struct mdns_context * | context | ) | 
Runs the mDNS forwarder service.
| context | The mDNS context structure. | 
| int run_mdns_capture | ( | struct eloop_data * | eloop, | 
| struct mdns_context * | context | ||
| ) | 
| int run_mdns_thread | ( | struct mdns_conf * | mdns_config, | 
| char * | supervisor_control_path, | ||
| hmap_vlan_conn * | vlan_mapper, | ||
| pthread_t * | id | ||
| ) | 
Runs the mDNS forwarder service thread.
| mdns_config | The mDNS config structure | 
| supervisor_control_path | The UNIX domain supervisor control path | 
| vlan_mapper | The VLAN mapper object | 
| id | The returned thread id | 
| int send_bridge_command | ( | struct mdns_context * | context, | 
| struct tuple_packet * | tp | ||
| ) | 
| int sockaddr2str | ( | struct sockaddr_storage * | sa, | 
| char * | buffer, | ||
| uint16_t * | port | ||
| ) |