]>
Commit | Line | Data |
---|---|---|
acddc0ed | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
6e68a084 HS |
2 | /* |
3 | * Zebra SRv6 definitions | |
4 | * Copyright (C) 2020 Hiroki Shirokura, LINE Corporation | |
6e68a084 HS |
5 | */ |
6 | ||
7 | #ifndef _ZEBRA_SRV6_H | |
8 | #define _ZEBRA_SRV6_H | |
9 | ||
10 | #include <zebra.h> | |
11 | #include <arpa/inet.h> | |
12 | #include <netinet/in.h> | |
13 | ||
14 | #include "qobj.h" | |
15 | #include "prefix.h" | |
16 | #include <pthread.h> | |
17 | #include <plist.h> | |
18 | ||
19 | /* SRv6 instance structure. */ | |
20 | struct zebra_srv6 { | |
21 | struct list *locators; | |
22 | }; | |
23 | ||
24 | /* declare hooks for the basic API, so that it can be specialized or served | |
25 | * externally. Also declare a hook when those functions have been registered, | |
26 | * so that any external module wanting to replace those can react | |
27 | */ | |
28 | ||
29 | DECLARE_HOOK(srv6_manager_client_connect, | |
30 | (struct zserv *client, vrf_id_t vrf_id), | |
31 | (client, vrf_id)); | |
32 | DECLARE_HOOK(srv6_manager_client_disconnect, | |
33 | (struct zserv *client), (client)); | |
34 | DECLARE_HOOK(srv6_manager_get_chunk, | |
35 | (struct srv6_locator **loc, | |
36 | struct zserv *client, | |
37 | const char *locator_name, | |
38 | vrf_id_t vrf_id), | |
39 | (mc, client, keep, size, base, vrf_id)); | |
40 | DECLARE_HOOK(srv6_manager_release_chunk, | |
41 | (struct zserv *client, | |
42 | const char *locator_name, | |
43 | vrf_id_t vrf_id), | |
44 | (client, locator_name, vrf_id)); | |
45 | ||
46 | ||
47 | extern void zebra_srv6_locator_add(struct srv6_locator *locator); | |
48 | extern void zebra_srv6_locator_delete(struct srv6_locator *locator); | |
49 | extern struct srv6_locator *zebra_srv6_locator_lookup(const char *name); | |
50 | ||
7e975421 CS |
51 | void zebra_notify_srv6_locator_add(struct srv6_locator *locator); |
52 | void zebra_notify_srv6_locator_delete(struct srv6_locator *locator); | |
53 | ||
6e68a084 HS |
54 | extern void zebra_srv6_init(void); |
55 | extern struct zebra_srv6 *zebra_srv6_get_default(void); | |
56 | extern bool zebra_srv6_is_enable(void); | |
57 | ||
4df9d859 HS |
58 | extern void srv6_manager_client_connect_call(struct zserv *client, |
59 | vrf_id_t vrf_id); | |
6e68a084 HS |
60 | extern void srv6_manager_get_locator_chunk_call(struct srv6_locator **loc, |
61 | struct zserv *client, | |
62 | const char *locator_name, | |
63 | vrf_id_t vrf_id); | |
64 | extern void srv6_manager_release_locator_chunk_call(struct zserv *client, | |
65 | const char *locator_name, | |
66 | vrf_id_t vrf_id); | |
67 | extern int srv6_manager_client_disconnect_cb(struct zserv *client); | |
68 | extern int release_daemon_srv6_locator_chunks(struct zserv *client); | |
69 | ||
70 | #endif /* _ZEBRA_SRV6_H */ |