ifndef __QOS_H_
define __QOS_H_
ifndef __LIBC_INC
 include libc.inc
endif

SERVICETYPE		typedef ULONG
SERVICETYPE_NOTRAFFIC	equ 0x00000000
SERVICETYPE_BESTEFFORT	equ 0x00000001
SERVICETYPE_CONTROLLEDLOAD equ 0x00000002
SERVICETYPE_GUARANTEED	equ 0x00000003
SERVICETYPE_NETWORK_UNAVAILABLE equ 0x00000004
SERVICETYPE_GENERAL_INFORMATION equ 0x00000005
SERVICETYPE_NOCHANGE	equ 0x00000006

SERVICE_IMMEDIATE_TRAFFIC_CONTROL equ 0x80000000

SERVICE_NO_QOS_SIGNALING equ 0x40000000

FLOWSPEC		STRUC
TokenRate		ULONG ?
TokenBucketSize		ULONG ?
PeakBandwidth		ULONG ?
Latency			ULONG ?
DelayVariation		ULONG ?
ServiceType		SERVICETYPE ?
MaxSduSize		ULONG ?
MinimumPolicedSize	ULONG ?

FLOWSPEC		ENDS
PFLOWSPEC		typedef ptr FLOWSPEC
LPFLOWSPEC		typedef ptr FLOWSPEC



QOS_OBJECT_HDR		STRUC

ObjectType		ULONG ?
ObjectLength		ULONG ?

QOS_OBJECT_HDR		ENDS
LPQOS_OBJECT_HDR	typedef ptr QOS_OBJECT_HDR

RSVP_OBJECT_ID_BASE	equ 1000
RSVP_OBJECT_STATUS_INFO equ (0x00000000 + RSVP_OBJECT_ID_BASE)
RSVP_OBJECT_RESERVE_INFO equ (0x00000001 + RSVP_OBJECT_ID_BASE)
RSVP_OBJECT_ADSPEC	equ (0x00000002 + RSVP_OBJECT_ID_BASE)

QOS_GENERAL_ID_BASE	equ 2000
QOS_OBJECT_PRIORITY	equ (0x00000000 + QOS_GENERA_ID_BASE)
QOS_OBJECT_END_OF_LIST	equ (0x00000001 + QOS_GENERA_ID_BASE)
QOS_OBJECT_SD_MODE	equ (0x00000002 + QOS_GENERA_ID_BASE)
QOS_OBJECT_TRAFFIC_CLASS equ (0x00000003 + QOS_GENERA_ID_BASE)

QOS_NOT_SPECIFIED	equ 0xFFFFFFFF

POSITIVE_INFINITY_RATE	equ 0xFFFFFFFE

IN_ADDR_IPV4		UNION
_Addr			ULONG ?
AddrBytes		db 4 dup(?)
IN_ADDR_IPV4		ENDS
LPIN_ADDR_IPV4		typedef ptr IN_ADDR_IPV4

IN_ADDR_IPV6		STRUC
_Addr			db 16 dup(?)
IN_ADDR_IPV6		ENDS
LPIN_ADDR_IPV6		typedef ptr IN_ADDR_IPV6
LPCIN_ADDR_IPV6		typedef ptr IN_ADDR_IPV6

RSVP_FILTERSPEC_V4	STRUC
Address			IN_ADDR_IPV4 <>
Unused			dw ?
Port			dw ?
RSVP_FILTERSPEC_V4	ENDS
LPRSVP_FILTERSPEC_V4	typedef ptr RSVP_FILTERSPEC_V4

RSVP_FILTERSPEC_V6	STRUC
Address			IN_ADDR_IPV6 <>
UnUsed			dw ?
Port			dw ?
RSVP_FILTERSPEC_V6	ENDS
LPRSVP_FILTERSPEC_V6	typedef ptr RSVP_FILTERSPEC_V6


RSVP_FILTERSPEC_V6_FLOW	 STRUC
Address			IN_ADDR_IPV6 <>
UnUsed			db ?
FlowLabel		db 3 dup(?)
RSVP_FILTERSPEC_V6_FLOW ENDS
LPRSVP_FILTERSPEC_V6_FLOW typedef ptr RSVP_FILTERSPEC_V6_FLOW

RSVP_FILTERSPEC_V4_GPI	STRUC
Address			IN_ADDR_IPV4 <>
GeneralPortId		dd ?
RSVP_FILTERSPEC_V4_GPI	ENDS
LPRSVP_FILTERSPEC_V4_GPI typedef ptr RSVP_FILTERSPEC_V4_GPI

RSVP_FILTERSPEC_V6_GPI	STRUC
Address			IN_ADDR_IPV6 <>
GeneralPortId		dd ?
RSVP_FILTERSPEC_V6_GPI	ENDS
LPRSVP_FILTERSPEC_V6_GPI typedef ptr RSVP_FILTERSPEC_V6_GPI


FilterType		typedef LONG
FILTERSPECV4		equ 1
FILTERSPECV6		equ 2
FILTERSPECV6_FLOW	equ 3
FILTERSPECV4_GPI	equ 4
FILTERSPECV6_GPI	equ 5
FILTERSPEC_END		equ 6

RSVP_FILTERSPEC		STRUC
FilterType		dd ?
UNION
 FilterSpecV4		RSVP_FILTERSPEC_V4 <>
 FilterSpecV6		RSVP_FILTERSPEC_V6 <>
 FilterSpecV6Flow	RSVP_FILTERSPEC_V6_FLOW <>
 FilterSpecV4Gpi	RSVP_FILTERSPEC_V4_GPI <>
 FilterSpecV6Gpi	RSVP_FILTERSPEC_V6_GPI <>
ENDS
RSVP_FILTERSPEC		ENDS
LPRSVP_FILTERSPEC	typedef ptr RSVP_FILTERSPEC

FLOWDESCRIPTOR		STRUC
FlowSpec		FLOWSPEC <>
NumFilters		dd ?
FilterList		LPRSVP_FILTERSPEC ?
FLOWDESCRIPTOR		ENDS
LPFLOWDESCRIPTOR	typedef ptr FLOWDESCRIPTOR

RSVP_POLICY		STRUC
Type			HANDLE ?
RSVP_POLICY		ENDS
LPRSVP_POLICY		typedef ptr RSVP_POLICY
LPCRSVP_POLICY		typedef ptr RSVP_POLICY



RSVP_RESERVE_INFO	STRUC
ObjectHdr		QOS_OBJECT_HDR <>
Style			dd ?
ConfirmRequest		dd ?
Policy			LPRSVP_POLICY ?
NumFlowDesc		dd ?
FlowDescList		LPFLOWDESCRIPTOR ?
RSVP_RESERVE_INFO	ENDS
LPRSVP_RESERVE_INFO	typedef ptr RSVP_RESERVE_INFO
LPCRSVP_RESERVE_INFO	typedef ptr RSVP_RESERVE_INFO

RSVP_WILDCARD_STYLE	equ 0x00000001
RSVP_FIXED_FILTER_STYLE equ 0x00000002
RSVP_SHARED_EXPLICIT_STYLE equ 0x00000003


RSVP_STATUS_INFO	STRUC
ObjectHdr		QOS_OBJECT_HDR <>
StatusCode		dd ?
ExtendedStatus1		dd ?
ExtendedStatus2		dd ?
RSVP_STATUS_INFO	ENDS
LPRSVP_STATUS_INFO	typedef ptr RSVP_STATUS_INFO
LPCRSVP_STATUS_INFO	typedef ptr RSVP_STATUS_INFO

QOS_PRIORITY		STRUC
ObjectHdr		QOS_OBJECT_HDR <>
SendPriority		db ?
SendFlags		db ?
ReceivePriority		db ?
Unused			db ?
QOS_PRIORITY		ENDS
LPQOS_PRIORITY		typedef ptr QOS_PRIORITY




QOS_SD_MODE		STRUC
ObjectHdr		QOS_OBJECT_HDR <>
ShapeDiscardMode	dd ?
QOS_SD_MODE		ENDS
LPQOS_SD_MODE		typedef ptr QOS_SD_MODE

TC_NONCONF_BORROW	equ 0
TC_NONCONF_SHAPE	equ 1
TC_NONCONF_DISCARD	equ 2


QOS_TRAFFIC_CLASS	STRUC
ObjectHdr		QOS_OBJECT_HDR <>
TrafficClass		dd ?
QOS_TRAFFIC_CLASS	ENDS
LPQOS_TRAFFIC_CLASS	typedef ptr QOS_TRAFFIC_CLASS

AD_GENERAL_PARAMS	STRUC
IntServAwareHopCount	dd ?
PathBandwidthEstimate	dd ?
MinimumLatency		dd ?
PathMTU			dd ?
Flags			dd ?
AD_GENERAL_PARAMS	ENDS
LPAD_GENERAL_PARAMS	typedef ptr AD_GENERAL_PARAMS

INDETERMINATE_LATENCY	equ 0xFFFFFFFF;

AD_FLAG_BREAK_BIT	equ 0x00000001

AD_GUARANTEED		STRUC
CTotal			dd ?
DTotal			dd ?
CSum			dd ?
DSum			dd ?
AD_GUARANTEED		ENDS
LPAD_GUARANTEED		typedef ptr AD_GUARANTEED

PARAM_BUFFER		STRUC
ParameterId		dd ?
Length			dd ?
Buffer			db ?
PARAM_BUFFER		ENDS
LPPARAM_BUFFER		typedef ptr PARAM_BUFFER

CONTROL_SERVICE		STRUC
Length			dd ?
Service			SERVICETYPE ?
Overrides		AD_GENERAL_PARAMS <>
UNION
 Guaranteed		 AD_GUARANTEED <>
 ParamBuffer		 PARAM_BUFFER <>
ENDS
CONTROL_SERVICE		ENDS
LPCONTROL_SERVICE	typedef ptr CONTROL_SERVICE

RSVP_ADSPEC		STRUC
ObjectHdr		QOS_OBJECT_HDR <>
GeneralParams		AD_GENERAL_PARAMS <>
NumberOfServices	dd ?
Services		CONTROL_SERVICE <>
RSVP_ADSPEC		ENDS
LPRSVP_ADSPEC		typedef ptr RSVP_ADSPEC

endif

