📄 ucd_compat.c
字号:
/* * For compatibility with applications built using * previous versions of the UCD library only. */#include <net-snmp/net-snmp-config.h>#include <net-snmp/types.h>#include <net-snmp/session_api.h>#include <net-snmp/config_api.h>#include <net-snmp/library/mib.h> /* for OID O/P format enums *//* * use <netsnmp_session *)->s_snmp_errno instead */intsnmp_get_errno(void){ return SNMPERR_SUCCESS;}/* * synch_reset and synch_setup are no longer used. */voidsnmp_synch_reset(netsnmp_session * notused){}voidsnmp_synch_setup(netsnmp_session * notused){}voidsnmp_set_dump_packet(int x){ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DUMP_PACKET, x);}intsnmp_get_dump_packet(void){ return netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DUMP_PACKET);}voidsnmp_set_quick_print(int x){ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT, x);}intsnmp_get_quick_print(void){ return netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT);}voidsnmp_set_suffix_only(int x){ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, x);}intsnmp_get_suffix_only(void){ return netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);}voidsnmp_set_full_objid(int x){ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, NETSNMP_OID_OUTPUT_FULL);}intsnmp_get_full_objid(void){ return (NETSNMP_OID_OUTPUT_FULL == netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT));}voidsnmp_set_random_access(int x){ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_RANDOM_ACCESS, x);}intsnmp_get_random_access(void){ return netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_RANDOM_ACCESS);}voidsnmp_set_mib_errors(int err){ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIB_ERRORS, err);}voidsnmp_set_mib_warnings(int warn){ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIB_WARNINGS, warn);}voidsnmp_set_save_descriptions(int save){ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_SAVE_MIB_DESCRS, save);}voidsnmp_set_mib_comment_term(int save){ /* * 0=strict, 1=EOL terminated */ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIB_COMMENT_TERM, save);}voidsnmp_set_mib_parse_label(int save){ /* * 0=strict, 1=underscore OK in label */ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIB_PARSE_LABEL, save);}intds_set_boolean (int storeid, int which, int value){ return netsnmp_ds_set_boolean(storeid, which, value);}intds_get_boolean (int storeid, int which){ return netsnmp_ds_get_boolean(storeid, which);}intds_toggle_boolean (int storeid, int which){ return netsnmp_ds_toggle_boolean(storeid, which);}intds_set_int (int storeid, int which, int value){ return netsnmp_ds_set_int(storeid, which, value);}intds_get_int (int storeid, int which){ return netsnmp_ds_get_int(storeid, which);}intds_set_string (int storeid, int which, const char *value){ return netsnmp_ds_set_string(storeid, which, value);}char *ds_get_string (int storeid, int which){ return netsnmp_ds_get_string(storeid, which);}intds_set_void (int storeid, int which, void *value){ return netsnmp_ds_set_void(storeid, which, value);}void *ds_get_void (int storeid, int which){ return netsnmp_ds_get_void(storeid, which);}intds_register_config (u_char type, const char *ftype, const char *token, int storeid, int which){ return netsnmp_ds_register_config(type, ftype, token, storeid, which);}intds_register_premib (u_char type, const char *ftype, const char *token, int storeid, int which){ return netsnmp_ds_register_premib(type, ftype, token, storeid, which);}voidds_shutdown (void){ netsnmp_ds_shutdown();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -