📄 rsvpte_struct
字号:
/* * Copyright (C) James R. Leu 2003 * jleu@mindspring.com * * This software is covered under the LGPL, for more * info check out http://www.gnu.org/copyleft/lgpl.html */#ifndef RSVPTE_STRUCT_H#define RSVPTE_STRUCT_H#include "mpls_struct.h"#include "mpls_list.h"#include "mpls_refcnt.h"#include "mpls_bitfield.h"MPLS_LIST_ROOT(rsvpte_if_list, rsvpte_if);typedef struct rsvpte_global { struct rsvpte_if_list iff; struct mpls_inet_addr lsr_identifier; mpls_admin_state_enum admin_state; mpls_lock_handle global_lock; mpls_instance_handle user_data; mpls_tree_handle addr_tree; mpls_socket_handle ra_socket; mpls_timer_mgr_handle timer_handle; mpls_socket_mgr_handle socket_handle; mpls_fib_handle fib_handle; mpls_ifmgr_handle ifmgr_handle;#if MPLS_USE_LSR mpls_cfg_handle lsr_handle;#else mpls_mpls_handle mpls_handle;#endif} rsvpte_global;typedef struct rsvpte_if { MPLS_REFCNT_FIELD; MPLS_LIST_ELEM(rsvpte_if) _global; int label_space; uint32_t index; mpls_if_handle handle; mpls_oper_state_enum oper_state; mpls_admin_state_enum admin_state;} rsvpte_if;#define RSSPV_RSVP_ENC_OBJECTERROR -1#define RSSPV_RSVP_DEC_OBJECTERROR -2#define RSVP_IPV4_ADDR_LEN 4#define RSVP_IPV6_ADDR_LEN 16/********************************************************************** RSVP Objects Every object consists of one or more 32-bit words with a one- word header, with the following format: 0 1 2 3 +-------------+-------------+-------------+-------------+ | Length (bytes) | Class-Num | C-Type | +-------------+-------------+-------------+-------------+ | | // (Object contents) // | | +-------------+-------------+-------------+-------------+ An object header has the following fields: Length A 16-bit field containing the total object length in bytes. Must always be a multiple of 4, and at least 4. Class-Num Identifies the object class; values of this field are defined in Appendix A. Each object class has a name, which is always capitalized in this document. An RSVP implementation must recognize the following classes: NULL A NULL object has a Class-Num of zero, and its C-Type is ignored. Its length must be at least 4, but can be any multiple of 4. A NULL object may appear anywhere in a sequence of objects, and its contents will be ignored by the receiver. SESSION Contains the IP destination address (DestAddress), the IP protocol id, and some form of generalized destination port, to define a specific session for the other objects that follow. Required in every RSVP message. RSVP_HOP Carries the IP address of the RSVP-capable node that sent this message and a logical outgoing interface handle (LIH; see Section 3.3). This document refers to a RSVP_HOP object as a PHOP ("previous hop") object for downstream messages or as a NHOP (" next hop") object for upstream messages. TIME_VALUES Contains the value for the refresh period R used by the creator of the message; see Section 3.7. Required in every Path and Resv message. STYLE Defines the reservation style plus style-specific information that is not in FLOWSPEC or FILTER_SPEC objects. Required in every Resv message. FLOWSPEC Defines a desired QoS, in a Resv message. FILTER_SPEC Defines a subset of session data packets that should receive the desired QoS (specified by a FLOWSPEC object), in a Resv message. SENDER_TEMPLATE Contains a sender IP address and perhaps some additional demultiplexing information to identify a sender. Required in a Path message. SENDER_TSPEC Defines the traffic characteristics of a sender's data flow. Required in a Path message. ADSPEC Carries OPWA data, in a Path message. ERROR_SPEC Specifies an error in a PathErr, ResvErr, or a confirmation in a ResvConf message. POLICY_DATA Carries information that will allow a local policy module to decide whether an associated reservation is administratively permitted. May appear in Path, Resv, PathErr, or ResvErr message. The use of POLICY_DATA objects is not fully specified at this time; a future document will fill this gap. INTEGRITY Carries cryptographic data to authenticate the originating node and to verify the contents of this RSVP message. The use of the INTEGRITY object is described in [Baker96]. SCOPE Carries an explicit list of sender hosts towards which the information in the message is to be forwarded. May appear in a Resv, ResvErr, or ResvTear message. See Section 3.4. RESV_CONFIRM Carries the IP address of a receiver that requested a confirmation. May appear in a Resv or ResvConf message.**********************************************************************/#define RSVP_OBJECT_HDRSIZE 4typedef struct rsvpObjectHeader_s { u_short length; u_char class; u_char cType;} rsvpObjectHeader_t;#define RSVP_SESSION_CLASS 1#define RSVP_SESSION_CTYPE_IPV4 1#define RSVP_SESSION_CTYPE_IPV6 2#define RSVP_SESSION_CTYPE_TUNNEL4 7#define RSVP_SESSION_CTYPE_TUNNEL6 8/********************************************************************** RSVP SESSION Object o IPv4/UDP SESSION object: Class = 1, C-Type = 1 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +---------------+---------------+---------------+---------------+ | IPv4 DestAddress (4 bytes) | +---------------+---------------+---------------+---------------+ | Protocol Id | Flags | DstPort | +---------------+---------------+---------------+---------------+ o IPv6/UDP SESSION object: Class = 1, C-Type = 2 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +---------------+---------------+---------------+---------------+ | | + + | | + IPv6 DestAddress (16 bytes) + | | + + | | +---------------+---------------+---------------+---------------+ | Protocol Id | Flags | DstPort | +---------------+---------------+---------------+---------------+ DestAddress The IP unicast or multicast destination address of the session. This field must be non-zero. Protocol Id The IP Protocol Identifier for the data flow. This field must be non-zero. Flags 0x01 = E_Police flag The E_Police flag is used in Path messages to determine the effective "edge" of the network, to control traffic policing. If the sender host is not itself capable of traffic policing, it will set this bit on in Path messages it sends. The first node whose RSVP is capable of traffic policing will do so (if appropriate to the service) and turn the flag off. DstPort The UDP/TCP destination port for the session. Zero may be used to indicate `none'. Other SESSION C-Types could be defined in the future to support other demultiplexing conventions in the transport- layer or application layer. LSP_TUNNEL_IPv4 Session Object Class = SESSION, LSP_TUNNEL_IPv4 C-Type = 7 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | IPv4 tunnel end point address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MUST be zero | Tunnel ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Extended Tunnel ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ IPv4 tunnel end point address IPv4 address of the egress node for the tunnel. Tunnel ID A 16-bit identifier used in the SESSION that remains constant over the life of the tunnel. Extended Tunnel ID A 32-bit identifier used in the SESSION that remains constant over the life of the tunnel. Normally set to all zeros. Ingress nodes that wish to narrow the scope of a SESSION to the ingress-egress pair may place their IPv4 address here as a globally unique identifier. LSP_TUNNEL_IPv6 Session Object Class = SESSION, LSP_TUNNEL_IPv6 C_Type = 8 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | IPv6 tunnel end point address | + + | (16 bytes) | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MUST be zero | Tunnel ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | Extended Tunnel ID | + + | (16 bytes) | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ IPv6 tunnel end point address IPv6 address of the egress node for the tunnel. Tunnel ID A 16-bit identifier used in the SESSION that remains constant over the life of the tunnel. Extended Tunnel ID A 16-byte identifier used in the SESSION that remains constant over the life of the tunnel. Normally set to all zeros. Ingress nodes that wish to narrow the scope of a SESSION to the ingress-egress pair may place their IPv6 address here as a globally unique identifier.**********************************************************************/#define RSVP_SESSION4_SIZE 8typedef struct rsvpSession4_s {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -