hc
2023-11-22 9ca5fbcb63a8dcaee0527f96afb91dc4b4bd8fa9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
#ifndef IP1811DS_H
#define IP1811DS_H
 
#include "ip1811.h"
#include "include/list.h"
 
/*typedef unsigned char     u8;
typedef unsigned short  u16;
typedef unsigned long    u32;*/
 
struct GeneralSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   int gdata;
};
 
struct PortMemberSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned long member;
};
 
struct ByPortSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   int port;
   int pdata;
};
 
struct ByPortSetting32
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   int port;
   unsigned long pdata;
};
 
struct AllPortsSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   int apdata[MAX_PHY_NUM];
};
 
struct PortmapSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned long portmap;
   int pmdata;
};
 
struct PortMaskSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned long portmap;
   int mask;
};
 
/*--------------- Special Data Structures for PTP ---------------*/
struct PTPReadSetting{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned char addr;            //0-15
   char in_out;                //1:egress, 0:ingress
   int port;                    //1-12
   unsigned long long second;
   unsigned long nanosecond;
};
 
struct PTPPortTSSetting{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned long portmap;
   char in_out;            //1:egress, 0:ingress
   char pmdata;            //set:OP_FUNC_ENABLE/DISABLE
                           //get:always enable
};
 
struct PTPTimeSetting{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned long long second;
   unsigned long nanosecond;
};
 
struct PTPFrequencySetting{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   char type;                    //1:add 0:sub
   unsigned long frequency;
   unsigned long clockcycle;
   unsigned long period_time;    //nanosecond
};
 
struct PTPFrequencyPPMSetting{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   char type;                    //1:add 0:sub
   unsigned long ppm_h;
   unsigned long ppm_l;
};
/*--------------- Special Data Structures for SMI ---------------*/
struct LinkStatusSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
    int port;
    unsigned int link;
   unsigned int speed;
    unsigned int duplex;
    unsigned int pause;
    unsigned int asym;
    unsigned int an;
    unsigned int fiber;
};
 
/*--------------- Special Data Structures for L2 Protocol ---------------*/
struct CapActSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned int protocol;
   int act;
};
 
/*--------------- Special Data Structures for Storm ---------------*/
struct StormGeneralSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
    unsigned char storm;
   long sdata;
};
 
/*--------------- Special Data Structures for Loop Detect ---------------*/
struct LDDASetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned char da[6];
};
 
/*--------------- Special Data Structures for Special Tag ---------------*/
struct STagTypeLenSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned int length;
   unsigned int type;
};
 
/*--------------- Special Data Structures for MISC ---------------*/
struct RegSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned char page;
   unsigned char reg;
   unsigned short val;
};
/*--------------- Special Data Structures for MISC PHY ---------------*/
struct PhySetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned char phy;
   unsigned char page;
   unsigned char reg;
   unsigned short val;
   unsigned char all;
};
 
/*--------------- Special Data Structures for STP ---------------*/
struct StpByFPSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   int fid;
   int port;
   int pstate;
};
 
struct StpAllPortsSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   int fid;
   int pstate[MAX_PHY_NUM-1];
};
 
/*--------------- Special Data Structures for LACP ---------------*/
struct TrunkMemberSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
    unsigned long portmask;
   unsigned long tstate;
};
 
struct TrunkCombineSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned long tgrps;
   int cen;
};
 
/*--------------- Special Data Structures for LUT ---------------*/
struct IP1811LUTEntry
{
   unsigned char cfg;
   unsigned char mac[6];
   unsigned char fid;
   unsigned char srcport;
   unsigned char aging;
   unsigned char priority;
   struct{
       unsigned short drop: 1;
       unsigned short snif: 1;
       unsigned short sflow: 1;
       unsigned short reserve: 13;
   }flag;
};
 
struct IP1811LUTSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned long retval;
   unsigned char action;
   unsigned long tarports;
   unsigned short index;
   unsigned char block;
   struct IP1811LUTEntry entry;
   unsigned short data[6];
};
 
struct IP1811LUTReg
{
   unsigned short data[6];
   unsigned char block;
   struct list_head list;
};
 
/*--------------- Special Data Structures for IGMP ---------------*/
 
struct mt_rule{
   unsigned char group[4];
   unsigned char fid;
   unsigned long port_mem;
   unsigned char pri;
   unsigned char slt_index;
   unsigned char flag;
};
 
struct MtRuleSetting{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   int index;
   struct mt_rule mt_data;
};
 
struct slt_rule{
   unsigned char type;    //4:ipv4, 6:ipv6, define in ip1811op.h
   union slt_para{
       struct slt_ipv4{
           unsigned char ip[6][4];
           unsigned int used_port[6];
       }ipv4;
 
       struct slt_ipv6{
           unsigned short ip[2][8];
           unsigned int used_port[2];
       }ipv6;
   }data;
   unsigned int port_filter_mode;
};
 
struct SltRuleSetting{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   int index;
   struct slt_rule slt_data;
};
 
struct IgmpPacketRule{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned int packet_type;
   unsigned int rule;
};
 
struct IgmpRouterListSetting{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned int portmask;
   unsigned int tstate;
};
 
/*--------------- Special Data Structures for IMP ---------------*/
struct IP1811IMPEntry
{
   unsigned char ip[16];
   unsigned char mac[6];
   unsigned char srcport;
   unsigned char priority;
   struct{
       unsigned int valid: 1;
       unsigned int ip_type: 1;
       unsigned int check_ip: 1;
       unsigned int check_mac: 1;
       unsigned int check_port: 1;
       unsigned int filter: 1;
       unsigned int sniff2: 1;
       unsigned int reserved: 9;
   }flag;
};
 
struct IP1811IMPSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned long retval;
   unsigned char action;
   unsigned char index;
   struct IP1811IMPEntry entry;
};
 
/*--------------- Special Data Structures for VLAN ---------------*/
struct VlanSetting{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned int vtype;
   unsigned int vdata;
};
 
struct MACVlanSetting{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned int index;
   unsigned int mvdata;
};
 
/*--------------- Special Data Structures for MAC ---------------*/
struct MACSetting{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   char mac[6];
};
 
/*--------------- Special Data Structures for TCP Flag ---------------*/
struct TcpFlagSetting{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned int index;
   int fdata;
};
 
/*--------------- Special Data Structures for IPv6 ---------------*/
struct IPv6Setting{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned int header;
   int act;
};
 
/*--------------- Special Data Structures for MIB Counter ---------------*/
#define NUM_MIB_COUNTER_RX  24
#define NUM_MIB_COUNTER_TX  20
 
struct MIBCounterData{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   int port;
   int dir;
   int idx;
   unsigned long counter;
};
 
struct MIBCounterEntry{
   unsigned long RX_counter[NUM_MIB_COUNTER_RX];
   unsigned long TX_counter[NUM_MIB_COUNTER_TX];
};
 
struct MIBCounterEntry_all{
   struct MIBCounterEntry entry[MAX_PHY_NUM];
};
 
/*--------------- Special Data Structures for QOS ---------------*/
struct qos_dscp_setting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned char dscpentry;
   unsigned char dscpvalue;
   unsigned char dscpqueue;
};
 
struct qos_modesettings
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   int groupnum;
   int queuenum;
   int modesettings;
};
 
struct qos_remap
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   int port;
   unsigned char queue;
   unsigned char remap;
};
/*--------------- Special Data Structures for ACL ---------------*/
struct acl_man {
   struct list_head    rule_list;
 
   int num_used_rules;
   int num_used_entries;
 
   // IP1811 has 64 entries
   unsigned short    used_entry_mask[4];
};
 
#define        ACL_RULE_FUNC_USED_ACL        BIT(0)
#define        ACL_RULE_FUNC_USED_MCP        BIT(1)
#define        ACL_RULE_FUNC_USED_SNOOP    BIT(2)
#define        ACL_RULE_FUNC_USED_DOS        BIT(3)
 
struct acl_man_rule {
   struct list_head    rule_entry;
   int start_block;
   int start_index;
   int num_entries;
   int rule_index;
   unsigned int func_used;        // bit 0 : acl
                   // bit 1 : mcp
                   // bit 2 : dhcp snooping
};
 
enum {
   ACL_SELECT_MODE_0001 = 1,
   ACL_SELECT_MODE_0010,
   ACL_SELECT_MODE_0100 = 4,
   ACL_SELECT_MODE_0101,
   ACL_SELECT_MODE_0110,
   ACL_SELECT_MODE_0111,
   ACL_SELECT_MODE_1x00,
   ACL_SELECT_MODE_1x01,
   ACL_SELECT_MODE_1x10,
   ACL_SELECT_MODE_1x11,
};
#define        ACL_SELECT_MODE_BIT_0010            BIT(ACL_SELECT_MODE_0010)
#define        ACL_SELECT_MODE_BIT_0100            BIT(ACL_SELECT_MODE_0100)
#define        ACL_SELECT_MODE_BIT_0101            BIT(ACL_SELECT_MODE_0101)
#define        ACL_SELECT_MODE_BIT_0110            BIT(ACL_SELECT_MODE_0110)
#define        ACL_SELECT_MODE_BIT_0111            BIT(ACL_SELECT_MODE_0111)
#define        ACL_SELECT_MODE_BIT_1x00            BIT(ACL_SELECT_MODE_1x00)
#define        ACL_SELECT_MODE_BIT_1x01            BIT(ACL_SELECT_MODE_1x01)
#define        ACL_SELECT_MODE_BIT_1x10            BIT(ACL_SELECT_MODE_1x10)
#define        ACL_SELECT_MODE_BIT_1x11            BIT(ACL_SELECT_MODE_1x11)
enum {
   ACL_LINK_TYPE_00 = 0,
   ACL_LINK_TYPE_01,
   ACL_LINK_TYPE_10,
   ACL_LINK_TYPE_11,
};
 
#define        ACL_RULE_VALID_SMAC        BIT(0)
#define        ACL_RULE_VALID_DMAC        BIT(1)
#define        ACL_RULE_VALID_SIP        BIT(2)
#define        ACL_RULE_VALID_SIP_MASK        BIT(3)
#define        ACL_RULE_VALID_DIP        BIT(4)
#define        ACL_RULE_VALID_DIP_MASK        BIT(5)
#define        ACL_RULE_VALID_SIP6        BIT(6)
#define        ACL_RULE_VALID_SIP6_MASK    BIT(7)
#define        ACL_RULE_VALID_DIP6        BIT(8)
#define        ACL_RULE_VALID_DIP6_MASK    BIT(9)
#define        ACL_RULE_VALID_ETH_TYPE        BIT(10)
#define        ACL_RULE_VALID_VLAN        BIT(11)
#define        ACL_RULE_VALID_COS        BIT(12)
#define        ACL_RULE_VALID_SP_R        BIT(13)
#define        ACL_RULE_VALID_DP_R        BIT(14)
#define        ACL_RULE_VALID_DSCP        BIT(15)
#define        ACL_RULE_VALID_IP_PROT        BIT(16)
#define        ACL_RULE_VALID_INGRESS_PORT    BIT(17)
#define        ACL_RULE_VALID_USERDEF_OFFSET    BIT(18)
 
#define        ACL_RULE_RVS_SMAC        BIT(0)
#define        ACL_RULE_RVS_DMAC        BIT(1)
#define        ACL_RULE_RVS_SIP        BIT(2)
#define        ACL_RULE_RVS_SIP_MASK        BIT(3)
#define        ACL_RULE_RVS_DIP        BIT(4)
#define        ACL_RULE_RVS_DIP_MASK        BIT(5)
#define        ACL_RULE_RVS_SIP6        BIT(6)
#define        ACL_RULE_RVS_SIP6_MASK        BIT(7)
#define        ACL_RULE_RVS_DIP6        BIT(8)
#define        ACL_RULE_RVS_DIP6_MASK        BIT(9)
#define        ACL_RULE_RVS_ETH_TYPE        BIT(10)
#define        ACL_RULE_RVS_VLAN        BIT(11)
#define        ACL_RULE_RVS_COS        BIT(12)
#define        ACL_RULE_RVS_SP_R        BIT(13)
#define        ACL_RULE_RVS_DP_R        BIT(14)
#define        ACL_RULE_RVS_DSCP        BIT(15)
#define        ACL_RULE_RVS_IP_PROT        BIT(16)
#define        ACL_RULE_RVS_INGRESS_PORT    BIT(17)
#define        ACL_RULE_RVS_USERDEF_OFFSET    BIT(18)
 
#define        ACL_ACT_VALID_REDIR        BIT(0)
#define        ACL_ACT_VALID_PRI        BIT(1)
#define        ACL_ACT_VALID_DSCP        BIT(2)
#define        ACL_ACT_VALID_CPU        BIT(3)
#define        ACL_ACT_VALID_SNIFFER        BIT(4)
#define        ACL_ACT_VALID_PTP        BIT(5)
#define        ACL_ACT_VALID_SFLOW        BIT(6)
#define        ACL_ACT_VALID_CTAG        BIT(7)
#define        ACL_ACT_VALID_STAG        BIT(8)
#define        ACL_ACT_VALID_BW        BIT(9)
#define        ACL_ACT_VALID_STORM        BIT(10)
#define        ACL_ACT_VALID_MIB_COUNTER    BIT(11)
 
#define        ACL_ACT_TYPE_3            3
 
struct acl_rule
{
   // rule
   unsigned long    rule_valid;            // bit 0 : smac
                           // bit 1 : dmac
                           // bit 2 : sip
                           // bit 3 : sip_mask
                           // bit 4 : dip
                           // bit 5 : dip_mask
                           // bit 6 : sip6
                           // bit 7 : sip6_mask
                           // bit 8 : dip6
                           // bit 9 : dip6_mask
                           // bit 10: eth_type
                           // bit 11: vlan
                           // bit 12: cos
                           // bit 13: sp_range
                           // bit 14: dp_range
                           // bit 15: dscp
                           // bit 16: ip_prot
                           // bit 17: ingress_port
   // reverse
   unsigned long    rule_rvs;            // bit 0 : smac
                           // bit 1 : dmac
                           // bit 2 : sip
                           // bit 3 : sip_mask
                           // bit 4 : dip
                           // bit 5 : dip_mask
                           // bit 6 : sip6
                           // bit 7 : sip6_mask
                           // bit 8 : dip6
                           // bit 9 : dip6_mask
                           // bit 10: eth_type
                           // bit 11: vlan
                           // bit 12: cos
                           // bit 13: sp_range
                           // bit 14: dp_range
                           // bit 15: dscp
                           // bit 16: ip_prot
                           // bit 17: ingress_port
 
   unsigned char    smac[6];
   unsigned char    dmac[6];
 
   union{
       unsigned long    sip4;
       unsigned short    sip6[8];
   }sip;
#define sip4_addr    sip.sip4
#define sip6_addr16    sip.sip6
   unsigned char    sip_mask;            
       // IPv4    0 - FF:FF:FF:FF    IPv6     0 - FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF(0x00)
       //     1 - FF:FF:FF:00        1 - FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:0000:0000(0x3C)
       //     2 - FF:FF:00:00        2 - FFFF:FFFF:FFFF:FFFF:0000:0000:0000:0000(0x3D)
       //     4 - FF:00:00:00        3 - FFFF:FFFF:0000:0000:0000:0000:0000:0000(0x3F)
       //     8 - F0:00:00:00        4 - FFFF:0000:0000:0000:0000:0000:0000:0000(0xFF)
   union{
       unsigned long    dip4;
       unsigned short    dip6[8];
   }dip;
#define dip4_addr    dip.dip4
#define dip6_addr16    dip.dip6
   unsigned char    dip_mask;
 
   unsigned short    eth_type;
   unsigned short    vlan;
   unsigned short    cos;
   unsigned short    sp_hi;
   unsigned short    sp_lo;
   unsigned short    dp_hi;
   unsigned short    dp_lo;
   unsigned char    r_dscp;
   unsigned char    ip_prot;
   unsigned char    ingress_port;
 
   // action
   int        act_type;        // value = 0 ~ 2, type 3 need a acl entry
                           // 0 for drop
                           // 1 for Act_0 = b'0
                           // 2 for Act_1 = b'1
                           // 3 for Act_0001
 
   unsigned long    act_valid;        // bit 0 : redir
                       // bit 1 : pri
                       // bit 2 : dscp
                       // bit 3 : cpu
                       // bit 4 : mirror
                       // bit 5 : ptp
                       // bit 6 : sflow
                       // bit 7 : ctag
                       // bit 8 : stag
                       // bit 9 : bw
                       // bit 10: storm 
                       // bit 11: mib_counter 
   unsigned int    redir:5;
   unsigned int    pri:3;
   unsigned int    a_dscp:3;
   unsigned int    cpu:1;
   unsigned int    mirror:1;
   unsigned int    ptp:1;
   unsigned int    sflow:1;
   unsigned short    ctag;
   unsigned short    stag;
   unsigned short    bw;
   unsigned short    storm;
   unsigned short    mib_counter;
 
   /* User define 64 bytes offset */
                   //one bit for 2 bytes offset
   unsigned short location1;    //[4:0] user0
                   //[9:5] user1
   unsigned short location2;    //[4:0] user2
                   //[9:5] user3
 
   unsigned short usr0;
   unsigned short usr0_start;
   unsigned short usr1;
   unsigned short usr1_start;
   unsigned short usr2;
   unsigned short usr3;
 
   unsigned short mask0;
   unsigned short mask1;
   unsigned short mask2;
   unsigned short mask3;
};
 
struct AclRuleSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned int find_index_blockn; // find index start from block n and return used block actually.
   unsigned int find_index_rvs; // in block, find index in reverse or not
   unsigned int rule_index;
   unsigned int func_used;
   int rule_index_res;
   struct acl_rule rule;
   unsigned long reserved;            // show the used entry numbers for ip1811
};
 
struct AclGeneralSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   int index;
   int data;
};
 
struct AclEntryMaskGetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned short mask[4];
};
 
struct AclTableCleanSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   int rule_idx;
   int func_used;
};
 
/*--------------- Special Data Structures for EEPROM ---------------*/
struct EepromSetting
{
   void *nextcmd;
   unsigned long size_nextcmd;
   unsigned long cmdid;
   unsigned short addr;
   unsigned char value;
};
 
#endif        /* IP1811DS_H */