#ifndef _L4STATES_H
#define _L4STATES_H
#include "bcmtype.h"
typedef enum _l4_disconnect_type_t
{
L4_DISCONNECT_TYPE_GRACEFUL = 1,
L4_DISCONNECT_TYPE_ABORTIVE = 2,
} l4_disconnect_type_t;
typedef enum _l4_upload_reason_t
{
L4_UPLOAD_REASON_UNKNOWN = 0,
L4_UPLOAD_REASON_URG = 1,
L4_UPLOAD_REASON_FRAGMENT = 2,
L4_UPLOAD_REASON_IP_OPTION = 3,
L4_UPLOAD_REASON_KEEP_ALIVE_TIMEOUT = 4,
L4_UPLOAD_REASON_UPLOAD_REQUESTED = 5,
L4_UPLOAD_REASON_LOW_ACTIVITY = 6,
L4_UPLOAD_REASON_HIGH_DROP_RATE = 7,
L4_UPLOAD_REASON_SMALL_IO = 8,
L4_UPLOAD_REASON_NO_BUFFER_PRE_POSTING = 9,
L4_UPLOAD_REASON_HIGH_OUT_OF_ORDER_PACKETS = 10,
L4_UPLOAD_REASON_RETRANSMIT_TIMEOUT = 11,
L4_UPLOAD_REASON_MAX
} l4_upload_reason_t;
typedef enum _l4_tcp_con_state_t
{
L4_TCP_CON_STATE_UNDEFINED = 0,
L4_TCP_CON_STATE_CLOSED = 1,
L4_TCP_CON_STATE_SYN_SENT = 2,
L4_TCP_CON_STATE_SYN_RCVD = 3,
L4_TCP_CON_STATE_ESTABLISHED = 4,
L4_TCP_CON_STATE_FIN_WAIT1 = 5,
L4_TCP_CON_STATE_FIN_WAIT2 = 6,
L4_TCP_CON_STATE_CLOSING = 7,
L4_TCP_CON_STATE_CLOSE_WAIT = 8,
L4_TCP_CON_STATE_LAST_ACK = 9,
L4_TCP_CON_STATE_TIME_WAIT = 10,
L4_TCP_CON_STATE_LISTEN = 11,
L4_TCP_CON_STATE_MAX
} l4_tcp_con_state_t;
typedef struct _l4_neigh_const_state_t
{
u8_t src_addr[8];
u16_t vlan_tag;
} l4_neigh_const_state_t;
typedef struct _l4_neigh_cached_state_t
{
u8_t dst_addr[8];
u32_t host_reachability_delta;
} l4_neigh_cached_state_t;
typedef struct _l4_neigh_delegated_state_t
{
u32_t nic_reachability_delta;
} l4_neigh_delegated_state_t;
typedef struct _l4_path_const_state_t
{
u8_t ip_version;
#define IP_VERSION_IPV4 4
#define IP_VERSION_IPV6 6
u8_t _pad[3];
union _u_ip_type_t
{
struct _ip_v4_t
{
u32_t dst_ip;
u32_t src_ip;
} ipv4;
struct _ip_v6_t
{
u32_t dst_ip[4];
u32_t src_ip[4];
} ipv6;
} u;
} l4_path_const_state_t;
typedef struct _l4_path_cached_state_t
{
u32_t path_mtu;
} l4_path_cached_state_t;
typedef struct _l4_path_delegated_state_t
{
u16_t ipv4_current_ip_id;
u16_t _pad;
} l4_path_delegated_state_t;
typedef struct _l4_tcp_const_state_t
{
u16_t tcp_flags;
#define TCP_FLAG_ENABLE_TIME_STAMP 0x0001
#define TCP_FLAG_ENABLE_SACK 0x0002
#define TCP_FLAG_ENABLE_WIN_SCALING 0x0004
u16_t dst_port;
u16_t src_port;
u16_t remote_mss;
u8_t snd_seg_scale:4;
u8_t rcv_seg_scale:4;
u8_t _pad[3];
u32_t hash_value;
} l4_tcp_const_state_t;
typedef struct _l4_tcp_cached_state_t
{
u16_t tcp_flags;
#define TCP_FLAG_ENABLE_KEEP_ALIVE 0x01
#define TCP_FLAG_ENABLE_NAGLING 0x02
#define TCP_FLAG_RESTART_KEEP_ALIVE 0x04
#define TCP_FLAG_RESTART_MAX_RT 0x08
#define TCP_FLAG_UPDATE_RCV_WINDOW 0x10
u16_t _pad;
u32_t initial_rcv_wnd;
u8_t ttl_or_hop_limit;
u8_t tos_or_traffic_class;
u8_t ka_probe_cnt;
u8_t user_priority;
u32_t rcv_indication_size;
u32_t ka_time_out;
u32_t ka_interval;
u32_t max_rt;
u32_t flow_label;
} l4_tcp_cached_state_t;
typedef struct _l4_tcp_delegated_state_t
{
u32_t con_state;
u32_t recv_next;
u32_t recv_win_seq;
u32_t send_una;
u32_t send_next;
u32_t send_max;
u32_t send_win;
u32_t max_send_win;
u32_t send_wl1;
u32_t send_cwin;
u32_t ss_thresh;
u16_t sm_rtt;
u16_t sm_delta;
u32_t tstamp;
u32_t ts_recent;
u32_t ts_recent_age;
u32_t total_rt;
u8_t dup_ack_count;
u8_t snd_wnd_probe_count;
u16_t _pad;
union _keep_alive_or_retransmit_t
{
struct _keep_alive_t
{
u8_t probe_cnt;
u32_t timeout_delta;
} keep_alive;
struct _retransmit_t
{
u8_t num_retx;
u32_t retx_ms;
} retransmit;
} u;
} l4_tcp_delegated_state_t;
typedef struct _l4_ofld_params_t
{
u32_t flags;
#define OFLD_PARAM_FLAG_SNAP_ENCAP 0x0001
u32_t ticks_per_second;
u8_t ack_frequency;
u8_t delayed_ack_ticks;
u8_t max_retx;
u8_t doubt_reachability_retx;
u32_t sws_prevention_ticks;
u32_t dup_ack_threshold;
u32_t push_ticks;
u32_t nce_stale_ticks;
u16_t starting_ip_id;
u16_t _pad;
} l4_ofld_params_t;
#endif