mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-09-17 20:24:24 +00:00
C-Style comments only, please
This commit is contained in:
parent
406f707d9a
commit
fdd98879bf
@ -500,7 +500,7 @@ static void fix_filename_for_c(char* qualifiedName, size_t max_len)
|
|||||||
if (!strcmp(f->filename_c, new_name)) {
|
if (!strcmp(f->filename_c, new_name)) {
|
||||||
filename_ok = 0;
|
filename_ok = 0;
|
||||||
cnt++;
|
cnt++;
|
||||||
// try next unique file name
|
/* try next unique file name */
|
||||||
sprintf(&new_name[len], "%d", cnt);
|
sprintf(&new_name[len], "%d", cnt);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -457,8 +457,6 @@ snmp_asn1_dec_tlv(struct snmp_pbuf_stream* pbuf_stream, struct snmp_asn1_tlv* tl
|
|||||||
} else { /* data == 0x80 indefinite length form */
|
} else { /* data == 0x80 indefinite length form */
|
||||||
/* (not allowed for SNMP; RFC 1157, 3.2.2) */
|
/* (not allowed for SNMP; RFC 1157, 3.2.2) */
|
||||||
return ERR_VAL;
|
return ERR_VAL;
|
||||||
//tlv->length_len = 1;
|
|
||||||
//tlv->value_len = 0xFFFF;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
|
@ -526,7 +526,7 @@ snmp_get_next_node_instance_from_oid(const u32_t *oid, u8_t oid_len, snmp_valida
|
|||||||
|
|
||||||
if (mib == NULL)
|
if (mib == NULL)
|
||||||
{
|
{
|
||||||
// loop is only left when mib == null (error) or mib_node != NULL (success)
|
/* loop is only left when mib == null (error) or mib_node != NULL (success) */
|
||||||
return SNMP_ERR_ENDOFMIBVIEW;
|
return SNMP_ERR_ENDOFMIBVIEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,8 +53,8 @@ snmp_netconn_thread(void *arg)
|
|||||||
conn = netconn_new(NETCONN_UDP);
|
conn = netconn_new(NETCONN_UDP);
|
||||||
LWIP_ERROR("snmp_netconn: invalid conn", (conn != NULL), return;);
|
LWIP_ERROR("snmp_netconn: invalid conn", (conn != NULL), return;);
|
||||||
|
|
||||||
//trap_msg.handle = conn;
|
/*trap_msg.handle = conn;*/
|
||||||
//trap_msg.lip = &conn->pcb.udp->local_ip;
|
/*trap_msg.lip = &conn->pcb.udp->local_ip;*/
|
||||||
|
|
||||||
/* Bind to SNMP port with default IP address */
|
/* Bind to SNMP port with default IP address */
|
||||||
netconn_bind(conn, IP_ADDR_ANY, SNMP_IN_PORT);
|
netconn_bind(conn, IP_ADDR_ANY, SNMP_IN_PORT);
|
||||||
|
@ -43,7 +43,7 @@ snmp_pbuf_stream_init(struct snmp_pbuf_stream* pbuf_stream, struct pbuf* p, u16_
|
|||||||
pbuf_stream->offset = offset;
|
pbuf_stream->offset = offset;
|
||||||
pbuf_stream->length = length;
|
pbuf_stream->length = length;
|
||||||
|
|
||||||
// skip to matching buffer
|
/* skip to matching buffer */
|
||||||
while (offset >= p->len) {
|
while (offset >= p->len) {
|
||||||
offset -= p->len;
|
offset -= p->len;
|
||||||
p = p->next;
|
p = p->next;
|
||||||
@ -214,7 +214,7 @@ snmp_pbuf_stream_seek(struct snmp_pbuf_stream* pbuf_stream, s32_t offset)
|
|||||||
pbuf_stream->offset += (u16_t)offset;
|
pbuf_stream->offset += (u16_t)offset;
|
||||||
pbuf_stream->length -= (u16_t)offset;
|
pbuf_stream->length -= (u16_t)offset;
|
||||||
|
|
||||||
// skipt to matching buffer
|
/* skip to matching buffer */
|
||||||
while (offset > pbuf_stream->pbuf_len) {
|
while (offset > pbuf_stream->pbuf_len) {
|
||||||
offset -= pbuf_stream->pbuf_len;
|
offset -= pbuf_stream->pbuf_len;
|
||||||
|
|
||||||
|
@ -70,8 +70,8 @@ snmp_init(void)
|
|||||||
snmp_pcb = udp_new();
|
snmp_pcb = udp_new();
|
||||||
|
|
||||||
if (snmp_pcb != NULL) {
|
if (snmp_pcb != NULL) {
|
||||||
//trap_msg.handle = snmp_pcb;
|
/*trap_msg.handle = snmp_pcb;*/
|
||||||
//trap_msg.lip = &snmp_pcb->local_ip;
|
/*trap_msg.lip = &snmp_pcb->local_ip;*/
|
||||||
|
|
||||||
udp_recv(snmp_pcb, snmp_recv, (void *)SNMP_IN_PORT);
|
udp_recv(snmp_pcb, snmp_recv, (void *)SNMP_IN_PORT);
|
||||||
udp_bind(snmp_pcb, IP_ADDR_ANY, SNMP_IN_PORT);
|
udp_bind(snmp_pcb, IP_ADDR_ANY, SNMP_IN_PORT);
|
||||||
|
@ -162,7 +162,7 @@ snmp_err_t snmp_table_get_next_instance(const u32_t *root_oid, u8_t root_oid_len
|
|||||||
}
|
}
|
||||||
while (1);
|
while (1);
|
||||||
|
|
||||||
// build resulting oid
|
/* build resulting oid */
|
||||||
instance->instance_oid.len = 2;
|
instance->instance_oid.len = 2;
|
||||||
instance->instance_oid.id[0] = 1;
|
instance->instance_oid.id[0] = 1;
|
||||||
instance->instance_oid.id[1] = col_def->index;
|
instance->instance_oid.id[1] = col_def->index;
|
||||||
@ -218,7 +218,7 @@ snmp_err_t snmp_table_simple_get_instance(const u32_t *root_oid, u8_t root_oid_l
|
|||||||
{
|
{
|
||||||
case SNMP_VARIANT_VALUE_TYPE_U32: instance->get_value = snmp_table_extract_value_from_u32ref; break;
|
case SNMP_VARIANT_VALUE_TYPE_U32: instance->get_value = snmp_table_extract_value_from_u32ref; break;
|
||||||
case SNMP_VARIANT_VALUE_TYPE_S32: instance->get_value = snmp_table_extract_value_from_s32ref; break;
|
case SNMP_VARIANT_VALUE_TYPE_S32: instance->get_value = snmp_table_extract_value_from_s32ref; break;
|
||||||
case SNMP_VARIANT_VALUE_TYPE_PTR: // fall through
|
case SNMP_VARIANT_VALUE_TYPE_PTR: /* fall through */
|
||||||
case SNMP_VARIANT_VALUE_TYPE_CONST_PTR: instance->get_value = snmp_table_extract_value_from_refconstptr; break;
|
case SNMP_VARIANT_VALUE_TYPE_CONST_PTR: instance->get_value = snmp_table_extract_value_from_refconstptr; break;
|
||||||
default:
|
default:
|
||||||
LWIP_DEBUGF(SNMP_DEBUG, ("snmp_table_simple_get_instance(): unknown column data_type: %d\n", col_def->data_type));
|
LWIP_DEBUGF(SNMP_DEBUG, ("snmp_table_simple_get_instance(): unknown column data_type: %d\n", col_def->data_type));
|
||||||
@ -319,14 +319,14 @@ snmp_err_t snmp_table_simple_get_next_instance(const u32_t *root_oid, u8_t root_
|
|||||||
{
|
{
|
||||||
case SNMP_VARIANT_VALUE_TYPE_U32: instance->get_value = snmp_table_extract_value_from_u32ref; break;
|
case SNMP_VARIANT_VALUE_TYPE_U32: instance->get_value = snmp_table_extract_value_from_u32ref; break;
|
||||||
case SNMP_VARIANT_VALUE_TYPE_S32: instance->get_value = snmp_table_extract_value_from_s32ref; break;
|
case SNMP_VARIANT_VALUE_TYPE_S32: instance->get_value = snmp_table_extract_value_from_s32ref; break;
|
||||||
case SNMP_VARIANT_VALUE_TYPE_PTR: // fall through
|
case SNMP_VARIANT_VALUE_TYPE_PTR: /* fall through */
|
||||||
case SNMP_VARIANT_VALUE_TYPE_CONST_PTR: instance->get_value = snmp_table_extract_value_from_refconstptr; break;
|
case SNMP_VARIANT_VALUE_TYPE_CONST_PTR: instance->get_value = snmp_table_extract_value_from_refconstptr; break;
|
||||||
default:
|
default:
|
||||||
LWIP_DEBUGF(SNMP_DEBUG, ("snmp_table_simple_get_instance(): unknown column data_type: %d\n", col_def->data_type));
|
LWIP_DEBUGF(SNMP_DEBUG, ("snmp_table_simple_get_instance(): unknown column data_type: %d\n", col_def->data_type));
|
||||||
return SNMP_ERR_GENERROR;
|
return SNMP_ERR_GENERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// build resulting oid
|
/* build resulting oid */
|
||||||
instance->instance_oid.len = 2;
|
instance->instance_oid.len = 2;
|
||||||
instance->instance_oid.id[0] = 1;
|
instance->instance_oid.id[0] = 1;
|
||||||
instance->instance_oid.id[1] = col_def->index;
|
instance->instance_oid.id[1] = col_def->index;
|
||||||
|
@ -55,7 +55,7 @@ static struct snmp_trap_dst trap_dst[SNMP_TRAP_DESTINATIONS];
|
|||||||
static u8_t snmp_auth_traps_enabled = 0;
|
static u8_t snmp_auth_traps_enabled = 0;
|
||||||
|
|
||||||
/** TRAP message structure */
|
/** TRAP message structure */
|
||||||
//struct snmp_msg_trap trap_msg;
|
/*struct snmp_msg_trap trap_msg;*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets enable switch for this trap destination.
|
* Sets enable switch for this trap destination.
|
||||||
@ -118,6 +118,7 @@ snmp_send_trap(const struct snmp_obj_id *device_enterprise_oid, s32_t generic_tr
|
|||||||
LWIP_UNUSED_ARG(generic_trap);
|
LWIP_UNUSED_ARG(generic_trap);
|
||||||
LWIP_UNUSED_ARG(specific_trap);
|
LWIP_UNUSED_ARG(specific_trap);
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
|
#if 0
|
||||||
//struct snmp_trap_dst *td;
|
//struct snmp_trap_dst *td;
|
||||||
//struct netif *dst_if;
|
//struct netif *dst_if;
|
||||||
//const ip_addr_t* dst_ip;
|
//const ip_addr_t* dst_ip;
|
||||||
@ -178,6 +179,7 @@ snmp_send_trap(const struct snmp_obj_id *device_enterprise_oid, s32_t generic_tr
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
//return err;
|
//return err;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
err_t
|
err_t
|
||||||
@ -195,9 +197,6 @@ err_t snmp_send_trap_specific(s32_t specific_trap)
|
|||||||
void
|
void
|
||||||
snmp_coldstart_trap(void)
|
snmp_coldstart_trap(void)
|
||||||
{
|
{
|
||||||
//trap_msg.outvb.head = NULL;
|
|
||||||
//trap_msg.outvb.tail = NULL;
|
|
||||||
//trap_msg.outvb.count = 0;
|
|
||||||
snmp_send_trap_generic(SNMP_GENTRAP_COLDSTART);
|
snmp_send_trap_generic(SNMP_GENTRAP_COLDSTART);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,13 +204,11 @@ void
|
|||||||
snmp_authfail_trap(void)
|
snmp_authfail_trap(void)
|
||||||
{
|
{
|
||||||
if (snmp_auth_traps_enabled != 0) {
|
if (snmp_auth_traps_enabled != 0) {
|
||||||
//trap_msg.outvb.head = NULL;
|
|
||||||
//trap_msg.outvb.tail = NULL;
|
|
||||||
//trap_msg.outvb.count = 0;
|
|
||||||
snmp_send_trap_generic(SNMP_GENTRAP_AUTH_FAILURE);
|
snmp_send_trap_generic(SNMP_GENTRAP_AUTH_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
//extern struct snmp_msg_trap trap_msg;
|
//extern struct snmp_msg_trap trap_msg;
|
||||||
|
|
||||||
//struct snmp_msg_trap
|
//struct snmp_msg_trap
|
||||||
@ -409,5 +406,6 @@ snmp_authfail_trap(void)
|
|||||||
//
|
//
|
||||||
// return ofs;
|
// return ofs;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* LWIP_SNMP */
|
||||||
|
@ -124,7 +124,7 @@
|
|||||||
* The maximum size of a value.
|
* The maximum size of a value.
|
||||||
*/
|
*/
|
||||||
#ifndef SNMP_MAX_VALUE_SIZE
|
#ifndef SNMP_MAX_VALUE_SIZE
|
||||||
#define SNMP_MIN_VALUE_SIZE (2 * sizeof(u32_t*)) // size required to store the basic types (8 bytes for counter64)
|
#define SNMP_MIN_VALUE_SIZE (2 * sizeof(u32_t*)) /* size required to store the basic types (8 bytes for counter64) */
|
||||||
#define SNMP_MAX_VALUE_SIZE LWIP_MAX(LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN), sizeof(u32_t)*(SNMP_MAX_OBJ_ID_LEN)), SNMP_MIN_VALUE_SIZE)
|
#define SNMP_MAX_VALUE_SIZE LWIP_MAX(LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN), sizeof(u32_t)*(SNMP_MAX_OBJ_ID_LEN)), SNMP_MIN_VALUE_SIZE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user