forked from servalproject/batman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.h
153 lines (136 loc) · 3.41 KB
/
types.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*
* Copyright (C) 2009 B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
*
*/
#ifndef TYPES_H
#define TYPES_H
#include "packet.h"
struct orig_node { /* structure for orig_list maintaining nodes of mesh */
uint32_t orig;
struct neigh_node *router;
struct batman_if *batman_if;
TYPE_OF_WORD *bcast_own;
uint8_t *bcast_own_sum;
uint8_t tq_own;
int tq_asym_penalty;
uint32_t last_valid; /* when last packet from this node was received */
uint8_t gwflags; /* flags related to gateway functions: gateway class */
unsigned char *hna_buff;
int16_t hna_buff_len;
uint16_t last_real_seqno; /* last and best known squence number */
uint8_t last_ttl; /* ttl of last received packet */
struct list_head_first neigh_list;
};
struct neigh_node {
struct list_head list;
uint32_t addr;
uint8_t real_packet_count;
uint8_t *tq_recv;
uint8_t tq_index;
uint8_t tq_avg;
uint8_t last_ttl;
uint32_t last_valid; /* when last packet via this neighbour was received */
TYPE_OF_WORD *real_bits;
struct orig_node *orig_node;
struct batman_if *if_incoming;
};
struct forw_node { /* structure for forw_list maintaining packets to be send/forwarded */
struct list_head list;
uint32_t send_time;
uint8_t own;
unsigned char *pack_buff;
uint16_t pack_buff_len;
uint32_t direct_link_flags;
uint8_t num_packets;
struct batman_if *if_incoming;
};
struct gw_node {
struct list_head list;
struct orig_node *orig_node;
uint16_t gw_port;
uint16_t gw_failure;
uint32_t last_failure;
uint32_t deleted;
};
struct batman_if {
struct list_head list;
char *dev;
int32_t udp_send_sock;
int32_t udp_recv_sock;
int32_t udp_tunnel_sock;
uint8_t if_num;
uint8_t if_active;
int32_t if_index;
int8_t if_rp_filter_old;
int8_t if_send_redirects_old;
pthread_t listen_thread_id;
struct sockaddr_in addr;
struct sockaddr_in broad;
uint32_t netaddr;
uint8_t netmask;
uint8_t wifi_if;
struct bat_packet out;
};
struct gw_client {
uint32_t wip_addr;
uint32_t vip_addr;
uint16_t client_port;
uint32_t last_keep_alive;
uint8_t nat_warn;
};
struct free_ip {
struct list_head list;
uint32_t addr;
};
struct vis_if {
int32_t sock;
struct sockaddr_in addr;
};
struct unix_if {
int32_t unix_sock;
pthread_t listen_thread_id;
struct sockaddr_un addr;
struct list_head_first client_list;
};
struct unix_client {
struct list_head list;
int32_t sock;
uint8_t debug_level;
};
struct debug_clients {
void **fd_list;
int16_t *clients_num;
pthread_mutex_t **mutex;
};
struct debug_level_info {
struct list_head list;
int32_t fd;
};
struct curr_gw_data {
unsigned int orig;
struct gw_node *gw_node;
struct batman_if *batman_if;
};
struct batgat_ioc_args {
char dev_name[16];
unsigned char exists;
uint32_t universal;
uint32_t ifindex;
};
#endif