#define LLDP_SNMP_REMOTE_DOT3_AGG_STATUS 14
#define LLDP_SNMP_REMOTE_DOT3_AGG_ID 15
#define LLDP_SNMP_REMOTE_DOT3_MFS 16
-#define LLDP_SNMP_REMOTE_DOT1_PVID 17
+#define LLDP_SNMP_REMOTE_DOT3_POWER_DEVICETYPE 17
+#define LLDP_SNMP_REMOTE_DOT3_POWER_SUPPORT 18
+#define LLDP_SNMP_REMOTE_DOT3_POWER_ENABLED 19
+#define LLDP_SNMP_REMOTE_DOT3_POWER_PAIRCONTROL 20
+#define LLDP_SNMP_REMOTE_DOT3_POWER_PAIRS 21
+#define LLDP_SNMP_REMOTE_DOT3_POWER_CLASS 22
+#define LLDP_SNMP_REMOTE_DOT1_PVID 23
/* Local vlans */
#define LLDP_SNMP_LOCAL_DOT1_VLANNAME 1
/* Remote vlans */
case LLDP_SNMP_REMOTE_DOT3_MFS:
long_ret = port->p_mfs;
return (u_char *)&long_ret;
+ case LLDP_SNMP_REMOTE_DOT3_POWER_DEVICETYPE:
+ if (port->p_power.devicetype) {
+ long_ret = (port->p_power.devicetype == LLDP_DOT3_POWER_PSE)?1:2;
+ return (u_char *)&long_ret;
+ }
+ break;
+ case LLDP_SNMP_REMOTE_DOT3_POWER_SUPPORT:
+ if (port->p_power.devicetype) {
+ long_ret = (port->p_power.supported)?1:2;
+ return (u_char *)&long_ret;
+ }
+ break;
+ case LLDP_SNMP_REMOTE_DOT3_POWER_ENABLED:
+ if (port->p_power.devicetype) {
+ long_ret = (port->p_power.enabled)?1:2;
+ return (u_char *)&long_ret;
+ }
+ break;
+ case LLDP_SNMP_REMOTE_DOT3_POWER_PAIRCONTROL:
+ if (port->p_power.devicetype) {
+ long_ret = (port->p_power.paircontrol)?1:2;
+ return (u_char *)&long_ret;
+ }
+ break;
+ case LLDP_SNMP_REMOTE_DOT3_POWER_PAIRS:
+ if (port->p_power.devicetype) {
+ long_ret = port->p_power.pairs;
+ return (u_char *)&long_ret;
+ }
+ break;
+ case LLDP_SNMP_REMOTE_DOT3_POWER_CLASS:
+ if (port->p_power.devicetype && port->p_power.class) {
+ long_ret = port->p_power.class;
+ return (u_char *)&long_ret;
+ }
+ break;
#endif
#ifdef ENABLE_DOT1
case LLDP_SNMP_REMOTE_DOT1_PVID:
default:
break;
}
- return NULL;
+ if (!exact && (name[*length-1] < MAX_SUBID))
+ return agent_h_remote_port(vp, name, length,
+ exact, var_len, write_method);
+ return NULL;
}
static u_char*
{1, 5, 4623, 1, 3, 1, 1, 3}},
{LLDP_SNMP_REMOTE_DOT3_AUTONEG_MAU, ASN_INTEGER, RONLY, agent_h_remote_port, 8,
{1, 5, 4623, 1, 3, 1, 1, 4}},
+ {LLDP_SNMP_REMOTE_DOT3_POWER_DEVICETYPE, ASN_INTEGER, RONLY, agent_h_remote_port, 8,
+ {1, 5, 4623, 1, 3, 2, 1, 1}},
+ {LLDP_SNMP_REMOTE_DOT3_POWER_SUPPORT, ASN_INTEGER, RONLY, agent_h_remote_port, 8,
+ {1, 5, 4623, 1, 3, 2, 1, 2}},
+ {LLDP_SNMP_REMOTE_DOT3_POWER_ENABLED, ASN_INTEGER, RONLY, agent_h_remote_port, 8,
+ {1, 5, 4623, 1, 3, 2, 1, 3}},
+ {LLDP_SNMP_REMOTE_DOT3_POWER_PAIRCONTROL, ASN_INTEGER, RONLY, agent_h_remote_port, 8,
+ {1, 5, 4623, 1, 3, 2, 1, 4}},
+ {LLDP_SNMP_REMOTE_DOT3_POWER_PAIRS, ASN_INTEGER, RONLY, agent_h_remote_port, 8,
+ {1, 5, 4623, 1, 3, 2, 1, 5}},
+ {LLDP_SNMP_REMOTE_DOT3_POWER_CLASS, ASN_INTEGER, RONLY, agent_h_remote_port, 8,
+ {1, 5, 4623, 1, 3, 2, 1, 6}},
{LLDP_SNMP_REMOTE_DOT3_AGG_STATUS, ASN_OCTET_STR, RONLY, agent_h_remote_port, 8,
{1, 5, 4623, 1, 3, 3, 1, 1}},
{LLDP_SNMP_REMOTE_DOT3_AGG_ID, ASN_INTEGER, RONLY, agent_h_remote_port, 8,
{ 53, "1000BasePX20U - One single-mode fiber EPON ONU, 20km" },
{ 0, NULL }
};
+
+static const struct value_string port_dot3_power_devicetype_map[] = {
+ { LLDP_DOT3_POWER_PSE, "PSE" },
+ { LLDP_DOT3_POWER_PD, "PD" },
+ { 0, NULL }
+};
+
+static const struct value_string port_dot3_power_pairs_map[] = {
+ { LLDP_DOT3_POWERPAIRS_SIGNAL, "signal" },
+ { LLDP_DOT3_POWERPAIRS_SPARE, "spare" },
+ { 0, NULL }
+};
+
+static const struct value_string port_dot3_power_class_map[] = {
+ { 1, "class 0" },
+ { 2, "class 1" },
+ { 3, "class 2" },
+ { 4, "class 3" },
+ { 5, "class 4" },
+ { 0, NULL }
+};
#endif
static const struct value_string chassis_capability_map[] = {
map_lookup(operational_mau_type_values, port->p_macphy.mau_type));
tag_end(w);
}
+ if (port->p_power.devicetype) {
+ tag_start(w, "power", "MDI Power");
+ tag_attr(w, "supported", "supported",
+ port->p_power.supported?"yes":"no");
+ tag_attr(w, "enabled", "enabled",
+ port->p_power.enabled?"yes":"no");
+ tag_attr(w, "paircontrol", "pair control",
+ port->p_power.paircontrol?"yes":"no");
+ tag_start(w, "device-type", "Device type");
+ tag_data(w, map_lookup(port_dot3_power_devicetype_map,
+ port->p_power.devicetype));
+ tag_end(w);
+ tag_start(w, "pairs", "Power pairs");
+ tag_data(w, map_lookup(port_dot3_power_pairs_map,
+ port->p_power.pairs));
+ tag_end(w);
+ tag_start(w, "class", "Class");
+ tag_data(w, map_lookup(port_dot3_power_class_map,
+ port->p_power.class));
+ tag_end(w);
+ tag_end(w);
+ }
#endif
tag_end(w);
}
CHECK_TLV_SIZE(9, "MAC/PHY");
port->p_macphy.autoneg_support = PEEK_UINT8;
port->p_macphy.autoneg_enabled =
- port->p_macphy.autoneg_support && 0x2;
+ port->p_macphy.autoneg_support & 0x2;
port->p_macphy.autoneg_support =
- port->p_macphy.autoneg_support && 0x1;
+ port->p_macphy.autoneg_support & 0x1;
port->p_macphy.autoneg_advertised =
PEEK_UINT16;
port->p_macphy.mau_type = PEEK_UINT16;
CHECK_TLV_SIZE(6, "MFS");
port->p_mfs = PEEK_UINT16;
break;
+ case LLDP_TLV_DOT3_POWER:
+ CHECK_TLV_SIZE(7, "Power");
+ port->p_power.devicetype = PEEK_UINT8;
+ port->p_power.supported =
+ port->p_power.devicetype & 0x2;
+ port->p_power.enabled =
+ port->p_power.devicetype & 0x4;
+ port->p_power.paircontrol =
+ port->p_power.devicetype & 0x8;
+ port->p_power.devicetype =
+ (port->p_power.devicetype & 0x1)?
+ LLDP_DOT3_POWER_PSE:LLDP_DOT3_POWER_PD;
+ port->p_power.pairs = PEEK_UINT8;
+ port->p_power.class = PEEK_UINT8;
+ break;
default:
/* Unknown Dot3 TLV, ignore it */
hardware->h_rx_unrecognized_cnt++;