]>
Commit | Line | Data |
---|---|---|
6e68a084 HS |
1 | /* |
2 | * Zebra SRv6 definitions | |
3 | * Copyright (C) 2020 Hiroki Shirokura, LINE Corporation | |
4 | * | |
5 | * This program is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU General Public License as published by the Free | |
7 | * Software Foundation; either version 2 of the License, or (at your option) | |
8 | * any later version. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, but WITHOUT | |
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
13 | * more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License along | |
16 | * with this program; see the file COPYING; if not, write to the Free Software | |
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
18 | */ | |
19 | ||
20 | #ifndef _ZEBRA_SRV6_H | |
21 | #define _ZEBRA_SRV6_H | |
22 | ||
23 | #include <zebra.h> | |
24 | #include <arpa/inet.h> | |
25 | #include <netinet/in.h> | |
26 | ||
27 | #include "qobj.h" | |
28 | #include "prefix.h" | |
29 | #include <pthread.h> | |
30 | #include <plist.h> | |
31 | ||
32 | /* SRv6 instance structure. */ | |
33 | struct zebra_srv6 { | |
34 | struct list *locators; | |
35 | }; | |
36 | ||
37 | /* declare hooks for the basic API, so that it can be specialized or served | |
38 | * externally. Also declare a hook when those functions have been registered, | |
39 | * so that any external module wanting to replace those can react | |
40 | */ | |
41 | ||
42 | DECLARE_HOOK(srv6_manager_client_connect, | |
43 | (struct zserv *client, vrf_id_t vrf_id), | |
44 | (client, vrf_id)); | |
45 | DECLARE_HOOK(srv6_manager_client_disconnect, | |
46 | (struct zserv *client), (client)); | |
47 | DECLARE_HOOK(srv6_manager_get_chunk, | |
48 | (struct srv6_locator **loc, | |
49 | struct zserv *client, | |
50 | const char *locator_name, | |
51 | vrf_id_t vrf_id), | |
52 | (mc, client, keep, size, base, vrf_id)); | |
53 | DECLARE_HOOK(srv6_manager_release_chunk, | |
54 | (struct zserv *client, | |
55 | const char *locator_name, | |
56 | vrf_id_t vrf_id), | |
57 | (client, locator_name, vrf_id)); | |
58 | ||
59 | ||
60 | extern void zebra_srv6_locator_add(struct srv6_locator *locator); | |
61 | extern void zebra_srv6_locator_delete(struct srv6_locator *locator); | |
62 | extern struct srv6_locator *zebra_srv6_locator_lookup(const char *name); | |
63 | ||
7e975421 CS |
64 | void zebra_notify_srv6_locator_add(struct srv6_locator *locator); |
65 | void zebra_notify_srv6_locator_delete(struct srv6_locator *locator); | |
66 | ||
6e68a084 HS |
67 | extern void zebra_srv6_init(void); |
68 | extern struct zebra_srv6 *zebra_srv6_get_default(void); | |
69 | extern bool zebra_srv6_is_enable(void); | |
70 | ||
4df9d859 HS |
71 | extern void srv6_manager_client_connect_call(struct zserv *client, |
72 | vrf_id_t vrf_id); | |
6e68a084 HS |
73 | extern void srv6_manager_get_locator_chunk_call(struct srv6_locator **loc, |
74 | struct zserv *client, | |
75 | const char *locator_name, | |
76 | vrf_id_t vrf_id); | |
77 | extern void srv6_manager_release_locator_chunk_call(struct zserv *client, | |
78 | const char *locator_name, | |
79 | vrf_id_t vrf_id); | |
80 | extern int srv6_manager_client_disconnect_cb(struct zserv *client); | |
81 | extern int release_daemon_srv6_locator_chunks(struct zserv *client); | |
82 | ||
83 | #endif /* _ZEBRA_SRV6_H */ |