]>
Commit | Line | Data |
---|---|---|
bf094f69 | 1 | /* |
d8647095 | 2 | * Zebra API message creation & consumption. |
bf094f69 QY |
3 | * Portions: |
4 | * Copyright (C) 1997-1999 Kunihiro Ishiguro | |
5 | * Copyright (C) 2015-2018 Cumulus Networks, Inc. | |
6 | * et al. | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or modify it | |
9 | * under the terms of the GNU General Public License as published by the Free | |
10 | * Software Foundation; either version 2 of the License, or (at your option) | |
11 | * any later version. | |
12 | * | |
13 | * This program is distributed in the hope that it will be useful, but WITHOUT | |
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
16 | * more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License along | |
19 | * with this program; see the file COPYING; if not, write to the Free Software | |
20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
21 | */ | |
22 | ||
23 | #include "lib/if.h" | |
24 | #include "lib/vrf.h" | |
25 | #include "lib/zclient.h" | |
26 | #include "lib/pbr.h" | |
27 | ||
28 | #include "zebra/rib.h" | |
29 | #include "zebra/zserv.h" | |
30 | #include "zebra/zebra_pbr.h" | |
43e52561 | 31 | #include "zebra/zebra_errors.h" |
e11d7c96 | 32 | #include "zebra/label_manager.h" |
6e68a084 | 33 | #include "zebra/zebra_srv6.h" |
e11d7c96 | 34 | |
bf094f69 | 35 | |
51e94aa7 EDP |
36 | #ifdef __cplusplus |
37 | extern "C" { | |
38 | #endif | |
39 | ||
bf094f69 QY |
40 | /* |
41 | * This is called to process inbound ZAPI messages. | |
42 | * | |
43 | * client | |
44 | * the client datastructure | |
45 | * | |
79b3664a MS |
46 | * fifo |
47 | * a batch of messages | |
bf094f69 | 48 | */ |
79b3664a MS |
49 | extern void zserv_handle_commands(struct zserv *client, |
50 | struct stream_fifo *fifo); | |
bf094f69 | 51 | |
8b1766b1 QY |
52 | extern int zsend_vrf_add(struct zserv *zclient, struct zebra_vrf *zvrf); |
53 | extern int zsend_vrf_delete(struct zserv *zclient, struct zebra_vrf *zvrf); | |
54 | extern int zsend_interface_add(struct zserv *zclient, struct interface *ifp); | |
55 | extern int zsend_interface_delete(struct zserv *zclient, struct interface *ifp); | |
56 | extern int zsend_interface_addresses(struct zserv *zclient, | |
57 | struct interface *ifp); | |
58 | extern int zsend_interface_address(int cmd, struct zserv *zclient, | |
59 | struct interface *ifp, | |
60 | struct connected *ifc); | |
61 | extern void nbr_connected_add_ipv6(struct interface *ifp, | |
62 | struct in6_addr *address); | |
63 | extern void nbr_connected_delete_ipv6(struct interface *ifp, | |
64 | struct in6_addr *address); | |
65 | extern int zsend_interface_update(int cmd, struct zserv *client, | |
66 | struct interface *ifp); | |
67 | extern int zsend_redistribute_route(int cmd, struct zserv *zclient, | |
84faa420 | 68 | const struct route_node *rn, |
40f321c0 MS |
69 | const struct route_entry *re); |
70 | ||
98a3fb0a SM |
71 | extern int zsend_router_id_update(struct zserv *zclient, afi_t afi, |
72 | struct prefix *p, vrf_id_t vrf_id); | |
8b1766b1 QY |
73 | extern int zsend_interface_vrf_update(struct zserv *zclient, |
74 | struct interface *ifp, vrf_id_t vrf_id); | |
75 | extern int zsend_interface_link_params(struct zserv *zclient, | |
76 | struct interface *ifp); | |
77 | extern int zsend_pw_update(struct zserv *client, struct zebra_pw *pw); | |
a7704e1b DS |
78 | extern int zsend_route_notify_owner(const struct route_node *rn, |
79 | struct route_entry *re, | |
77b38a4a S |
80 | enum zapi_route_notify_owner note, |
81 | afi_t afi, safi_t safi); | |
25779064 | 82 | extern int zsend_route_notify_owner_ctx(const struct zebra_dplane_ctx *ctx, |
7cdb1a84 | 83 | enum zapi_route_notify_owner note); |
bf094f69 | 84 | |
f62e5480 | 85 | extern void zsend_rule_notify_owner(const struct zebra_dplane_ctx *ctx, |
bf094f69 | 86 | enum zapi_rule_notify_owner note); |
ef524230 | 87 | |
5162e000 | 88 | extern void zsend_iptable_notify_owner(const struct zebra_dplane_ctx *ctx, |
33c08518 | 89 | enum zapi_iptable_notify_owner note); |
ef524230 | 90 | extern void zsend_ipset_notify_owner(const struct zebra_dplane_ctx *ctx, |
33c08518 DS |
91 | enum zapi_ipset_notify_owner note); |
92 | extern void | |
93 | zsend_ipset_entry_notify_owner(const struct zebra_dplane_ctx *ctx, | |
94 | enum zapi_ipset_entry_notify_owner note); | |
786a9bd9 | 95 | extern bool zserv_nexthop_num_warn(const char *caller, const struct prefix *p, |
8b1766b1 | 96 | const unsigned int nexthop_num); |
b120fe3b DS |
97 | |
98 | extern void zsend_capabilities_all_clients(void); | |
e11d7c96 | 99 | extern int zsend_assign_label_chunk_response(struct zserv *client, |
4cebdb9b | 100 | vrf_id_t vrf_id, |
e11d7c96 EDP |
101 | struct label_manager_chunk *lmc); |
102 | extern int zsend_label_manager_connect_response(struct zserv *client, | |
103 | vrf_id_t vrf_id, | |
104 | unsigned short result); | |
31f937fb SM |
105 | extern int zsend_sr_policy_notify_status(uint32_t color, |
106 | struct ipaddr *endpoint, char *name, | |
107 | int status); | |
7723e8d3 PG |
108 | extern void zsend_nhrp_neighbor_notify(int cmd, struct interface *ifp, |
109 | struct ipaddr *ipaddr, int ndm_state, | |
d603c077 | 110 | union sockunion *link_layer_ipv4); |
51e94aa7 | 111 | |
581e797e KS |
112 | extern int zsend_client_close_notify(struct zserv *client, |
113 | struct zserv *closed_client); | |
114 | ||
ee94437e MS |
115 | int zsend_nhg_notify(uint16_t type, uint16_t instance, uint32_t session_id, |
116 | uint32_t id, enum zapi_nhg_notify_owner note); | |
117 | ||
224ccf29 DL |
118 | extern void zapi_opaque_free(struct opaque *opaque); |
119 | ||
6e68a084 HS |
120 | extern int zsend_zebra_srv6_locator_add(struct zserv *client, |
121 | struct srv6_locator *loc); | |
122 | extern int zsend_zebra_srv6_locator_delete(struct zserv *client, | |
123 | struct srv6_locator *loc); | |
124 | extern int zsend_srv6_manager_get_locator_chunk_response(struct zserv *client, | |
4df9d859 | 125 | vrf_id_t vrf_id, struct srv6_locator *loc); |
6e68a084 | 126 | |
51e94aa7 EDP |
127 | #ifdef __cplusplus |
128 | } | |
129 | #endif |