38#ifndef LWIP_HDR_APPS_SNMP_THREADSYNC_H
39#define LWIP_HDR_APPS_SNMP_THREADSYNC_H
52typedef void (*snmp_threadsync_called_fn)(
void* arg);
53typedef void (*snmp_threadsync_synchronizer_fn)(snmp_threadsync_called_fn fn,
void* arg);
64 const u32_t *root_oid;
71 const struct snmp_threadsync_node *threadsync_node;
72 struct snmp_node_instance proxy_instance;
76struct snmp_threadsync_instance
79 sys_mutex_t sem_usage_mutex;
80 snmp_threadsync_synchronizer_fn sync_fn;
81 struct threadsync_data data;
85struct snmp_threadsync_node
88 struct snmp_leaf_node node;
90 const struct snmp_leaf_node *target;
91 struct snmp_threadsync_instance *instance;
94snmp_err_t snmp_threadsync_get_instance(
const u32_t *root_oid, u8_t root_oid_len,
struct snmp_node_instance* instance);
95snmp_err_t snmp_threadsync_get_next_instance(
const u32_t *root_oid, u8_t root_oid_len,
struct snmp_node_instance* instance);
98#define SNMP_CREATE_THREAD_SYNC_NODE(oid, target_leaf_node, threadsync_instance) \
99 {{{ SNMP_NODE_THREADSYNC, (oid) }, \
100 snmp_threadsync_get_instance, \
101 snmp_threadsync_get_next_instance }, \
102 (target_leaf_node), \
103 (threadsync_instance) }
106void snmp_threadsync_init(
struct snmp_threadsync_instance *instance, snmp_threadsync_synchronizer_fn sync_fn);