net-snmp 5.7
|
00001 #ifndef NET_SNMP_VARBIND_API_H 00002 #define NET_SNMP_VARBIND_API_H 00003 00008 #include <net-snmp/types.h> 00009 00010 #ifdef __cplusplus 00011 extern "C" { 00012 #endif 00013 00014 /* Creation */ 00015 NETSNMP_IMPORT 00016 netsnmp_variable_list * 00017 snmp_pdu_add_variable(netsnmp_pdu *pdu, 00018 const oid * name, size_t name_length, 00019 u_char type, 00020 const void * value, size_t len); 00021 NETSNMP_IMPORT 00022 netsnmp_variable_list * 00023 snmp_varlist_add_variable(netsnmp_variable_list ** varlist, 00024 const oid * name, size_t name_length, 00025 u_char type, 00026 const void * value, size_t len); 00027 NETSNMP_IMPORT 00028 netsnmp_variable_list * 00029 snmp_add_null_var(netsnmp_pdu *pdu, 00030 const oid * name, size_t name_length); 00031 NETSNMP_IMPORT 00032 netsnmp_variable_list * 00033 snmp_clone_varbind(netsnmp_variable_list * varlist); 00034 00035 /* Setting Values */ 00036 NETSNMP_IMPORT 00037 int snmp_set_var_objid(netsnmp_variable_list * var, 00038 const oid * name, size_t name_length); 00039 NETSNMP_IMPORT 00040 int snmp_set_var_value(netsnmp_variable_list * var, 00041 const void * value, size_t len); 00042 NETSNMP_IMPORT 00043 int snmp_set_var_typed_value(netsnmp_variable_list * var, 00044 u_char type, 00045 const void * value, size_t len); 00046 NETSNMP_IMPORT 00047 int snmp_set_var_typed_integer(netsnmp_variable_list * var, 00048 u_char type, long val); 00049 00050 /* Output */ 00051 NETSNMP_IMPORT 00052 void print_variable(const oid * objid, size_t objidlen, 00053 const netsnmp_variable_list * variable); 00054 NETSNMP_IMPORT 00055 void fprint_variable(FILE * fp, 00056 const oid * objid, size_t objidlen, 00057 const netsnmp_variable_list * variable); 00058 NETSNMP_IMPORT 00059 int snprint_variable(char *buf, size_t buf_len, 00060 const oid * objid, size_t objidlen, 00061 const netsnmp_variable_list * variable); 00062 00063 NETSNMP_IMPORT 00064 void print_value(const oid * objid, size_t objidlen, 00065 const netsnmp_variable_list * variable); 00066 NETSNMP_IMPORT 00067 void fprint_value(FILE * fp, 00068 const oid * objid, size_t objidlen, 00069 const netsnmp_variable_list * variable); 00070 NETSNMP_IMPORT 00071 int snprint_value(char *buf, size_t buf_len, 00072 const oid * objid, size_t objidlen, 00073 const netsnmp_variable_list * variable); 00074 00075 /* See mib_api.h for {,f,sn}print_objid */ 00076 00077 /* Deletion */ 00078 NETSNMP_IMPORT 00079 void snmp_free_var( netsnmp_variable_list *var); /* frees just this one */ 00080 NETSNMP_IMPORT 00081 void snmp_free_varbind(netsnmp_variable_list *varlist); /* frees all in list */ 00082 00083 #ifdef __cplusplus 00084 } 00085 #endif 00086 00087 /* 00088 * Having extracted the main ("public API") calls relevant 00089 * to this area of the Net-SNMP project, the next step is to 00090 * identify the related "public internal API" routines. 00091 * 00092 * In due course, these should probably be gathered 00093 * together into a companion 'library/varbind_api.h' header file. 00094 * [Or some suitable name] 00095 * 00096 * But for the time being, the expectation is that the 00097 * traditional headers that provided the above definitions 00098 * will probably also cover the relevant internal API calls. 00099 * Hence they are listed here: 00100 */ 00101 #include <net-snmp/library/snmp_api.h> 00102 #include <net-snmp/library/snmp_client.h> 00103 #include <net-snmp/library/mib.h> 00104 00105 #endif /* NET_SNMP_VARBIND_API_H */