3 * Copyright (C) James R. Leu 2002
6 * This software is covered under the LGPL, for more
7 * info check out http://www.gnu.org/copyleft/lgpl.html
10 #ifndef _MPLS_STRUCT_H_
11 #define _MPLS_STRUCT_H_
13 #define MPLS_MAX_IF_NAME 16
14 #define MPLS_MAX_LABELSTACK 4
16 #include "mpls_handle_type.h"
17 #include "mpls_bitfield.h"
38 } mpls_oper_state_enum
;
41 MPLS_TIMER_ONESHOT
= 1,
42 MPLS_TIMER_REOCCURRING
,
43 } mpls_timer_type_enum
;
50 } mpls_time_unit_enum
;
53 MPLS_ADMIN_ENABLE
= 1,
55 } mpls_admin_state_enum
;
58 MPLS_LABEL_RANGE_GENERIC
= 1,
59 MPLS_LABEL_RANGE_ATM_VP
,
60 MPLS_LABEL_RANGE_ATM_VC
,
61 MPLS_LABEL_RANGE_ATM_VP_VC
,
62 MPLS_LABEL_RANGE_FR_10
,
63 MPLS_LABEL_RANGE_FR_24
64 } mpls_label_range_type
;
68 MPLS_LABEL_TYPE_GENERIC
,
79 MPLS_SOCKET_UDP_DATA
= 1,
80 MPLS_SOCKET_TCP_LISTEN
,
81 MPLS_SOCKET_TCP_CONNECT
,
83 MPLS_SOCKET_ROUTE_UPDATE
,
87 MPLS_SOCKOP_NONBLOCK
= 0x1,
88 MPLS_SOCKOP_REUSE
= 0x2,
89 MPLS_SOCKOP_ROUTERALERT
= 0x4,
90 MPLS_SOCKOP_HDRINCL
= 0x8
91 } mpls_socket_option_type
;
94 MPLS_TRACE_STATE_SEND
,
95 MPLS_TRACE_STATE_RECV
,
106 /* this structure is slurped from GNU header files */
107 typedef struct mpls_iphdr
{
108 BITFIELDS_ASCENDING_2(unsigned int ihl
:4,
109 unsigned int version
:4);
119 /*The options start here. */
122 typedef struct mpls_label_struct
{
123 mpls_label_type type
;
137 typedef enum mpls_family_enum
{
143 typedef struct mpls_inet_addr
{
144 enum mpls_family_enum type
;
151 typedef struct mpls_dest
{
152 struct mpls_inet_addr addr
;
154 mpls_if_handle if_handle
;
157 typedef struct mpls_range
{
159 mpls_label_range_type type
;
160 struct mpls_label_struct min
, max
;
163 typedef enum mpls_nexthop_enum
{
167 MPLS_NH_OUTSEGMENT
= 0x4
170 typedef enum mpls_fec_enum
{
177 typedef struct mpls_nexthop
{
182 struct mpls_inet_addr ip
;
183 mpls_if_handle if_handle
;
184 mpls_outsegment_handle outsegment_handle
;
187 typedef struct mpls_fec
{
188 enum mpls_fec_enum type
;
191 struct mpls_inet_addr network
;
194 struct mpls_inet_addr host
;
196 mpls_if_handle interface
;
197 uint32_t connection_id
;
203 struct mpls_nexthop nh
;
206 typedef struct mpls_insegment
{
207 struct mpls_label_struct label
;
211 mpls_insegment_handle handle
;
212 mpls_owners_enum owner
;
215 typedef struct mpls_outsegment
{
216 struct mpls_label_struct label
;
217 mpls_bool push_label
;
218 struct mpls_nexthop nexthop
;
219 mpls_outsegment_handle handle
;
220 mpls_owners_enum owner
;
223 typedef struct mpls_xconnect
{
226 struct mpls_label_struct stack
[MPLS_MAX_LABELSTACK
];
227 mpls_bool is_persistent
;
228 mpls_xconnect_handle handle
;
229 mpls_owners_enum owner
;
232 typedef void *mpls_cfg_handle
;