1 /************************************
3 *************************************/
12 unsigned char ar_sha
[ETH_ALEN
]; /* sender hardware address */
13 unsigned char ar_sip
[4]; /* sender IP address */
14 unsigned char ar_tha
[ETH_ALEN
]; /* target hardware address */
15 unsigned char ar_tip
[4]; /* target IP address */
18 struct bcm_transport_header
{
25 enum bcm_ip_frame_type
{
31 enum bcm_eth_frame_type
{
39 struct bcm_eth_packet_info
{
40 enum bcm_ip_frame_type eNwpktIPFrameType
;
41 enum bcm_eth_frame_type eNwpktEthFrameType
;
42 unsigned short usEtherType
;
46 struct bcm_eth_q_frame
{
47 struct bcm_eth_header EThHdr
;
48 unsigned short UserPriority
:3;
50 unsigned short VLANID
:12;
51 unsigned short EthType
;
54 struct bcm_eth_llc_frame
{
55 struct bcm_eth_header EThHdr
;
58 unsigned char Control
;
61 struct bcm_eth_llc_snap_frame
{
62 struct bcm_eth_header EThHdr
;
65 unsigned char Control
;
67 unsigned short usEtherType
;
70 struct bcm_ethernet2_frame
{
71 struct bcm_eth_header EThHdr
;
74 #define ETHERNET_FRAMETYPE_IPV4 ntohs(0x0800)
75 #define ETHERNET_FRAMETYPE_IPV6 ntohs(0x86dd)
76 #define ETHERNET_FRAMETYPE_802QVLAN ntohs(0x8100)
78 /* Per SF CS Specification Encodings */
79 enum bcm_spec_encoding
{
80 eCSSpecUnspecified
= 0,
83 eCS802_3PacketEthernet
,
85 eCSPacketIPV4Over802_3Ethernet
,
86 eCSPacketIPV6Over802_3Ethernet
,
87 eCSPacketIPV4Over802_1QVLAN
,
88 eCSPacketIPV6Over802_1QVLAN
,
92 #define IP6_HEADER_LEN 40
93 #define IP_VERSION(byte) (((byte&0xF0)>>4))
95 #define MAC_ADDRESS_SIZE 6
96 #define ETH_AND_IP_HEADER_LEN (14 + 20)
97 #define L4_SRC_PORT_LEN 2
98 #define L4_DEST_PORT_LEN 2
99 #define CTRL_PKT_LEN (8 + ETH_AND_IP_HEADER_LEN)
101 #define ETH_ARP_FRAME 0x806
102 #define ETH_IPV4_FRAME 0x800
103 #define ETH_IPV6_FRAME 0x86DD
107 #define ARP_OP_REQUEST 0x01
108 #define ARP_OP_REPLY 0x02
109 #define ARP_PKT_SIZE 60
111 /* This is the format for the TCP packet header */
112 struct bcm_tcp_header
{
113 unsigned short usSrcPort
;
114 unsigned short usDestPort
;
115 unsigned long ulSeqNumber
;
116 unsigned long ulAckNumber
;
117 unsigned char HeaderLength
;
118 unsigned char ucFlags
;
119 unsigned short usWindowsSize
;
120 unsigned short usChkSum
;
121 unsigned short usUrgetPtr
;
124 #define TCP_HEADER_LEN sizeof(struct bcm_tcp_header)
125 #define TCP_ACK 0x10 /* Bit 4 in tcpflags field. */
126 #define GET_TCP_HEADER_LEN(byte) ((byte&0xF0)>>4)
128 #endif /* __PROTOCOL_H__ */