1/*
2 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
3 * Permission to use, copy, modify, and/or distribute this software for
4 * any purpose with or without fee is hereby granted, provided that the
5 * above copyright notice and this permission notice appear in all copies.
6 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
7 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
8 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
9 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
10 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
11 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
12 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13 */
14
15
16#ifndef _FAL_MULTI_H_
17#define _FAL_MULTI_H_
18
19/*supports 32 entries*/
20#define FAL_IGMP_SG_ENTRY_MAX 32
21
22typedef enum
23{
24    FAL_ADDR_IPV4 = 0,
25    FAL_ADDR_IPV6
26} fal_addr_type_t;
27
28typedef struct
29{
30    fal_addr_type_t type;
31    union
32    {
33        fal_ip4_addr_t ip4_addr;
34        fal_ip6_addr_t ip6_addr;
35    } u;
36} fal_igmp_sg_addr_t;
37
38typedef struct
39{
40    fal_igmp_sg_addr_t source;
41    fal_igmp_sg_addr_t group;
42    fal_pbmp_t port_map;
43    a_uint32_t vlan_id;
44} fal_igmp_sg_entry_t;
45
46//#define MULTI_DEBUG_
47#ifdef MULTI_DEBUG_
48#define MULTI_DEBUG(x...) aos_printk(x)
49#else
50#define MULTI_DEBUG(x...)
51#endif
52
53#define FAL_ACL_LIST_MULTICAST 55
54#define FAL_MULTICAST_PRI   5
55
56#define MULT_ACTION_SET      0
57#define MULT_ACTION_CLEAR    1
58
59// static a_uint32_t rule_nr=1;
60
61typedef struct
62{
63    a_uint8_t index; //MAX is 32
64    fal_igmp_sg_entry_t entry; //Stores the specific ACL rule info
65} multi_acl_info_t;
66
67typedef struct
68{
69    a_uint8_t cnt; //MAX is 32
70    multi_acl_info_t acl_info[FAL_IGMP_SG_ENTRY_MAX]; //Stores the all ACL rule info
71} fal_igmp_sg_info_t;
72
73#endif
74