GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / include / proto / bcmarp.h
blob7d152c0b883d0bd9a3d5dafd40dcdea03400327f
1 /*
2 * Copyright (C) 2012, Broadcom Corporation
3 * All Rights Reserved.
4 *
5 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
6 * the contents of this file may not be disclosed to third parties, copied
7 * or duplicated in any form, in whole or in part, without the prior
8 * written permission of Broadcom Corporation.
10 * Fundamental constants relating to ARP Protocol
12 * $Id: bcmarp.h 332293 2012-05-09 20:49:03Z $
15 #ifndef _bcmarp_h_
16 #define _bcmarp_h_
18 #ifndef _TYPEDEFS_H_
19 #include <typedefs.h>
20 #endif
21 #include <proto/bcmip.h>
23 /* This marks the start of a packed structure section. */
24 #include <packed_section_start.h>
27 #define ARP_OPC_OFFSET 6 /* option code offset */
28 #define ARP_SRC_ETH_OFFSET 8 /* src h/w address offset */
29 #define ARP_SRC_IP_OFFSET 14 /* src IP address offset */
30 #define ARP_TGT_ETH_OFFSET 18 /* target h/w address offset */
31 #define ARP_TGT_IP_OFFSET 24 /* target IP address offset */
33 #define ARP_OPC_REQUEST 1 /* ARP request */
34 #define ARP_OPC_REPLY 2 /* ARP reply */
36 #define ARP_DATA_LEN 28 /* ARP data length */
38 BWL_PRE_PACKED_STRUCT struct bcmarp {
39 uint16 htype; /* Header type (1 = ethernet) */
40 uint16 ptype; /* Protocol type (0x800 = IP) */
41 uint8 hlen; /* Hardware address length (Eth = 6) */
42 uint8 plen; /* Protocol address length (IP = 4) */
43 uint16 oper; /* ARP_OPC_... */
44 uint8 src_eth[ETHER_ADDR_LEN]; /* Source hardware address */
45 uint8 src_ip[IPV4_ADDR_LEN]; /* Source protocol address (not aligned) */
46 uint8 dst_eth[ETHER_ADDR_LEN]; /* Destination hardware address */
47 uint8 dst_ip[IPV4_ADDR_LEN]; /* Destination protocol address */
48 } BWL_POST_PACKED_STRUCT;
50 /* Ethernet header + Arp message */
51 BWL_PRE_PACKED_STRUCT struct bcmetharp {
52 struct ether_header eh;
53 struct bcmarp arp;
54 } BWL_POST_PACKED_STRUCT;
56 /* IPv6 Neighbor Advertisement */
57 #define NEIGHBOR_ADVERTISE_SRC_IPV6_OFFSET 8 /* src IPv6 address offset */
58 #define NEIGHBOR_ADVERTISE_TYPE_OFFSET 40 /* type offset */
59 #define NEIGHBOR_ADVERTISE_CHECKSUM_OFFSET 42 /* check sum offset */
60 #define NEIGHBOR_ADVERTISE_FLAGS_OFFSET 44 /* R,S and O flags offset */
61 #define NEIGHBOR_ADVERTISE_TGT_IPV6_OFFSET 48 /* target IPv6 address offset */
62 #define NEIGHBOR_ADVERTISE_OPTION_OFFSET 64 /* options offset */
63 #define NEIGHBOR_ADVERTISE_TYPE 136
64 #define NEIGHBOR_SOLICITATION_TYPE 135
66 #define OPT_TYPE_SRC_LINK_ADDR 1
67 #define OPT_TYPE_TGT_LINK_ADDR 2
69 #define NEIGHBOR_ADVERTISE_DATA_LEN 72 /* neighbor advertisement data length */
70 #define NEIGHBOR_ADVERTISE_FLAGS_VALUE 0x60 /* R=0, S=1 and O=1 */
72 /* This marks the end of a packed structure section. */
73 #include <packed_section_end.h>
75 #endif /* !defined(_bcmarp_h_) */