⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rsvp.h

📁 radius协议源码÷The Radius Stack will connect to a Radius Server. This stack implementation is built upo
💻 H
📖 第 1 页 / 共 2 页
字号:
/* * @(#) $Id: rsvp.h,v 1.1.1.1 2000/05/08 22:51:24 wenqing Exp $ *//***************************** rsvp.h ******************************** *                                                                   * *          Define RSVP protocol  -- packet formats, well-known      * *          		values, error types, ...                     * *                                                                   * *********************************************************************//****************************************************************************            RSVPD -- ReSerVation Protocol Daemon                USC Information Sciences Institute                Marina del Rey, California		Original Version: Shai Herzog, Nov. 1993.		Current Version:  Steven Berson & Bob Braden, may 1996.  Copyright (c) 1996 by the University of Southern California  All rights reserved.  Permission to use, copy, modify, and distribute this software and its  documentation in source and binary forms for any purpose and without  fee is hereby granted, provided that both the above copyright notice  and this permission notice appear in all copies, and that any  documentation, advertising materials, and other materials related to  such distribution and use acknowledge that the software was developed  in part by the University of Southern California, Information  Sciences Institute.  The name of the University may not be used to  endorse or promote products derived from this software without  specific prior written permission.  THE UNIVERSITY OF SOUTHERN CALIFORNIA makes no representations about  the suitability of this software for any purpose.  THIS SOFTWARE IS  PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,  INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  Other copyrights might apply to parts of this software and are so  noted when applicable.********************************************************************/#ifndef __rsvp_h__#define __rsvp_h__#ifndef _RSVP_TYPES_H_#include "rsvp_types.h"#endif#define RSVP_VERSION	1		/* The packet format version *//* *  Well-known multicast groups and UDP port for UDP encapsulation. *		  (*unofficial*) */#define RSVP_ENCAP_GROUP	"224.0.0.14"	/* RSVP_ENCAPSULATION	*/#define RSVP_ENCAP_GROUP6	"FF02::000E"	/* RSVP_ENCAPSULATION	*/#define RSVP_ENCAP_PORT		1698		/* Pu  (rsvp-encap1)	*/#define RSVP_ENCAP_PORTP	1699		/* Pu' (rsvp-encap2)	*/#define RSVP_DFLT_PROTID	IPPROTO_UDP#define	API_PORT		56789/* *	Common header of RSVP messages. */typedef struct {	u_char		rsvp_verflags;	/* version and common flags */	u_char		rsvp_type;	/* message type (defined above) */	u_int16_t       rsvp_cksum;	/* checksum             */	u_char		rsvp_snd_TTL;	/* Send TTL		*/	u_char		rsvp_unused;	/* Reserved octet	*/	int16_t		rsvp_length;	/* Message length in bytes */}   common_header;/* RSVP message types */#define RSVP_PATH	1#define RSVP_RESV	2#define RSVP_PATH_ERR	3#define RSVP_RESV_ERR	4#define RSVP_PATH_TEAR	5#define RSVP_RESV_TEAR	6#define RSVP_CONFIRM	7#define RSVP_REPORT	8#define RSVP_DREQ       9#define RSVP_DREP       10#define RSVP_MAX_MSGTYPE 10	/* *	Useful macros for common header */#define RSVP_VERSION_OF(x)	(((x)->rsvp_verflags & 0xf0) >> 4)#define RSVP_FLAGS_OF(x)	((x)->rsvp_verflags & 0x0f)#define RSVP_TYPE_OF(x)		((x)->rsvp_type)#define RSVP_MAKE_VERFLAGS(v, f) ((((v) & 0x0f) << 4) | ((f) & 0x0f))/* *	Standard format of an object header */typedef struct {	int16_t		obj_length;	/* Length in bytes */	u_char		obj_class;	/* Class (values defined below) */	u_char		obj_ctype;	/* C-Type (values defined below) */}    Object_header;#define Obj_Length(x)	((Object_header *)x)->obj_length#define Obj_CType(x)	((Object_header *)x)->obj_ctype#define Obj_Class(x)	((Object_header *)x)->obj_class#define Obj_data(x)	((Object_header *)(x)+1)#define Obj_datalen(x)	(Obj_Length(x) - sizeof(Object_header))/* *	Define object classes: Class-Num values */#define class_NULL		0#define class_SESSION		1#define class_SESSION_GROUP	2#define class_RSVP_HOP		3#define class_INTEGRITY		4#define class_TIME_VALUES	5#define class_ERROR_SPEC	6#define class_SCOPE		7#define class_STYLE		8#define class_FLOWSPEC		9#define class_FILTER_SPEC	10#define class_SENDER_TEMPLATE	11#define class_SENDER_TSPEC	12#define class_ADSPEC		13#define class_POLICY_DATA	14#define class_CONFIRM		15#define class_DIAGNOSTIC        30   /* Diagnostic header object */#define class_ROUTE             31   /* Record route for diagnostic msgs */#define class_DIAG_RESPONSE     32   /* Diagnostic response object */#define class_MAX               32#define ctype_NULL		0/* *	Define high bits of Class_num for handling unknown class *		00, 01: Reject and send error *		10:  	Ignore, do not forward or send error *		11:	Ignore but forward. */#define UNKN_CLASS_MASK		0xc0	/******************************************************************** * *			Define object formats * ********************************************************************//* *	SESSION object class */#define ctype_SESSION_ipv4	1#define ctype_SESSION_ipv6	2#define ctype_SESSION_ipv4GPI	3	/* IPSEC: Generalized Port Id */#define ctype_SESSION_ipv6GPI	4	/* IPSEC: Generalized Port Id */typedef struct {	struct in_addr	sess_destaddr;	/* DestAddress			*/	u_char		sess_protid;	/* Protocol Id			*/	u_char          sess_flags;#define SESSFLG_E_Police 	0x01	/* E_Police: Entry policing flag*/	u_int16_t	sess_destport;	/* DestPort			*/}    SESSION_ipv4;typedef	SESSION_ipv4 SESSION_ipv4GPI;#ifdef	USE_IPV6typedef struct {	struct in6_addr	sess_destaddr;	/* DestAddress			*/	u_char		sess_protid;	/* Protocol Id			*/	u_char          sess_flags;	u_int16_t	sess_destport;	/* DestPort			*/}    SESSION_ipv6;typedef	SESSION_ipv6 SESSION_ipv6GPI;#endif	/* USE_IPV6 *//*	GPI versions have virtual dest port instead of dest port; this *	changes the interpretation but not the format, so we do not *	define new structs for GPI. */typedef struct {	Object_header	sess_header;	union {		SESSION_ipv4	sess_ipv4;#ifdef	USE_IPV6		SESSION_ipv6	sess_ipv6;#endif	/* USE_IPV6 */	}		sess_u;}    SESSION;#define sess4_addr	sess_u.sess_ipv4.sess_destaddr#define sess4_port	sess_u.sess_ipv4.sess_destport#define sess4_prot	sess_u.sess_ipv4.sess_protid#define sess4_flgs	sess_u.sess_ipv4.sess_flags#define sess6_addr	sess_u.sess_ipv6.sess_destaddr#define sess6_port	sess_u.sess_ipv6.sess_destport#define sess6_prot	sess_u.sess_ipv6.sess_protid#define sess6_flgs	sess_u.sess_ipv6.sess_flags/* *	SESSION_GROUP object class [TBD] */typedef struct {	int sg_fill;	/* filler for certain compilers */}    SESSION_GROUP;/* *	RSVP_HOP object class */#define ctype_RSVP_HOP_ipv4	1#define ctype_RSVP_HOP_ipv6	2typedef struct {	struct in_addr	hop_ipaddr;	/* Next/Previous Hop Address */	u_int32_t	hop_LIH;	/* Logical Interface Handle */}    RSVP_HOP_ipv4;#ifdef	USE_IPV6typedef struct {	struct in6_addr	hop_ipaddr;	/* Next/Previous Hop Address */	u_int32_t	hop_LIH;	/* Logical Interface Handle */}    RSVP_HOP_ipv6;#endif	/* USE_IPV6 */typedef struct {	Object_header	hop_header;	union {		RSVP_HOP_ipv4	hop_ipv4;#ifdef	USE_IPV6		RSVP_HOP_ipv6	hop_ipv6;#endif	/* USE_IPV6 */	}		hop_u;}    RSVP_HOP;#define hop4_LIH	hop_u.hop_ipv4.hop_LIH#define hop4_addr	hop_u.hop_ipv4.hop_ipaddr#define hop6_LIH	hop_u.hop_ipv6.hop_LIH#define hop6_addr	hop_u.hop_ipv6.hop_ipaddr/* *	TIME_VALUES class */#define ctype_TIME_VALUES_CTYPE		1typedef u_int32_t TIME_VALUES_CTYPE;typedef struct {	Object_header		timev_header; 	TIME_VALUES_CTYPE	timev_R;	/* R = Refresh Period in ms. */}   TIME_VALUES;/* *	STYLE object class */#define ctype_STYLE_CTYPE	1typedef	u_int32_t	STYLE_CTYPE;typedef STYLE_CTYPE	style_t;typedef struct {	Object_header	style_header;	STYLE_CTYPE	style_word;}   STYLE;/*	Define values for option vector */#define Opt_Share_mask  0x00000018	/* 2 bits: Sharing control	*/#define Opt_Distinct	0x00000008	/* Distinct reservations	*/#define Opt_Shared	0x00000010	/* Shared reservations		*/#define Opt_SndSel_mask	0x00000007	/* 3 bits: Sender selection	*/#define Opt_Wildcard	0x00000001	/* Wildcard scope		*/#define Opt_Explicit	0x00000002	/* Explicit scope		*/#define Style_is_Wildcard(p) (((p)&Opt_SndSel_mask) == Opt_Wildcard)#define Style_is_Shared(p) (((p)&Opt_Share_mask) == Opt_Shared)/*	Define style values */#define STYLE_WF	Opt_Shared + Opt_Wildcard#define STYLE_FF	Opt_Distinct + Opt_Explicit#define STYLE_SE	Opt_Shared + Opt_Explicit/*	Define some historical style symbols */#define WILDCARD	STYLE_WF#define FIXED		STYLE_FF/* *	FILTER SPEC object class */#define ctype_FILTER_SPEC_ipv4	  1	/* IPv4 FILTER_SPEC		*/#define ctype_FILTER_SPEC_ipv6	  2	/* IP6 FILTER_SPEC		*/#define ctype_FILTER_SPEC_ipv6FL  3	/* IP6 Flow-label FILTER_SPEC	*/#define ctype_FILTER_SPEC_ipv4GPI 4	/* IPv4/GPI FILTER_SPEC		*/#define ctype_FILTER_SPEC_ipv6GPI 5	/* IPv6/GPI FILTER_SPEC 	*/typedef struct {	struct in_addr	filt_ipaddr;	/* IPv4 SrcAddress		*/	u_int16_t	filt_unused;	u_int16_t	filt_port;	/* SrcPort			*/}    FILTER_SPEC_ipv4;typedef struct {	struct in_addr	filt_ipaddr;	/* IPv4 SrcAddress		*/	u_int32_t	filt_gpi;	/* Generalized Port Id		*/}    FILTER_SPEC_ipv4GPI;#ifdef	USE_IPV6typedef struct {	struct in6_addr	filt_ipaddr;	/* IPv6 SrcAddress		*/	u_int16_t	filt_unused;	u_int16_t	filt_port;	/* SrcPort			*/}    FILTER_SPEC_ipv6;typedef struct {	struct in6_addr	filt_ipaddr;	/* IPv6 SrcAddress		*/	u_int32_t	filt_gpi;	/* Generalized Port Id		*/}    FILTER_SPEC_ipv6GPI;#endif	/* USE_IPV6 */typedef struct {	Object_header	filt_header;	union {		FILTER_SPEC_ipv4	filt_ipv4;		FILTER_SPEC_ipv4GPI	filt_ipv4gpi;#ifdef	USE_IPV6		FILTER_SPEC_ipv6	filt_ipv6;/*		Filter_Spec_IPv6FL	filt_ipv6fl; */		FILTER_SPEC_ipv6GPI	filt_ipv6gpi;#endif	/* USE_IPV6 */	}		filt_u;}    FILTER_SPEC;#define filt4			filt_u.filt_ipv4#define filt4_srcaddr		filt4.filt_ipaddr#define filt4_srcport		filt4.filt_port#define filtgpi4		filt_u.filt_ipv4gpi#define filtgpi4_srcaddr	filtgpi4.filt_ipaddr#define filtgpi4_srcgpi		filtgpi4.filt_gpi#define filt6			filt_u.filt_ipv6#define filt6_srcaddr		filt6.filt_ipaddr#define filt6_srcport		filt6.filt_port#define filtgpi6		filt_u.filt_ipv6gpi#define filtgpi6_srcaddr	filtgpi6.filt_ipaddr#define filtgpi6_srcgpi		filtgpi6.filt_gpi/* *	SENDER_TEMPLATE class objects */#define ctype_SENDER_TEMPLATE_ipv4	1   /* IPv4 SENDER_TEMPLATE	*/#define ctype_SENDER_TEMPLATE_ipv6	2   /* IPv6 SENDER_TEMPLATE	*/#define ctype_SENDER_TEMPLATE_ipv6FL	3   /* IPv6 Flow-label SNDR_TEMPL */#define ctype_SENDER_TEMPLATE_ipv4GPI	4   /* IPv4/GPI SENDER_TEMPLATE */#define ctype_SENDER_TEMPLATE_ipv6GPI	5   /* IPv6/GPI SENDER_TEMPLATE */typedef FILTER_SPEC  SENDER_TEMPLATE;	/* Identical to FILTER_SPEC */typedef FILTER_SPEC_ipv4 SENDER_TEMPLATE_ipv4;typedef FILTER_SPEC_ipv4GPI SENDER_TEMPLATE_ipv4GPI;#ifdef	USE_IPV6typedef FILTER_SPEC_ipv6 SENDER_TEMPLATE_ipv6;typedef FILTER_SPEC_ipv6GPI SENDER_TEMPLATE_ipv6GPI;#endif	/* USE_IPV6 *//* *	ERROR_SPEC object class */#define ctype_ERROR_SPEC_ipv4	1#define ctype_ERROR_SPEC_ipv6	2typedef struct {	struct in_addr	errs_errnode;	/* Error Node Address		*/	u_char		errs_flags;	/* Flags:			*/#define ERROR_SPECF_InPlace	0x01	/*   Left resv in place		*/#define ERROR_SPECF_NotGuilty	0x02	/*   This rcvr not guilty	*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -