255 lines
7.5 KiB
C
255 lines
7.5 KiB
C
/* iprohc_constant.h - ROHC constants defining head file */
|
|
|
|
/*
|
|
* Copyright (c) 2008 Wind River Systems, Inc.
|
|
*
|
|
* The right to copy, distribute or otherwise make use of this software
|
|
* may be licensed only pursuant to the terms of an applicable Wind River
|
|
* license agreement. No license to Wind River intellectual property rights
|
|
* is granted herein. All rights not licensed by Wind River are reserved
|
|
* by Wind River.
|
|
*/
|
|
|
|
/*
|
|
modification history
|
|
--------------------
|
|
01f,14may10,ggz Add TCP/IP profile
|
|
01e,22feb10,ggz Add ESP/IP,UDP/IP profiles
|
|
01d,03jul08,tlu Add max number of IP extension header
|
|
01c,21may08,tlu Add more pkt type and define different MAX CID for
|
|
small/large CID
|
|
01b,20may08,tlu Add incremental constant for WLSB/LSB
|
|
01a,25feb08,tlu Created.
|
|
*/
|
|
|
|
#ifndef IPROHC_CONSTANT_H
|
|
#define IPROHC_CONSTANT_H
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
**************************************************************************
|
|
* DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/* Max size of a ROHC package. */
|
|
#define IPROHC_MAX_PKT_SIZE 1440
|
|
|
|
/* Max number of ROHC profile IDs. */
|
|
/* Refer to RFC 3095, section 5.1.2, and RFC 3843, section 3 */
|
|
/* 0 -- uncompressed profile */
|
|
/* 1 -- RTP/UDP/IP compression profile */
|
|
/* 2 -- UDP/IP compression profile */
|
|
/* 3 -- ESP/IP compression profile */
|
|
/* 4 -- IP compression profile */
|
|
/* 5 -- LLA IP/UDP/RTP compression profile */
|
|
/* 6 -- TCP/IP compression profile */
|
|
#define IPROHC_MIN_PROFILE_ID 0
|
|
#define IPROHC_MAX_PROFILE_ID 6
|
|
#define IPROHC_MAX_PROFILE_IDS 7
|
|
|
|
/* Max size of a ROHC interface name. */
|
|
#define IPROHC_IF_NAME_MAX 16
|
|
|
|
/* Max small CID of ROHC context. */
|
|
#define IPROHC_MAX_SMALL_CID 15
|
|
|
|
/* Max large CID of ROHC context. */
|
|
#define IPROHC_MAX_LARGE_CID 16383
|
|
|
|
/* IPv4 header size */
|
|
#define IPROHC_IP4_HDR_SIZE 20
|
|
|
|
/* IPv6 header size */
|
|
#define IPROHC_IP6_HDR_SIZE 40
|
|
|
|
/* Max number of transmitted IR pkts before state changes from IR-->FO/SO */
|
|
#define IPROHC_MAX_IRS 5
|
|
|
|
/* Max length of one ROHC feedback buffer. */
|
|
#define IPROHC_MAX_FEEDBCK_BUF 20
|
|
|
|
/* RFC 3095, 5.3.2.2.3, k_1%n_1 in percentage */
|
|
#define IPROHC_D_FULL_RATIO 30
|
|
|
|
/* RFC 3095, 5.3.2.2.3, k_2%n_2 in percentage */
|
|
#define IPROHC_D_STATIC_RATIO 40
|
|
|
|
/* Increment value for WLSB/LSB */
|
|
#define IPROHC_LSB_INC -1
|
|
|
|
/* Max number of compressed list items */
|
|
#define IPROHC_MAX_LIST_ITEMS 127
|
|
|
|
|
|
/* IPROHC product name */
|
|
#define IPROHC_PRODUCT_NAME "WR Robust Header Compression"
|
|
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ROHC profile IDs
|
|
*===========================================================================
|
|
*/
|
|
|
|
#define ROHC_PROFILE_UNCOMPRESSED 0
|
|
#define ROHC_PROFILE_RTP_UDP_IP 1
|
|
#define ROHC_PROFILE_UDP_IP 2
|
|
#define ROHC_PROFILE_ESP_IP 3
|
|
#define ROHC_PROFILE_IP 4
|
|
#define ROHC_PROFILE_LLA_IP_UDP_RTP 5
|
|
#define ROHC_PROFILE_TCP_IP 6
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ROHC modes
|
|
*===========================================================================
|
|
* refer to RFC 3095, section 5.7.6.1, and RFC 3843, section 3.4
|
|
*/
|
|
|
|
typedef enum
|
|
{
|
|
ROHC_MODE_C = 0, /* Used in IR/IR-DYN/UOR-2 to decline a mode transition */
|
|
ROHC_MODE_U,
|
|
ROHC_MODE_O,
|
|
ROHC_MODE_R
|
|
} Iprohc_mode;
|
|
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ROHC feedback ACK types
|
|
*===========================================================================
|
|
* refer to RFC 3095, section 5.7.6.1
|
|
*/
|
|
|
|
typedef enum
|
|
{
|
|
ROHC_FEEDBACK_ACK = 0,
|
|
ROHC_FEEDBACK_NACK,
|
|
ROHC_FEEDBACK_STATIC_NACK
|
|
} Iprohc_feedback_acktype;
|
|
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ROHC feedback Options
|
|
*===========================================================================
|
|
* refer to RFC 3095, section 5.7.6.2, and RFC 3843, section 3.7
|
|
*/
|
|
|
|
typedef enum
|
|
{
|
|
ROHC_FEEDBACK_OPT_CRC = 1,
|
|
ROHC_FEEDBACK_OPT_REJ,
|
|
ROHC_FEEDBACK_OPT_SN_NOT_VALID,
|
|
ROHC_FEEDBACK_OPT_SN,
|
|
ROHC_FEEDBACK_OPT_CLOCK,
|
|
ROHC_FEEDBACK_OPT_JITTER,
|
|
ROHC_FEEDBACK_OPT_LOSS,
|
|
ROHC_FEEDBACK_OPT_NOT_USED,
|
|
ROHC_FEEDBACK_OPT_CONTEXT_MEMORY
|
|
} Iprohc_feedback_opt;
|
|
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ROHC packet type codes
|
|
*===========================================================================
|
|
*/
|
|
|
|
#define ROHC_PKT_NORMAL 3
|
|
#define ROHC_PKT_IPV4 4 /* 0100 */
|
|
#define ROHC_PKT_IPV6 6 /* 0110 */
|
|
|
|
#define ROHC_PKT_COMPRESSED 1
|
|
#define ROHC_PKT_PAD 224 /* 11100000 */
|
|
#define ROHC_PKT_ADD_CID 14 /* 1110 */
|
|
#define ROHC_PKT_FEEDBACK 30 /* 11110 */
|
|
#define ROHC_PKT_IR_DYN 248 /* 11111000 */
|
|
#define ROHC_PKT_IR 126 /* 1111110 */
|
|
#define ROHC_PKT_SEGMENT 127 /* 1111111 */
|
|
#define ROHC_PKT_TYPE_0 0 /* 0 */
|
|
#define ROHC_PKT_TYPE_1 2 /* 10 */
|
|
#define ROHC_PKT_TYPE_2 6 /* 110 */
|
|
#define ROHC_PKT_COMP_UNCOMPRESSED 5
|
|
#define ROHC_TCP_PKT_IR 253 /* 11111101 */
|
|
|
|
#define ROHC_TCP_PKT_CO 0x7D /* '1111101' */
|
|
#define ROHC_TCP_PKT_RND_1 0x2E /* '101110' */
|
|
#define ROHC_TCP_PKT_RND_2 0xC /* '1100' */
|
|
#define ROHC_TCP_PKT_RND_3 0x0 /* '0' */
|
|
#define ROHC_TCP_PKT_RND_4 0xD /* '1101' */
|
|
#define ROHC_TCP_PKT_RND_5 0x4 /* '100' */
|
|
#define ROHC_TCP_PKT_RND_6 0xA /* '1010' */
|
|
#define ROHC_TCP_PKT_RND_7 0x2F /* '101111' */
|
|
#define ROHC_TCP_PKT_RND_8 0x16 /* '10110' */
|
|
#define ROHC_TCP_PKT_SEQ_1 0xA /* '1010' */
|
|
#define ROHC_TCP_PKT_SEQ_2 0x1A /* '11010' */
|
|
#define ROHC_TCP_PKT_SEQ_3 0x9 /* '1001' */
|
|
#define ROHC_TCP_PKT_SEQ_4 0x0 /* '0' */
|
|
#define ROHC_TCP_PKT_SEQ_5 0x8 /* '1000' */
|
|
#define ROHC_TCP_PKT_SEQ_6 0x1B /* '11011' */
|
|
#define ROHC_TCP_PKT_SEQ_7 0xC /* '1100' */
|
|
#define ROHC_TCP_PKT_SEQ_8 0xB /* '1011' */
|
|
#define ROHC_TCP_PKT_NONE 0xFF
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ROHC packet type shift bits
|
|
*===========================================================================
|
|
*/
|
|
|
|
#define ROHC_PKT_IP_SHIFT 4
|
|
#define ROHC_PKT_ADD_CID_SHIFT 4
|
|
#define ROHC_PKT_FEEDBACK_SHIFT 3
|
|
#define ROHC_PKT_IR_DYN_SHIFT 0
|
|
#define ROHC_PKT_IR_SHIFT 1
|
|
#define ROHC_PKT_SEGMENT_SHIFT 1
|
|
#define ROHC_PKT_TYPE_0_SHIFT 7
|
|
#define ROHC_PKT_TYPE_1_SHIFT 6
|
|
#define ROHC_PKT_TYPE_2_SHIFT 5
|
|
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ROHC extension type codes
|
|
*===========================================================================
|
|
*/
|
|
|
|
typedef enum
|
|
{
|
|
ROHC_EXT_NO_EXT = 0,
|
|
ROHC_EXT_0,
|
|
ROHC_EXT_1,
|
|
ROHC_EXT_2,
|
|
ROHC_EXT_3
|
|
} Iprohc_extension;
|
|
|
|
|
|
|
|
|
|
#endif /* #ifndef IPROHC__CONSTANT_H */
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|
|
|