]>
Commit | Line | Data |
---|---|---|
1 | // SPDX-License-Identifier: GPL-2.0-or-later | |
2 | /* NHRP daemon internal structures and function prototypes | |
3 | * Copyright (c) 2014-2015 Timo Teräs | |
4 | */ | |
5 | ||
6 | #ifndef NHRPD_H | |
7 | #define NHRPD_H | |
8 | ||
9 | #include "zbuf.h" | |
10 | #include "zclient.h" | |
11 | #include "debug.h" | |
12 | #include "memory.h" | |
13 | #include "resolver.h" | |
14 | ||
15 | DECLARE_MGROUP(NHRPD); | |
16 | ||
17 | #define NHRPD_DEFAULT_HOLDTIME 7200 | |
18 | ||
19 | #define NHRP_VTY_PORT 2610 | |
20 | #define NHRP_DEFAULT_CONFIG "nhrpd.conf" | |
21 | ||
22 | extern struct event_loop *master; | |
23 | ||
24 | enum { NHRP_OK = 0, | |
25 | NHRP_ERR_FAIL, | |
26 | NHRP_ERR_NO_MEMORY, | |
27 | NHRP_ERR_UNSUPPORTED_INTERFACE, | |
28 | NHRP_ERR_NHRP_NOT_ENABLED, | |
29 | NHRP_ERR_ENTRY_EXISTS, | |
30 | NHRP_ERR_ENTRY_NOT_FOUND, | |
31 | NHRP_ERR_PROTOCOL_ADDRESS_MISMATCH, | |
32 | __NHRP_ERR_MAX }; | |
33 | #define NHRP_ERR_MAX (__NHRP_ERR_MAX - 1) | |
34 | ||
35 | struct notifier_block; | |
36 | ||
37 | typedef void (*notifier_fn_t)(struct notifier_block *, unsigned long); | |
38 | ||
39 | PREDECL_DLIST(notifier_list); | |
40 | ||
41 | struct notifier_block { | |
42 | struct notifier_list_item notifier_entry; | |
43 | notifier_fn_t action; | |
44 | }; | |
45 | ||
46 | DECLARE_DLIST(notifier_list, struct notifier_block, notifier_entry); | |
47 | ||
48 | struct notifier_list { | |
49 | struct notifier_list_head head; | |
50 | }; | |
51 | ||
52 | #define NOTIFIER_LIST_INITIALIZER(l) \ | |
53 | { \ | |
54 | .head = INIT_DLIST((l)->head) \ | |
55 | } | |
56 | ||
57 | static inline void notifier_init(struct notifier_list *l) | |
58 | { | |
59 | notifier_list_init(&l->head); | |
60 | } | |
61 | ||
62 | static inline void notifier_add(struct notifier_block *n, | |
63 | struct notifier_list *l, notifier_fn_t action) | |
64 | { | |
65 | n->action = action; | |
66 | notifier_list_add_tail(&l->head, n); | |
67 | } | |
68 | ||
69 | static inline void notifier_del(struct notifier_block *n, | |
70 | struct notifier_list *l) | |
71 | { | |
72 | notifier_list_del(&l->head, n); | |
73 | } | |
74 | ||
75 | static inline void notifier_call(struct notifier_list *l, int cmd) | |
76 | { | |
77 | struct notifier_block *n; | |
78 | ||
79 | frr_each_safe (notifier_list, &l->head, n) | |
80 | n->action(n, cmd); | |
81 | } | |
82 | ||
83 | static inline int notifier_active(struct notifier_list *l) | |
84 | { | |
85 | return notifier_list_count(&l->head) > 0; | |
86 | } | |
87 | ||
88 | extern struct hash *nhrp_gre_list; | |
89 | ||
90 | void nhrp_zebra_init(void); | |
91 | void nhrp_zebra_terminate(void); | |
92 | void nhrp_send_zebra_configure_arp(struct interface *ifp, int family); | |
93 | void nhrp_send_zebra_nbr(union sockunion *in, | |
94 | union sockunion *out, | |
95 | struct interface *ifp); | |
96 | ||
97 | void nhrp_send_zebra_gre_source_set(struct interface *ifp, | |
98 | unsigned int link_idx, | |
99 | vrf_id_t link_vrf_id); | |
100 | ||
101 | extern int nhrp_send_zebra_gre_request(struct interface *ifp); | |
102 | extern struct nhrp_gre_info *nhrp_gre_info_alloc(struct nhrp_gre_info *p); | |
103 | ||
104 | struct zbuf; | |
105 | struct nhrp_vc; | |
106 | struct nhrp_cache; | |
107 | struct nhrp_nhs; | |
108 | struct nhrp_interface; | |
109 | ||
110 | #define MAX_ID_LENGTH 64 | |
111 | #define MAX_CERT_LENGTH 2048 | |
112 | ||
113 | enum nhrp_notify_type { | |
114 | NOTIFY_INTERFACE_UP, | |
115 | NOTIFY_INTERFACE_DOWN, | |
116 | NOTIFY_INTERFACE_CHANGED, | |
117 | NOTIFY_INTERFACE_ADDRESS_CHANGED, | |
118 | NOTIFY_INTERFACE_NBMA_CHANGED, | |
119 | NOTIFY_INTERFACE_MTU_CHANGED, | |
120 | NOTIFY_INTERFACE_IPSEC_CHANGED, | |
121 | ||
122 | NOTIFY_VC_IPSEC_CHANGED, | |
123 | NOTIFY_VC_IPSEC_UPDATE_NBMA, | |
124 | ||
125 | NOTIFY_PEER_UP, | |
126 | NOTIFY_PEER_DOWN, | |
127 | NOTIFY_PEER_IFCONFIG_CHANGED, | |
128 | NOTIFY_PEER_MTU_CHANGED, | |
129 | NOTIFY_PEER_NBMA_CHANGING, | |
130 | ||
131 | NOTIFY_CACHE_UP, | |
132 | NOTIFY_CACHE_DOWN, | |
133 | NOTIFY_CACHE_DELETE, | |
134 | NOTIFY_CACHE_USED, | |
135 | NOTIFY_CACHE_BINDING_CHANGE, | |
136 | }; | |
137 | ||
138 | struct nhrp_vc { | |
139 | struct notifier_list notifier_list; | |
140 | uint32_t ipsec; | |
141 | uint32_t ike_uniqueid; | |
142 | uint8_t updating; | |
143 | uint8_t abort_migration; | |
144 | ||
145 | struct nhrp_vc_peer { | |
146 | union sockunion nbma; | |
147 | char id[MAX_ID_LENGTH]; | |
148 | uint16_t certlen; | |
149 | uint8_t cert[MAX_CERT_LENGTH]; | |
150 | } local, remote; | |
151 | }; | |
152 | ||
153 | enum nhrp_route_type { | |
154 | NHRP_ROUTE_BLACKHOLE, | |
155 | NHRP_ROUTE_LOCAL, | |
156 | NHRP_ROUTE_NBMA_NEXTHOP, | |
157 | NHRP_ROUTE_OFF_NBMA, | |
158 | }; | |
159 | ||
160 | struct nhrp_peer { | |
161 | unsigned int ref; | |
162 | unsigned online : 1; | |
163 | unsigned requested : 1; | |
164 | unsigned fallback_requested : 1; | |
165 | unsigned prio : 1; | |
166 | struct notifier_list notifier_list; | |
167 | struct interface *ifp; | |
168 | struct nhrp_vc *vc; | |
169 | struct event *t_fallback; | |
170 | struct notifier_block vc_notifier, ifp_notifier; | |
171 | struct event *t_timer; | |
172 | }; | |
173 | ||
174 | struct nhrp_packet_parser { | |
175 | struct interface *ifp; | |
176 | struct nhrp_afi_data *if_ad; | |
177 | struct nhrp_peer *peer; | |
178 | struct zbuf *pkt; | |
179 | struct zbuf payload; | |
180 | struct zbuf extensions; | |
181 | struct nhrp_packet_header *hdr; | |
182 | enum nhrp_route_type route_type; | |
183 | struct prefix route_prefix; | |
184 | union sockunion src_nbma, src_proto, dst_proto; | |
185 | }; | |
186 | ||
187 | struct nhrp_reqid_pool { | |
188 | struct hash *reqid_hash; | |
189 | uint32_t next_request_id; | |
190 | }; | |
191 | ||
192 | struct nhrp_reqid { | |
193 | uint32_t request_id; | |
194 | void (*cb)(struct nhrp_reqid *, void *); | |
195 | }; | |
196 | ||
197 | extern struct nhrp_reqid_pool nhrp_packet_reqid; | |
198 | extern struct nhrp_reqid_pool nhrp_event_reqid; | |
199 | ||
200 | enum nhrp_cache_type { | |
201 | NHRP_CACHE_INVALID = 0, | |
202 | NHRP_CACHE_INCOMPLETE, | |
203 | NHRP_CACHE_NEGATIVE, | |
204 | NHRP_CACHE_CACHED, | |
205 | NHRP_CACHE_DYNAMIC, | |
206 | NHRP_CACHE_NHS, | |
207 | NHRP_CACHE_STATIC, | |
208 | NHRP_CACHE_LOCAL, | |
209 | NHRP_CACHE_NUM_TYPES | |
210 | }; | |
211 | ||
212 | extern const char *const nhrp_cache_type_str[]; | |
213 | extern unsigned long nhrp_cache_counts[NHRP_CACHE_NUM_TYPES]; | |
214 | ||
215 | struct nhrp_cache_config { | |
216 | struct interface *ifp; | |
217 | union sockunion remote_addr; | |
218 | enum nhrp_cache_type type; | |
219 | union sockunion nbma; | |
220 | }; | |
221 | ||
222 | struct nhrp_cache { | |
223 | struct interface *ifp; | |
224 | union sockunion remote_addr; | |
225 | ||
226 | unsigned map : 1; | |
227 | unsigned used : 1; | |
228 | unsigned route_installed : 1; | |
229 | unsigned nhrp_route_installed : 1; | |
230 | ||
231 | struct notifier_block peer_notifier; | |
232 | struct notifier_block newpeer_notifier; | |
233 | struct notifier_list notifier_list; | |
234 | struct nhrp_reqid eventid; | |
235 | struct event *t_timeout; | |
236 | struct event *t_auth; | |
237 | ||
238 | struct { | |
239 | enum nhrp_cache_type type; | |
240 | union sockunion remote_nbma_natoa; | |
241 | union sockunion remote_nbma_claimed; | |
242 | struct nhrp_peer *peer; | |
243 | time_t expires; | |
244 | uint32_t mtu; | |
245 | int holding_time; | |
246 | } cur, new; | |
247 | }; | |
248 | ||
249 | struct nhrp_shortcut { | |
250 | struct prefix *p; | |
251 | union sockunion addr; | |
252 | ||
253 | struct nhrp_reqid reqid; | |
254 | struct event *t_timer; | |
255 | ||
256 | enum nhrp_cache_type type; | |
257 | unsigned int holding_time; | |
258 | unsigned route_installed : 1; | |
259 | unsigned expiring : 1; | |
260 | ||
261 | struct nhrp_cache *cache; | |
262 | struct notifier_block cache_notifier; | |
263 | }; | |
264 | ||
265 | PREDECL_DLIST(nhrp_nhslist); | |
266 | PREDECL_DLIST(nhrp_mcastlist); | |
267 | PREDECL_DLIST(nhrp_reglist); | |
268 | ||
269 | struct nhrp_nhs { | |
270 | struct interface *ifp; | |
271 | struct nhrp_nhslist_item nhslist_entry; | |
272 | ||
273 | unsigned hub : 1; | |
274 | afi_t afi; | |
275 | union sockunion proto_addr; | |
276 | const char *nbma_fqdn; /* IP-address or FQDN */ | |
277 | ||
278 | struct event *t_resolve; | |
279 | struct resolver_query dns_resolve; | |
280 | struct nhrp_reglist_head reglist_head; | |
281 | }; | |
282 | ||
283 | DECLARE_DLIST(nhrp_nhslist, struct nhrp_nhs, nhslist_entry); | |
284 | ||
285 | struct nhrp_multicast { | |
286 | struct interface *ifp; | |
287 | struct nhrp_mcastlist_item mcastlist_entry; | |
288 | afi_t afi; | |
289 | union sockunion nbma_addr; /* IP-address */ | |
290 | }; | |
291 | ||
292 | DECLARE_DLIST(nhrp_mcastlist, struct nhrp_multicast, mcastlist_entry); | |
293 | ||
294 | struct nhrp_registration { | |
295 | struct nhrp_reglist_item reglist_entry; | |
296 | struct event *t_register; | |
297 | struct nhrp_nhs *nhs; | |
298 | struct nhrp_reqid reqid; | |
299 | unsigned int timeout; | |
300 | unsigned mark : 1; | |
301 | union sockunion proto_addr; | |
302 | struct nhrp_peer *peer; | |
303 | struct notifier_block peer_notifier; | |
304 | }; | |
305 | ||
306 | DECLARE_DLIST(nhrp_reglist, struct nhrp_registration, reglist_entry); | |
307 | ||
308 | #define NHRP_IFF_SHORTCUT 0x0001 | |
309 | #define NHRP_IFF_REDIRECT 0x0002 | |
310 | #define NHRP_IFF_REG_NO_UNIQUE 0x0100 | |
311 | ||
312 | struct nhrp_interface { | |
313 | struct interface *ifp; | |
314 | ||
315 | unsigned enabled : 1; | |
316 | ||
317 | char *ipsec_profile, *ipsec_fallback_profile, *source; | |
318 | union sockunion nbma; | |
319 | union sockunion nat_nbma; | |
320 | unsigned int link_idx; | |
321 | unsigned int link_vrf_id; | |
322 | uint32_t i_grekey; | |
323 | uint32_t o_grekey; | |
324 | ||
325 | struct hash *peer_hash; | |
326 | struct hash *cache_config_hash; | |
327 | struct hash *cache_hash; | |
328 | ||
329 | struct notifier_list notifier_list; | |
330 | ||
331 | struct interface *nbmaifp; | |
332 | struct notifier_block nbmanifp_notifier; | |
333 | ||
334 | struct nhrp_afi_data { | |
335 | unsigned flags; | |
336 | unsigned short configured : 1; | |
337 | union sockunion addr; | |
338 | uint32_t network_id; | |
339 | short configured_mtu; | |
340 | unsigned short mtu; | |
341 | unsigned int holdtime; | |
342 | struct nhrp_nhslist_head nhslist_head; | |
343 | struct nhrp_mcastlist_head mcastlist_head; | |
344 | } afi[AFI_MAX]; | |
345 | }; | |
346 | ||
347 | struct nhrp_gre_info { | |
348 | ifindex_t ifindex; | |
349 | struct in_addr vtep_ip; /* IFLA_GRE_LOCAL */ | |
350 | struct in_addr vtep_ip_remote; /* IFLA_GRE_REMOTE */ | |
351 | uint32_t ikey; | |
352 | uint32_t okey; | |
353 | ifindex_t ifindex_link; /* Interface index of interface | |
354 | * linked with GRE | |
355 | */ | |
356 | vrf_id_t vrfid_link; | |
357 | }; | |
358 | ||
359 | extern struct zebra_privs_t nhrpd_privs; | |
360 | ||
361 | int sock_open_unix(const char *path); | |
362 | ||
363 | void nhrp_interface_init(void); | |
364 | void nhrp_interface_update(struct interface *ifp); | |
365 | void nhrp_interface_update_mtu(struct interface *ifp, afi_t afi); | |
366 | void nhrp_interface_update_nbma(struct interface *ifp, | |
367 | struct nhrp_gre_info *gre_info); | |
368 | ||
369 | int nhrp_interface_add(ZAPI_CALLBACK_ARGS); | |
370 | int nhrp_interface_delete(ZAPI_CALLBACK_ARGS); | |
371 | int nhrp_interface_up(ZAPI_CALLBACK_ARGS); | |
372 | int nhrp_interface_down(ZAPI_CALLBACK_ARGS); | |
373 | int nhrp_interface_address_add(ZAPI_CALLBACK_ARGS); | |
374 | int nhrp_interface_address_delete(ZAPI_CALLBACK_ARGS); | |
375 | int nhrp_neighbor_operation(ZAPI_CALLBACK_ARGS); | |
376 | int nhrp_gre_update(ZAPI_CALLBACK_ARGS); | |
377 | ||
378 | void nhrp_interface_notify_add(struct interface *ifp, struct notifier_block *n, | |
379 | notifier_fn_t fn); | |
380 | void nhrp_interface_notify_del(struct interface *ifp, struct notifier_block *n); | |
381 | void nhrp_interface_set_protection(struct interface *ifp, const char *profile, | |
382 | const char *fallback_profile); | |
383 | void nhrp_interface_set_source(struct interface *ifp, const char *ifname); | |
384 | extern int nhrp_ifp_create(struct interface *ifp); | |
385 | extern int nhrp_ifp_up(struct interface *ifp); | |
386 | extern int nhrp_ifp_down(struct interface *ifp); | |
387 | extern int nhrp_ifp_destroy(struct interface *ifp); | |
388 | ||
389 | int nhrp_nhs_add(struct interface *ifp, afi_t afi, union sockunion *proto_addr, | |
390 | const char *nbma_fqdn); | |
391 | int nhrp_nhs_del(struct interface *ifp, afi_t afi, union sockunion *proto_addr, | |
392 | const char *nbma_fqdn); | |
393 | int nhrp_nhs_free(struct nhrp_interface *nifp, afi_t afi, struct nhrp_nhs *nhs); | |
394 | void nhrp_nhs_terminate(void); | |
395 | void nhrp_nhs_foreach(struct interface *ifp, afi_t afi, | |
396 | void (*cb)(struct nhrp_nhs *, struct nhrp_registration *, | |
397 | void *), | |
398 | void *ctx); | |
399 | void nhrp_nhs_interface_del(struct interface *ifp); | |
400 | ||
401 | int nhrp_multicast_add(struct interface *ifp, afi_t afi, | |
402 | union sockunion *nbma_addr); | |
403 | int nhrp_multicast_del(struct interface *ifp, afi_t afi, | |
404 | union sockunion *nbma_addr); | |
405 | void nhrp_multicast_interface_del(struct interface *ifp); | |
406 | void nhrp_multicast_foreach(struct interface *ifp, afi_t afi, | |
407 | void (*cb)(struct nhrp_multicast *, void *), | |
408 | void *ctx); | |
409 | void netlink_mcast_set_nflog_group(int nlgroup); | |
410 | ||
411 | void nhrp_route_update_nhrp(const struct prefix *p, struct interface *ifp); | |
412 | void nhrp_route_announce(int add, enum nhrp_cache_type type, | |
413 | const struct prefix *p, struct interface *ifp, | |
414 | const union sockunion *nexthop, uint32_t mtu); | |
415 | int nhrp_route_read(ZAPI_CALLBACK_ARGS); | |
416 | int nhrp_route_get_nexthop(const union sockunion *addr, struct prefix *p, | |
417 | union sockunion *via, struct interface **ifp); | |
418 | enum nhrp_route_type nhrp_route_address(struct interface *in_ifp, | |
419 | union sockunion *addr, struct prefix *p, | |
420 | struct nhrp_peer **peer); | |
421 | ||
422 | void nhrp_config_init(void); | |
423 | ||
424 | void nhrp_shortcut_init(void); | |
425 | void nhrp_shortcut_terminate(void); | |
426 | void nhrp_shortcut_initiate(union sockunion *addr); | |
427 | void nhrp_shortcut_foreach(afi_t afi, | |
428 | void (*cb)(struct nhrp_shortcut *, void *), | |
429 | void *ctx); | |
430 | void nhrp_shortcut_purge(struct nhrp_shortcut *s, int force); | |
431 | void nhrp_shortcut_prefix_change(const struct prefix *p, int deleted); | |
432 | ||
433 | void nhrp_cache_interface_del(struct interface *ifp); | |
434 | void nhrp_cache_config_free(struct nhrp_cache_config *c); | |
435 | struct nhrp_cache_config *nhrp_cache_config_get(struct interface *ifp, | |
436 | union sockunion *remote_addr, | |
437 | int create); | |
438 | struct nhrp_cache *nhrp_cache_get(struct interface *ifp, | |
439 | union sockunion *remote_addr, int create); | |
440 | void nhrp_cache_foreach(struct interface *ifp, | |
441 | void (*cb)(struct nhrp_cache *, void *), void *ctx); | |
442 | void nhrp_cache_config_foreach(struct interface *ifp, | |
443 | void (*cb)(struct nhrp_cache_config *, void *), void *ctx); | |
444 | void nhrp_cache_set_used(struct nhrp_cache *, int); | |
445 | int nhrp_cache_update_binding(struct nhrp_cache *, enum nhrp_cache_type type, | |
446 | int holding_time, struct nhrp_peer *p, | |
447 | uint32_t mtu, union sockunion *nbma_natoa, | |
448 | union sockunion *claimed_nbma); | |
449 | void nhrp_cache_notify_add(struct nhrp_cache *c, struct notifier_block *, | |
450 | notifier_fn_t); | |
451 | void nhrp_cache_notify_del(struct nhrp_cache *c, struct notifier_block *); | |
452 | ||
453 | void nhrp_vc_init(void); | |
454 | void nhrp_vc_terminate(void); | |
455 | struct nhrp_vc *nhrp_vc_get(const union sockunion *src, | |
456 | const union sockunion *dst, int create); | |
457 | int nhrp_vc_ipsec_updown(uint32_t child_id, struct nhrp_vc *vc); | |
458 | void nhrp_vc_notify_add(struct nhrp_vc *, struct notifier_block *, | |
459 | notifier_fn_t); | |
460 | void nhrp_vc_notify_del(struct nhrp_vc *, struct notifier_block *); | |
461 | void nhrp_vc_foreach(void (*cb)(struct nhrp_vc *, void *), void *ctx); | |
462 | void nhrp_vc_reset(void); | |
463 | ||
464 | void vici_init(void); | |
465 | void vici_terminate(void); | |
466 | void vici_terminate_vc_by_profile_name(char *profile_name); | |
467 | void vici_terminate_vc_by_ike_id(unsigned int ike_id); | |
468 | void vici_request_vc(const char *profile, union sockunion *src, | |
469 | union sockunion *dst, int prio); | |
470 | ||
471 | extern const char *nhrp_event_socket_path; | |
472 | ||
473 | void evmgr_init(void); | |
474 | void evmgr_terminate(void); | |
475 | void evmgr_set_socket(const char *socket); | |
476 | void evmgr_notify(const char *name, struct nhrp_cache *c, | |
477 | void (*cb)(struct nhrp_reqid *, void *)); | |
478 | ||
479 | struct nhrp_packet_header *nhrp_packet_push(struct zbuf *zb, uint8_t type, | |
480 | const union sockunion *src_nbma, | |
481 | const union sockunion *src_proto, | |
482 | const union sockunion *dst_proto); | |
483 | void nhrp_packet_complete(struct zbuf *zb, struct nhrp_packet_header *hdr); | |
484 | uint16_t nhrp_packet_calculate_checksum(const uint8_t *pdu, uint16_t len); | |
485 | ||
486 | struct nhrp_packet_header *nhrp_packet_pull(struct zbuf *zb, | |
487 | union sockunion *src_nbma, | |
488 | union sockunion *src_proto, | |
489 | union sockunion *dst_proto); | |
490 | ||
491 | struct nhrp_cie_header *nhrp_cie_push(struct zbuf *zb, uint8_t code, | |
492 | const union sockunion *nbma, | |
493 | const union sockunion *proto); | |
494 | struct nhrp_cie_header *nhrp_cie_pull(struct zbuf *zb, | |
495 | struct nhrp_packet_header *hdr, | |
496 | union sockunion *nbma, | |
497 | union sockunion *proto); | |
498 | ||
499 | struct nhrp_extension_header * | |
500 | nhrp_ext_push(struct zbuf *zb, struct nhrp_packet_header *hdr, uint16_t type); | |
501 | void nhrp_ext_complete(struct zbuf *zb, struct nhrp_extension_header *ext); | |
502 | struct nhrp_extension_header *nhrp_ext_pull(struct zbuf *zb, | |
503 | struct zbuf *payload); | |
504 | void nhrp_ext_request(struct zbuf *zb, struct nhrp_packet_header *hdr, | |
505 | struct interface *); | |
506 | int nhrp_ext_reply(struct zbuf *zb, struct nhrp_packet_header *hdr, | |
507 | struct interface *ifp, struct nhrp_extension_header *ext, | |
508 | struct zbuf *extpayload); | |
509 | ||
510 | uint32_t nhrp_reqid_alloc(struct nhrp_reqid_pool *, struct nhrp_reqid *r, | |
511 | void (*cb)(struct nhrp_reqid *, void *)); | |
512 | void nhrp_reqid_free(struct nhrp_reqid_pool *, struct nhrp_reqid *r); | |
513 | struct nhrp_reqid *nhrp_reqid_lookup(struct nhrp_reqid_pool *, uint32_t reqid); | |
514 | ||
515 | int nhrp_packet_init(void); | |
516 | ||
517 | void nhrp_peer_interface_del(struct interface *ifp); | |
518 | struct nhrp_peer *nhrp_peer_get(struct interface *ifp, | |
519 | const union sockunion *remote_nbma); | |
520 | struct nhrp_peer *nhrp_peer_ref(struct nhrp_peer *p); | |
521 | void nhrp_peer_unref(struct nhrp_peer *p); | |
522 | int nhrp_peer_check(struct nhrp_peer *p, int establish); | |
523 | void nhrp_peer_notify_add(struct nhrp_peer *p, struct notifier_block *, | |
524 | notifier_fn_t); | |
525 | void nhrp_peer_notify_del(struct nhrp_peer *p, struct notifier_block *); | |
526 | void nhrp_peer_recv(struct nhrp_peer *p, struct zbuf *zb); | |
527 | void nhrp_peer_send(struct nhrp_peer *p, struct zbuf *zb); | |
528 | void nhrp_peer_send_indication(struct interface *ifp, uint16_t, struct zbuf *); | |
529 | ||
530 | int nhrp_nhs_match_ip(union sockunion *in_ip, struct nhrp_interface *nifp); | |
531 | ||
532 | #endif |