#include "NetworkInterfaces.h"#include <stddef.h>#include <syslog.h>#include <string.h>#include <errno.h>#include <unistd.h>#include <sys/ioctl.h>#include <fcntl.h>#include <assert.h>#include <net/if.h>#include <netinet/in.h>#include <linux/if_ether.h>#include <linux/if_packet.h>#include <linux/if_tun.h>#include <netinet/ip.h>#include <netinet/udp.h>#include <stdlib.h>#include "olsr.h"#include "ipcalc.h"#include "defs.h"#include "link_set.h"#include "tc_set.h"#include "net_olsr.h"#include "lq_plugin.h"#include "olsr_ip_prefix_list.h"#include "Packet.h"#include "mdns.h"#include "Address.h"
Go to the source code of this file.
Defines | |
| #define | MAX_NON_OLSR_IFS 32 |
Functions | |
| static int | CreateCaptureSocket (const char *ifName) |
| static int | CreateInterface (const char *ifName, struct interface *olsrIntf) |
| int | CreateBmfNetworkInterfaces (struct interface *skipThisIntf) |
| void | AddInterface (struct interface *newIntf) |
| void | CloseBmfNetworkInterfaces (void) |
| int | AddNonOlsrBmfIf (const char *ifName, void *data __attribute__((unused)), set_plugin_parameter_addon addon __attribute__((unused))) |
| int | set_MDNS_TTL (const char *MDNS_TTL, void *data __attribute__((unused)), set_plugin_parameter_addon addon __attribute__((unused))) |
| int | IsNonOlsrBmfIf (const char *ifName) |
Variables | |
| int | my_MDNS_TTL = 0 |
| struct TBmfInterface * | BmfInterfaces = NULL |
| struct TBmfInterface * | LastBmfInterface = NULL |
| int | HighestSkfd = -1 |
| fd_set | InputSet |
| static char | NonOlsrIfNames [MAX_NON_OLSR_IFS][IFNAMSIZ] |
| static int | nNonOlsrIfs = 0 |
| #define MAX_NON_OLSR_IFS 32 |
Definition at line 513 of file NetworkInterfaces.c.
| void AddInterface | ( | struct interface * | newIntf | ) |
Definition at line 424 of file NetworkInterfaces.c.
References CreateInterface(), interface::int_name, LOG_PLUGINS, and OLSR_DEBUG.

| int AddNonOlsrBmfIf | ( | const char * | ifName, | |
| void *data | __attribute__(unused), | |||
| set_plugin_parameter_addon addon | __attribute__(unused) | |||
| ) |
Definition at line 528 of file NetworkInterfaces.c.
References MAX_NON_OLSR_IFS, nNonOlsrIfs, and NonOlsrIfNames.
| void CloseBmfNetworkInterfaces | ( | void | ) |
Definition at line 452 of file NetworkInterfaces.c.
References TBmfInterface::capturingSkfd, TBmfInterface::encapsulatingSkfd, EtherTunTapFd, EtherTunTapIfName, TBmfInterface::ifName, LOG_PLUGINS, TBmfInterface::nBmfPacketsRx, TBmfInterface::nBmfPacketsRxDup, TBmfInterface::nBmfPacketsTx, TBmfInterface::next, OLSR_DEBUG, and TBmfInterface::olsrIntf.
| int CreateBmfNetworkInterfaces | ( | struct interface * | skipThisIntf | ) |
Definition at line 326 of file NetworkInterfaces.c.
References ARM_NOWARN_ALIGN, BmfPError(), CreateInterface(), CreateLocalEtherTunTap(), EtherTunTapFd, EtherTunTapIfName, if_ifwithaddr(), InputSet, IsNonOlsrBmfIf(), LOG_PLUGINS, OLSR_WARN, and olsr_ip_addr::v4.

| static int CreateCaptureSocket | ( | const char * | ifName | ) | [static] |
Definition at line 102 of file NetworkInterfaces.c.
References BmfPError(), DoMDNS(), olsr_config::ip_version, olsr_cnf, olsr_socket_add(), and OLSR_SOCKET_READ.
Referenced by CreateInterface().

| static int CreateInterface | ( | const char * | ifName, | |
| struct interface * | olsrIntf | |||
| ) | [static] |
Definition at line 189 of file NetworkInterfaces.c.
References ARM_NOWARN_ALIGN, BmfPError(), TBmfInterface::broadAddr, TBmfInterface::capturingSkfd, CreateCaptureSocket(), TBmfInterface::encapsulatingSkfd, TBmfInterface::ifName, interface::int_multicast, interface::int_src, TBmfInterface::intAddr, TBmfInterface::listeningSkfd, TBmfInterface::macAddr, TBmfInterface::next, olsr_malloc(), TBmfInterface::olsrIntf, olsr_sockaddr::v4, and olsr_ip_addr::v4.
Referenced by AddInterface(), and CreateBmfNetworkInterfaces().

| int IsNonOlsrBmfIf | ( | const char * | ifName | ) |
Definition at line 564 of file NetworkInterfaces.c.
References nNonOlsrIfs, and NonOlsrIfNames.
| int set_MDNS_TTL | ( | const char * | MDNS_TTL, | |
| void *data | __attribute__(unused), | |||
| set_plugin_parameter_addon addon | __attribute__(unused) | |||
| ) |
Definition at line 549 of file NetworkInterfaces.c.
References my_MDNS_TTL.
| struct TBmfInterface* BmfInterfaces = NULL |
Definition at line 80 of file NetworkInterfaces.c.
| int HighestSkfd = -1 |
Definition at line 85 of file NetworkInterfaces.c.
| fd_set InputSet |
Definition at line 88 of file NetworkInterfaces.c.
| struct TBmfInterface* LastBmfInterface = NULL |
Definition at line 81 of file NetworkInterfaces.c.
| int my_MDNS_TTL = 0 |
Definition at line 77 of file NetworkInterfaces.c.
Referenced by olsr_mdns_gen(), and set_MDNS_TTL().
int nNonOlsrIfs = 0 [static] |
Definition at line 515 of file NetworkInterfaces.c.
Referenced by AddNonOlsrBmfIf(), and IsNonOlsrBmfIf().
char NonOlsrIfNames[MAX_NON_OLSR_IFS][IFNAMSIZ] [static] |
Definition at line 514 of file NetworkInterfaces.c.
Referenced by AddNonOlsrBmfIf(), and IsNonOlsrBmfIf().
1.6.3