1 /* Pseudowire definitions
2  * Copyright (C) 2016 Volta Networks, Inc.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; see the file COPYING; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
17  * MA 02110-1301 USA
18  */
19 
20 #ifndef _FRR_PW_H
21 #define _FRR_PW_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* L2VPN name length. */
28 #define L2VPN_NAME_LEN		32
29 
30 /* Pseudowire type - LDP and BGP use the same values. */
31 #define PW_TYPE_ETHERNET_TAGGED	0x0004	/* RFC 4446 */
32 #define PW_TYPE_ETHERNET	0x0005	/* RFC 4446 */
33 #define PW_TYPE_WILDCARD	0x7FFF	/* RFC 4863, RFC 6668 */
34 
35 /* Pseudowire flags. */
36 #define F_PSEUDOWIRE_CWORD	0x01
37 
38 /* Pseudowire status TLV */
39 #define PW_FORWARDING 0
40 #define PW_NOT_FORWARDING (1 << 0)
41 #define PW_LOCAL_RX_FAULT (1 << 1)
42 #define PW_LOCAL_TX_FAULT (1 << 2)
43 #define PW_PSN_RX_FAULT (1 << 3)
44 #define PW_PSN_TX_FAULT (1 << 4)
45 
46 /*
47  * Protocol-specific information about the pseudowire.
48  */
49 union pw_protocol_fields {
50 	struct {
51 		struct in_addr lsr_id;
52 		uint32_t pwid;
53 		char vpn_name[L2VPN_NAME_LEN];
54 	} ldp;
55 };
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif /* _FRR_PW_H */
62