C-Style comments only, please

This commit is contained in:
Dirk Ziegelmeier 2015-12-26 12:17:07 +01:00
parent 406f707d9a
commit fdd98879bf
9 changed files with 19 additions and 23 deletions

View File

@ -500,7 +500,7 @@ static void fix_filename_for_c(char* qualifiedName, size_t max_len)
if (!strcmp(f->filename_c, new_name)) {
filename_ok = 0;
cnt++;
// try next unique file name
/* try next unique file name */
sprintf(&new_name[len], "%d", cnt);
break;
}

View File

@ -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 */
/* (not allowed for SNMP; RFC 1157, 3.2.2) */
return ERR_VAL;
//tlv->length_len = 1;
//tlv->value_len = 0xFFFF;
}
return ERR_OK;

View File

@ -526,7 +526,7 @@ snmp_get_next_node_instance_from_oid(const u32_t *oid, u8_t oid_len, snmp_valida
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;
}

View File

@ -53,8 +53,8 @@ snmp_netconn_thread(void *arg)
conn = netconn_new(NETCONN_UDP);
LWIP_ERROR("snmp_netconn: invalid conn", (conn != NULL), return;);
//trap_msg.handle = conn;
//trap_msg.lip = &conn->pcb.udp->local_ip;
/*trap_msg.handle = conn;*/
/*trap_msg.lip = &conn->pcb.udp->local_ip;*/
/* Bind to SNMP port with default IP address */
netconn_bind(conn, IP_ADDR_ANY, SNMP_IN_PORT);

View File

@ -43,7 +43,7 @@ snmp_pbuf_stream_init(struct snmp_pbuf_stream* pbuf_stream, struct pbuf* p, u16_
pbuf_stream->offset = offset;
pbuf_stream->length = length;
// skip to matching buffer
/* skip to matching buffer */
while (offset >= p->len) {
offset -= p->len;
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->length -= (u16_t)offset;
// skipt to matching buffer
/* skip to matching buffer */
while (offset > pbuf_stream->pbuf_len) {
offset -= pbuf_stream->pbuf_len;

View File

@ -70,8 +70,8 @@ snmp_init(void)
snmp_pcb = udp_new();
if (snmp_pcb != NULL) {
//trap_msg.handle = snmp_pcb;
//trap_msg.lip = &snmp_pcb->local_ip;
/*trap_msg.handle = snmp_pcb;*/
/*trap_msg.lip = &snmp_pcb->local_ip;*/
udp_recv(snmp_pcb, snmp_recv, (void *)SNMP_IN_PORT);
udp_bind(snmp_pcb, IP_ADDR_ANY, SNMP_IN_PORT);

View File

@ -162,7 +162,7 @@ snmp_err_t snmp_table_get_next_instance(const u32_t *root_oid, u8_t root_oid_len
}
while (1);
// build resulting oid
/* build resulting oid */
instance->instance_oid.len = 2;
instance->instance_oid.id[0] = 1;
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_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;
default:
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_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;
default:
LWIP_DEBUGF(SNMP_DEBUG, ("snmp_table_simple_get_instance(): unknown column data_type: %d\n", col_def->data_type));
return SNMP_ERR_GENERROR;
}
// build resulting oid
/* build resulting oid */
instance->instance_oid.len = 2;
instance->instance_oid.id[0] = 1;
instance->instance_oid.id[1] = col_def->index;

View File

@ -55,7 +55,7 @@ static struct snmp_trap_dst trap_dst[SNMP_TRAP_DESTINATIONS];
static u8_t snmp_auth_traps_enabled = 0;
/** TRAP message structure */
//struct snmp_msg_trap trap_msg;
/*struct snmp_msg_trap trap_msg;*/
/**
* 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(specific_trap);
return ERR_OK;
#if 0
//struct snmp_trap_dst *td;
//struct netif *dst_if;
//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;
#endif
}
err_t
@ -195,9 +197,6 @@ err_t snmp_send_trap_specific(s32_t specific_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);
}
@ -205,13 +204,11 @@ void
snmp_authfail_trap(void)
{
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);
}
}
#if 0
//extern struct snmp_msg_trap trap_msg;
//struct snmp_msg_trap
@ -409,5 +406,6 @@ snmp_authfail_trap(void)
//
// return ofs;
//}
#endif
#endif /* LWIP_SNMP */

View File

@ -124,7 +124,7 @@
* The maximum size of a value.
*/
#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)
#endif