mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
Fix to be able to build SNMP with LWIP_ARP=0. It's not a perfect solution, but I put some @todo points to review them later.
This commit is contained in:
parent
f57c2424cf
commit
8c19f9a57e
@ -2692,7 +2692,7 @@ atentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od)
|
|||||||
od->instance = MIB_OBJECT_TAB;
|
od->instance = MIB_OBJECT_TAB;
|
||||||
od->access = MIB_OBJECT_READ_WRITE;
|
od->access = MIB_OBJECT_READ_WRITE;
|
||||||
od->asn_type = (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_OC_STR);
|
od->asn_type = (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_OC_STR);
|
||||||
od->v_len = sizeof(struct eth_addr);
|
od->v_len = 6; /** @todo try to use netif::hwaddr_len */
|
||||||
break;
|
break;
|
||||||
case 3: /* atNetAddress */
|
case 3: /* atNetAddress */
|
||||||
od->instance = MIB_OBJECT_TAB;
|
od->instance = MIB_OBJECT_TAB;
|
||||||
@ -2716,9 +2716,11 @@ atentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od)
|
|||||||
static void
|
static void
|
||||||
atentry_get_value(struct obj_def *od, u16_t len, void *value)
|
atentry_get_value(struct obj_def *od, u16_t len, void *value)
|
||||||
{
|
{
|
||||||
|
#if LWIP_ARP
|
||||||
u8_t id;
|
u8_t id;
|
||||||
struct eth_addr* ethaddr_ret;
|
struct eth_addr* ethaddr_ret;
|
||||||
struct ip_addr* ipaddr_ret;
|
struct ip_addr* ipaddr_ret;
|
||||||
|
#endif /* LWIP_ARP */
|
||||||
struct ip_addr ip;
|
struct ip_addr ip;
|
||||||
struct netif *netif;
|
struct netif *netif;
|
||||||
|
|
||||||
@ -2728,6 +2730,7 @@ atentry_get_value(struct obj_def *od, u16_t len, void *value)
|
|||||||
snmp_oidtoip(&od->id_inst_ptr[2], &ip);
|
snmp_oidtoip(&od->id_inst_ptr[2], &ip);
|
||||||
ip.addr = htonl(ip.addr);
|
ip.addr = htonl(ip.addr);
|
||||||
|
|
||||||
|
#if LWIP_ARP /** @todo implement a netif_find_addr */
|
||||||
if (etharp_find_addr(netif, &ip, ðaddr_ret, &ipaddr_ret) > -1)
|
if (etharp_find_addr(netif, &ip, ðaddr_ret, &ipaddr_ret) > -1)
|
||||||
{
|
{
|
||||||
id = od->id_inst_ptr[0];
|
id = od->id_inst_ptr[0];
|
||||||
@ -2755,6 +2758,7 @@ atentry_get_value(struct obj_def *od, u16_t len, void *value)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* LWIP_ARP */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -3372,7 +3376,7 @@ ip_ntomentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od)
|
|||||||
od->instance = MIB_OBJECT_TAB;
|
od->instance = MIB_OBJECT_TAB;
|
||||||
od->access = MIB_OBJECT_READ_WRITE;
|
od->access = MIB_OBJECT_READ_WRITE;
|
||||||
od->asn_type = (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_OC_STR);
|
od->asn_type = (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_OC_STR);
|
||||||
od->v_len = sizeof(struct eth_addr);
|
od->v_len = 6; /** @todo try to use netif::hwaddr_len */
|
||||||
break;
|
break;
|
||||||
case 3: /* ipNetToMediaNetAddress */
|
case 3: /* ipNetToMediaNetAddress */
|
||||||
od->instance = MIB_OBJECT_TAB;
|
od->instance = MIB_OBJECT_TAB;
|
||||||
@ -3396,9 +3400,11 @@ ip_ntomentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od)
|
|||||||
static void
|
static void
|
||||||
ip_ntomentry_get_value(struct obj_def *od, u16_t len, void *value)
|
ip_ntomentry_get_value(struct obj_def *od, u16_t len, void *value)
|
||||||
{
|
{
|
||||||
|
#if LWIP_ARP
|
||||||
u8_t id;
|
u8_t id;
|
||||||
struct eth_addr* ethaddr_ret;
|
struct eth_addr* ethaddr_ret;
|
||||||
struct ip_addr* ipaddr_ret;
|
struct ip_addr* ipaddr_ret;
|
||||||
|
#endif /* LWIP_ARP */
|
||||||
struct ip_addr ip;
|
struct ip_addr ip;
|
||||||
struct netif *netif;
|
struct netif *netif;
|
||||||
|
|
||||||
@ -3408,6 +3414,7 @@ ip_ntomentry_get_value(struct obj_def *od, u16_t len, void *value)
|
|||||||
snmp_oidtoip(&od->id_inst_ptr[2], &ip);
|
snmp_oidtoip(&od->id_inst_ptr[2], &ip);
|
||||||
ip.addr = htonl(ip.addr);
|
ip.addr = htonl(ip.addr);
|
||||||
|
|
||||||
|
#if LWIP_ARP /** @todo implement a netif_find_addr */
|
||||||
if (etharp_find_addr(netif, &ip, ðaddr_ret, &ipaddr_ret) > -1)
|
if (etharp_find_addr(netif, &ip, ðaddr_ret, &ipaddr_ret) > -1)
|
||||||
{
|
{
|
||||||
id = od->id_inst_ptr[0];
|
id = od->id_inst_ptr[0];
|
||||||
@ -3442,6 +3449,7 @@ ip_ntomentry_get_value(struct obj_def *od, u16_t len, void *value)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* LWIP_ARP */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user