2 * Zebra SRv6 definitions
3 * Copyright (C) 2020 Hiroki Shirokura, LINE Corporation
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)
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
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
24 #include <arpa/inet.h>
25 #include <netinet/in.h>
32 /* SRv6 instance structure. */
34 struct list
*locators
;
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
42 DECLARE_HOOK(srv6_manager_client_connect
,
43 (struct zserv
*client
, vrf_id_t 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
,
50 const char *locator_name
,
52 (mc
, client
, keep
, size
, base
, vrf_id
));
53 DECLARE_HOOK(srv6_manager_release_chunk
,
54 (struct zserv
*client
,
55 const char *locator_name
,
57 (client
, locator_name
, vrf_id
));
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
);
64 void zebra_notify_srv6_locator_add(struct srv6_locator
*locator
);
65 void zebra_notify_srv6_locator_delete(struct srv6_locator
*locator
);
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);
71 extern void srv6_manager_client_connect_call(struct zserv
*client
,
73 extern void srv6_manager_get_locator_chunk_call(struct srv6_locator
**loc
,
75 const char *locator_name
,
77 extern void srv6_manager_release_locator_chunk_call(struct zserv
*client
,
78 const char *locator_name
,
80 extern int srv6_manager_client_disconnect_cb(struct zserv
*client
);
81 extern int release_daemon_srv6_locator_chunks(struct zserv
*client
);
83 #endif /* _ZEBRA_SRV6_H */