]> git.proxmox.com Git - mirror_frr.git/blob - bgpd/bgp_rd.h
Merge pull request #803 from opensourcerouting/redhat-doc-fixes-master
[mirror_frr.git] / bgpd / bgp_rd.h
1 /* BGP RD definitions for BGP-based VPNs (IP/EVPN)
2 * -- brought over from bgpd/bgp_mplsvpn.h
3 * Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
4 *
5 * This file is part of FRR.
6 *
7 * FRR is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
10 * later version.
11 *
12 * FRR is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with FRR; see the file COPYING. If not, write to the Free
19 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA.
21 */
22
23 #ifndef _QUAGGA_BGP_RD_H
24 #define _QUAGGA_BGP_RD_H
25
26 /* RD types */
27 #define RD_TYPE_AS 0
28 #define RD_TYPE_IP 1
29 #define RD_TYPE_AS4 2
30
31 #if ENABLE_BGP_VNC
32 #define RD_TYPE_VNC_ETH 0xff00 /* VNC L2VPN */
33 #endif
34
35 #define RD_ADDRSTRLEN 28
36
37 struct rd_as
38 {
39 u_int16_t type;
40 as_t as;
41 u_int32_t val;
42 };
43
44 struct rd_ip
45 {
46 u_int16_t type;
47 struct in_addr ip;
48 u_int16_t val;
49 };
50
51 #if ENABLE_BGP_VNC
52 struct rd_vnc_eth
53 {
54 u_int16_t type;
55 uint8_t local_nve_id;
56 struct ethaddr macaddr;
57 };
58 #endif
59
60 extern u_int16_t decode_rd_type (u_char *pnt);
61 extern void encode_rd_type (u_int16_t, u_char *);
62
63 extern void decode_rd_as (u_char *pnt, struct rd_as *rd_as);
64 extern void decode_rd_as4 (u_char *pnt, struct rd_as *rd_as);
65 extern void decode_rd_ip (u_char *pnt, struct rd_ip *rd_ip);
66 #if ENABLE_BGP_VNC
67 extern void
68 decode_rd_vnc_eth (u_char *pnt, struct rd_vnc_eth *rd_vnc_eth);
69 #endif
70
71 extern int str2prefix_rd (const char *, struct prefix_rd *);
72 extern char *prefix_rd2str (struct prefix_rd *, char *, size_t);
73
74 #endif /* _QUAGGA_BGP_RD_H */