GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / include / emf / igs / igsc.h
blob0b27bfa9b2a0664c5d85120f3ac51be6d8dc4bb4
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 * $Id: igsc.h 387069 2013-02-22 23:42:22Z $
13 #ifndef _IGSC_H_
14 #define _IGSC_H_
16 #define IGSDB_HASHT_SIZE 8
18 #define IGMPV2_TYPE_OFFSET 0
19 #define IGMPV2_MAXRSP_TIME_OFFSET 1
20 #define IGMPV2_CHECKSUM_OFFSET 2
21 #define IGMPV2_GRP_ADDR_OFFSET 4
23 #define IGMPV2_HOST_MEMBERSHIP_QUERY 0x11
24 #define IGMPV2_HOST_MEMBERSHIP_REPORT 0x12
25 #define IGMPV2_HOST_NEW_MEMBERSHIP_REPORT 0x16
26 #define IGMPV2_LEAVE_GROUP_MESSAGE 0x17
28 #define IGMPV2_QUERY_INTV 130000
29 #define IGMPV2_MAXRSP_TIME 10000
30 #define IGMPV2_ROBUSTNESS_VAR 2
31 #define IGMPV2_GRP_MEM_INTV ((IGMPV2_ROBUSTNESS_VAR * \
32 IGMPV2_QUERY_INTV) + IGMPV2_MAXRSP_TIME)
34 #define IPV4_MIN_HLEN 20
35 #define IGMP_HLEN 8
36 #define IPV4_LEN_OFFSET 2
37 #define IPV4_ID_OFFSET 4
38 #define IPV4_FRAG_OFFSET 6
39 #define IPV4_TTL_OFFSET 8
40 #define IPV4_MCADDR_ALLHOSTS (0xe0000001U)
41 #define IP_ISMULTI(addr) (((addr) & 0xf0000000) == 0xe0000000)
43 #define IGSC_STATS_INCR(igsc, member) (((igsc)->stats.member)++)
44 #define IGSC_STATS_DECR(igsc, member) (((igsc)->stats.member)--)
47 * IGMP Snooping Layer data
49 typedef struct igsc_info
51 /* IGMP Snooping database */
52 clist_head_t mgrp_sdb[IGSDB_HASHT_SIZE];
53 osl_lock_t sdb_lock; /* Lock for IGSDB access */
54 struct emfc_info *emf_handle; /* Handle for EMF interfaces */
55 uint32 grp_mem_intv; /* Group Membership interval */
56 uint32 query_intv; /* Query interval */
57 void *osh; /* OS Layer handle */
58 void *igs_info; /* OS Specific IGS data */
59 emfc_snooper_t snooper; /* Snooper data */
60 igsc_wrapper_t wrapper; /* Wrapper data */
61 clist_head_t rtlist_head; /* Router port list head */
62 osl_lock_t rtlist_lock; /* Lock for router port list */
63 igs_stats_t stats; /* Multicast frames statistics */
64 } igsc_info_t;
66 #define IGSC_INFO(s) ((igsc_info_t *)((char *)(s)-(unsigned long)(&((igsc_info_t *)0)->snooper)))
69 * Router port list entry
71 typedef struct igsc_rtlist
73 clist_head_t list; /* Router port list prev and next */
74 void *ifp; /* Interface on which mcast router
75 * is seen.
77 uint32 mr_ip; /* IP address of mcast router */
78 osl_timer_t *rtlist_timer; /* Timer for router entry */
79 igsc_info_t *igsc_info; /* IGSC Instance data */
80 } igsc_rtlist_t;
82 typedef struct mc_grp_spl
84 uint32 addr;
85 uint32 mask;
86 } mc_grp_spl_t;
88 #define IGMPV3_HOST_MEMBERSHIP_REPORT 0x22 /* V3 version of 0x11 */
90 #define IGMPV3_MODE_IS_INCLUDE 1
91 #define IGMPV3_MODE_IS_EXCLUDE 2
92 #define IGMPV3_CHANGE_TO_INCLUDE 3
93 #define IGMPV3_CHANGE_TO_EXCLUDE 4
94 #define IGMPV3_ALLOW_NEW_SOURCES 5
95 #define IGMPV3_BLOCK_OLD_SOURCES 6
97 typedef struct igmpv3_report {
98 uint8 type;
99 uint8 reserved1;
100 uint16 checksum;
101 uint16 reserved2;
102 uint16 group_num;
103 } igmpv3_report_t;
106 typedef struct igmpv3_group {
107 uint8 type;
108 uint8 aux_len;
109 uint16 src_num;
110 uint32 mcast_addr;
111 } igmpv3_group_t;
113 #define IGMPV3_SRC_ADDR_LEN 4
116 #endif /* _IGSC_H_ */