From 4e8574bd23005e31a9c016f55ebc77b9d6b61ad2 Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Thu, 7 Jan 2016 09:53:25 +0100 Subject: [PATCH] SNMP: Table API cleanup --- src/include/lwip/apps/snmp_core.h | 4 ---- src/include/lwip/apps/snmp_table.h | 9 ++++++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/include/lwip/apps/snmp_core.h b/src/include/lwip/apps/snmp_core.h index c1ed2657..1d26ded7 100644 --- a/src/include/lwip/apps/snmp_core.h +++ b/src/include/lwip/apps/snmp_core.h @@ -143,10 +143,6 @@ union snmp_variant_value s32_t s32; }; -#define SNMP_VARIANT_VALUE_TYPE_U32 0 -#define SNMP_VARIANT_VALUE_TYPE_S32 1 -#define SNMP_VARIANT_VALUE_TYPE_PTR 2 -#define SNMP_VARIANT_VALUE_TYPE_CONST_PTR 3 /** SNMP MIB node types diff --git a/src/include/lwip/apps/snmp_table.h b/src/include/lwip/apps/snmp_table.h index afc932b7..b4780867 100644 --- a/src/include/lwip/apps/snmp_table.h +++ b/src/include/lwip/apps/snmp_table.h @@ -83,11 +83,18 @@ snmp_err_t snmp_table_get_next_instance(const u32_t *root_oid, u8_t root_oid_len /* simple read-only table */ +typedef enum { + SNMP_VARIANT_VALUE_TYPE_U32, + SNMP_VARIANT_VALUE_TYPE_S32, + SNMP_VARIANT_VALUE_TYPE_PTR, + SNMP_VARIANT_VALUE_TYPE_CONST_PTR +} snmp_table_column_data_type_t; + struct snmp_table_simple_col_def { u32_t index; u8_t asn1_type; - u8_t data_type; /* any of SNMP_VARIANT_VALUE_TYPE_*, depending of what union member is used to store the value*/ + snmp_table_column_data_type_t data_type; /* depending of what union member is used to store the value*/ }; struct snmp_table_simple_node