11 #define ATTR_PRODUCT 0x0001
12 #define ATTR_UNK_0002 0x0002
13 #define ATTR_NAME 0x0003
14 #define ATTR_MAC 0x0004
15 #define ATTR_UNK_0005 0x0005
16 #define ATTR_IP 0x0006
17 #define ATTR_NETMASK 0x0007
18 #define ATTR_GATEWAY 0x0008
19 #define ATTR_NEW_PASSWORD 0x0009
20 #define ATTR_PASSWORD 0x000A
21 #define ATTR_DHCP 0x000B
22 #define ATTR_UNK_000C 0x000C
23 #define ATTR_FIRM_VER 0x000D
24 #define ATTR_UNK_000E 0x000E
25 #define ATTR_UNK_000F 0x000F
26 #define ATTR_FIRM_UPGRADE 0x0010
27 #define ATTR_RESTART 0x0013
28 #define ATTR_ENCPASS 0x0014
29 #define ATTR_DEFAULTS 0x0400
30 #define ATTR_PORT_STATUS 0x0C00
31 #define ATTR_PORT_STATISTICS 0x1000
32 #define ATTR_STATS_RESET 0x1400
33 #define ATTR_CABLETEST_DO 0x1800
34 #define ATTR_CABLETEST_RESULT 0x1C00
35 #define ATTR_VLAN_TYPE 0x2000
36 #define ATTR_VLAN_PORT_CONF 0x2400
37 #define ATTR_VLAN_DOT_CONF 0x2800
38 #define ATTR_VLAN_DESTROY 0x2C00
39 #define ATTR_VLAN_PVID 0x3000
40 #define ATTR_QOS_TYPE 0x3400
41 #define ATTR_QOS_CONFIG 0x3800
42 #define ATTR_BITRATE_INPUT 0x4C00
43 #define ATTR_BITRATE_OUTPUT 0x5000
44 #define ATTR_STORM_ENABLE 0x5400
45 #define ATTR_STORM_BITRATE 0x5800
46 #define ATTR_MIRROR 0x5C00
47 #define ATTR_PORTS_COUNT 0x6000
48 #define ATTR_MAX_VLAN 0x6400
49 #define ATTR_IGMP_ENABLE_VLAN 0x6800
50 #define ATTR_IGMP_BLOCK_UNK 0x6C00
51 #define ATTR_IGMP_VALID_V3 0x7000
52 #define ATTR_TLV_BITMAP 0x7400
53 #define ATTR_END 0xFFFF
55 #define UNUSED __attribute__((unused))
59 unsigned short attr; /* attribute code */
60 unsigned int size; /* expected data size */
61 bool (*encode)(struct attr *at, unsigned char ports); /* encode function */
62 bool (*decode)(struct attr *at, unsigned char ports); /* decode function */
66 const struct attr_handler* getAttrHandler (unsigned short attrcode);
71 struct attr_port_status {
75 } __attribute__((packed));
78 struct attr_port_stat {
80 unsigned long long recv;
81 unsigned long long sent;
82 unsigned long long unk1;
83 unsigned long long unk2;
84 unsigned long long unk3;
85 unsigned long long crc;
86 } __attribute__((packed));
92 } __attribute__((packed));
98 } __attribute__((packed));
104 } __attribute__((packed));
107 struct attr_igmp_vlan {
108 unsigned short enable;
110 } __attribute__((packed));
113 struct attr_cabletest_do {
115 unsigned char action;
116 } __attribute__((packed));
119 struct attr_cabletest_result {
123 } __attribute__((packed));
126 struct attr_vlan_dot {
128 unsigned char ports[0];