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
{
179 typedef struct mpls_nexthop
{
185 struct mpls_inet_addr ip
;
186 mpls_if_handle if_handle
;
187 mpls_outsegment_handle outsegment_handle
;
189 /* only used during gets */
193 typedef struct mpls_fec
{
194 enum mpls_fec_enum type
;
197 struct mpls_inet_addr network
;
200 struct mpls_inet_addr host
;
202 mpls_if_handle interface
;
203 uint32_t connection_id
;
209 /* only used during gets */
213 typedef struct mpls_insegment
{
214 struct mpls_label_struct label
;
218 mpls_insegment_handle handle
;
219 mpls_owners_enum owner
;
222 typedef struct mpls_outsegment
{
223 struct mpls_label_struct label
;
224 mpls_bool push_label
;
225 struct mpls_nexthop nexthop
;
226 mpls_outsegment_handle handle
;
227 mpls_owners_enum owner
;
230 typedef struct mpls_xconnect
{
233 struct mpls_label_struct stack
[MPLS_MAX_LABELSTACK
];
234 mpls_bool is_persistent
;
235 mpls_xconnect_handle handle
;
236 mpls_owners_enum owner
;
239 typedef void *mpls_cfg_handle
;