Rename 'struct interface' to 'struct interface_olsr'
[olsrd.git] / lib / pud / src / networkInterfaces.h
1 #ifndef _PUD_NETWORKINTERFACES_H
2 #define _PUD_NETWORKINTERFACES_H
3
4 /* Plugin includes */
5
6 /* OLSR includes */
7 #include "olsr_types.h"
8 #include "interfaces.h"
9 #include "scheduler.h"
10
11 /* System includes */
12 #include <stdbool.h>
13 #include <net/if.h>
14
15 /** A list of TRxTxNetworkInterface objects, used for non-OLSR interfaces */
16 typedef struct _TRxTxNetworkInterface {
17                 /** The socket file descriptor for the non-OLSR interface*/
18                 int socketFd;
19
20                 /** The name of the interface */
21                 char name[IFNAMSIZ + 1];
22
23                 /** the socket handler function */
24                 socket_handler_func handler;
25
26                 /** The next TRxTxNetworkInterface in the list */
27                 struct _TRxTxNetworkInterface * next;
28 } TRxTxNetworkInterface;
29
30 /** A list of TOLSRNetworkInterface objects, used for OLSR interfaces */
31 typedef struct _TOLSRNetworkInterface {
32                 /** A pointer to the OLSR interface */
33                 struct interface_olsr * olsrIntf;
34
35                 /** The next TOLSRNetworkInterface in the list */
36                 struct _TOLSRNetworkInterface * next;
37 } TOLSRNetworkInterface;
38
39 bool createNetworkInterfaces(socket_handler_func rxSocketHandlerFunction,
40                 socket_handler_func rxSocketHandlerFunctionDownlink);
41 void closeNetworkInterfaces(void);
42
43 unsigned char * getMainIpMacAddress(void);
44 TRxTxNetworkInterface * getRxNetworkInterfaces(void);
45 TRxTxNetworkInterface * getTxNetworkInterfaces(void);
46 int getDownlinkSocketFd(void);
47 TOLSRNetworkInterface * getOlsrNetworkInterface(struct interface_olsr * olsrIntf);
48
49 #endif /* _PUD_NETWORKINTERFACES_H */