📄 default_store.xs
字号:
return 0;not_there: errno = ENOENT; return 0;}static doubleconstant_NETSNMP_DS_LIB_C(char *name, int len, int arg){ if (16 + 1 >= len ) { errno = EINVAL; return 0; } switch (name[16 + 1]) { case 'M': if (strEQ(name + 16, "OMMUNITY")) { /* NETSNMP_DS_LIB_C removed */#ifdef NETSNMP_DS_LIB_COMMUNITY return NETSNMP_DS_LIB_COMMUNITY;#else goto not_there;#endif } case 'N': if (!strnEQ(name + 16,"O", 1)) break; return constant_NETSNMP_DS_LIB_CON(name, len, arg); } errno = EINVAL; return 0;not_there: errno = ENOENT; return 0;}static doubleconstant_NETSNMP_DS_LIB_DO(char *name, int len, int arg){ if (17 + 3 >= len ) { errno = EINVAL; return 0; } switch (name[17 + 3]) { case 'B': if (strEQ(name + 17, "NT_BREAKDOWN_OIDS")) { /* NETSNMP_DS_LIB_DO removed */#ifdef NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS return NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS;#else goto not_there;#endif } case 'C': if (strEQ(name + 17, "NT_CHECK_RANGE")) { /* NETSNMP_DS_LIB_DO removed */#ifdef NETSNMP_DS_LIB_DONT_CHECK_RANGE return NETSNMP_DS_LIB_DONT_CHECK_RANGE;#else goto not_there;#endif } case 'R': if (strEQ(name + 17, "NT_READ_CONFIGS")) { /* NETSNMP_DS_LIB_DO removed */#ifdef NETSNMP_DS_LIB_DONT_READ_CONFIGS return NETSNMP_DS_LIB_DONT_READ_CONFIGS;#else goto not_there;#endif } } errno = EINVAL; return 0;not_there: errno = ENOENT; return 0;}static doubleconstant_NETSNMP_DS_LIB_D(char *name, int len, int arg){ switch (name[16 + 0]) { case 'E': if (strEQ(name + 16, "EFAULT_PORT")) { /* NETSNMP_DS_LIB_D removed */#ifdef NETSNMP_DS_LIB_DEFAULT_PORT return NETSNMP_DS_LIB_DEFAULT_PORT;#else goto not_there;#endif } case 'O': return constant_NETSNMP_DS_LIB_DO(name, len, arg); case 'U': if (strEQ(name + 16, "UMP_PACKET")) { /* NETSNMP_DS_LIB_D removed */#ifdef NETSNMP_DS_LIB_DUMP_PACKET return NETSNMP_DS_LIB_DUMP_PACKET;#else goto not_there;#endif } } errno = EINVAL; return 0;not_there: errno = ENOENT; return 0;}static doubleconstant_NETSNMP_DS_LIB_E(char *name, int len, int arg){ switch (name[16 + 0]) { case 'S': if (strEQ(name + 16, "SCAPE_QUOTES")) { /* NETSNMP_DS_LIB_E removed */#ifdef NETSNMP_DS_LIB_ESCAPE_QUOTES return NETSNMP_DS_LIB_ESCAPE_QUOTES;#else goto not_there;#endif } case 'X': if (strEQ(name + 16, "XTENDED_INDEX")) { /* NETSNMP_DS_LIB_E removed */#ifdef NETSNMP_DS_LIB_EXTENDED_INDEX return NETSNMP_DS_LIB_EXTENDED_INDEX;#else goto not_there;#endif } } errno = EINVAL; return 0;not_there: errno = ENOENT; return 0;}static doubleconstant_NETSNMP_DS_LIB_H(char *name, int len, int arg){ if (16 + 9 >= len ) { errno = EINVAL; return 0; } switch (name[16 + 9]) { case 'C': if (strEQ(name + 16, "AVE_READ_CONFIG")) { /* NETSNMP_DS_LIB_H removed */#ifdef NETSNMP_DS_LIB_HAVE_READ_CONFIG return NETSNMP_DS_LIB_HAVE_READ_CONFIG;#else goto not_there;#endif } case 'P': if (strEQ(name + 16, "AVE_READ_PREMIB_CONFIG")) { /* NETSNMP_DS_LIB_H removed */#ifdef NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG return NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG;#else goto not_there;#endif } } errno = EINVAL; return 0;not_there: errno = ENOENT; return 0;}static doubleconstant_NETSNMP_DS_LIB_MIB_(char *name, int len, int arg){ switch (name[19 + 0]) { case 'C': if (strEQ(name + 19, "COMMENT_TERM")) { /* NETSNMP_DS_LIB_MIB_ removed */#ifdef NETSNMP_DS_LIB_MIB_COMMENT_TERM return NETSNMP_DS_LIB_MIB_COMMENT_TERM;#else goto not_there;#endif } case 'E': if (strEQ(name + 19, "ERRORS")) { /* NETSNMP_DS_LIB_MIB_ removed */#ifdef NETSNMP_DS_LIB_MIB_ERRORS return NETSNMP_DS_LIB_MIB_ERRORS;#else goto not_there;#endif } case 'P': if (strEQ(name + 19, "PARSE_LABEL")) { /* NETSNMP_DS_LIB_MIB_ removed */#ifdef NETSNMP_DS_LIB_MIB_PARSE_LABEL return NETSNMP_DS_LIB_MIB_PARSE_LABEL;#else goto not_there;#endif } case 'R': if (strEQ(name + 19, "REPLACE")) { /* NETSNMP_DS_LIB_MIB_ removed */#ifdef NETSNMP_DS_LIB_MIB_REPLACE return NETSNMP_DS_LIB_MIB_REPLACE;#else goto not_there;#endif } case 'W': if (strEQ(name + 19, "WARNINGS")) { /* NETSNMP_DS_LIB_MIB_ removed */#ifdef NETSNMP_DS_LIB_MIB_WARNINGS return NETSNMP_DS_LIB_MIB_WARNINGS;#else goto not_there;#endif } } errno = EINVAL; return 0;not_there: errno = ENOENT; return 0;}static doubleconstant_NETSNMP_DS_LIB_M(char *name, int len, int arg){ if (16 + 2 >= len ) { errno = EINVAL; return 0; } switch (name[16 + 2]) { case 'D': if (strEQ(name + 16, "IBDIRS")) { /* NETSNMP_DS_LIB_M removed */#ifdef NETSNMP_DS_LIB_MIBDIRS return NETSNMP_DS_LIB_MIBDIRS;#else goto not_there;#endif } case '_': if (!strnEQ(name + 16,"IB", 2)) break; return constant_NETSNMP_DS_LIB_MIB_(name, len, arg); } errno = EINVAL; return 0;not_there: errno = ENOENT; return 0;}static doubleconstant_NETSNMP_DS_LIB_(char *name, int len, int arg){ switch (name[15 + 0]) { case 'A': return constant_NETSNMP_DS_LIB_A(name, len, arg); case 'C': return constant_NETSNMP_DS_LIB_C(name, len, arg); case 'D': return constant_NETSNMP_DS_LIB_D(name, len, arg); case 'E': return constant_NETSNMP_DS_LIB_E(name, len, arg); case 'H': return constant_NETSNMP_DS_LIB_H(name, len, arg); case 'L': if (strEQ(name + 15, "LOG_TIMESTAMP")) { /* NETSNMP_DS_LIB_ removed */#ifdef NETSNMP_DS_LIB_LOG_TIMESTAMP return NETSNMP_DS_LIB_LOG_TIMESTAMP;#else goto not_there;#endif } case 'M': return constant_NETSNMP_DS_LIB_M(name, len, arg); case 'N': return constant_NETSNMP_DS_LIB_N(name, len, arg); case 'O': return constant_NETSNMP_DS_LIB_O(name, len, arg); case 'P': return constant_NETSNMP_DS_LIB_P(name, len, arg); case 'Q': return constant_NETSNMP_DS_LIB_Q(name, len, arg); case 'R': return constant_NETSNMP_DS_LIB_R(name, len, arg); case 'S': return constant_NETSNMP_DS_LIB_S(name, len, arg); } errno = EINVAL; return 0;not_there: errno = ENOENT; return 0;}static doubleconstant_NETSNMP_DS_L(char *name, int len, int arg){ if (12 + 2 >= len ) { errno = EINVAL; return 0; } switch (name[12 + 2]) { case 'R': if (strEQ(name + 12, "IBRARY_ID")) { /* NETSNMP_DS_L removed */#ifdef NETSNMP_DS_LIBRARY_ID return NETSNMP_DS_LIBRARY_ID;#else goto not_there;#endif } case '_': if (!strnEQ(name + 12,"IB", 2)) break; return constant_NETSNMP_DS_LIB_(name, len, arg); } errno = EINVAL; return 0;not_there: errno = ENOENT; return 0;}static doubleconstant_NETSNMP_DS_M(char *name, int len, int arg){ if (12 + 3 >= len ) { errno = EINVAL; return 0; } switch (name[12 + 3]) { case 'I': if (strEQ(name + 12, "AX_IDS")) { /* NETSNMP_DS_M removed */#ifdef NETSNMP_DS_MAX_IDS return NETSNMP_DS_MAX_IDS;#else goto not_there;#endif } case 'S': if (strEQ(name + 12, "AX_SUBIDS")) { /* NETSNMP_DS_M removed */#ifdef NETSNMP_DS_MAX_SUBIDS return NETSNMP_DS_MAX_SUBIDS;#else goto not_there;#endif } } errno = EINVAL; return 0;not_there: errno = ENOENT; return 0;}static doubleconstant(char *name, int len, int arg){ errno = 0; if (0 + 11 >= len ) { errno = EINVAL; return 0; } switch (name[0 + 11]) { case 'A': if (strEQ(name + 0, "NETSNMP_DS_APPLICATION_ID")) { /* removed */#ifdef NETSNMP_DS_APPLICATION_ID return NETSNMP_DS_APPLICATION_ID;#else goto not_there;#endif } case 'L': if (!strnEQ(name + 0,"NETSNMP_DS_", 11)) break; return constant_NETSNMP_DS_L(name, len, arg); case 'M': if (!strnEQ(name + 0,"NETSNMP_DS_", 11)) break; return constant_NETSNMP_DS_M(name, len, arg); case 'S': if (!strnEQ(name + 0,"NETSNMP_DS_", 11)) break; return constant_NETSNMP_DS_S(name, len, arg); case 'T': if (strEQ(name + 0, "NETSNMP_DS_TOKEN_ID")) { /* removed */#ifdef NETSNMP_DS_TOKEN_ID return NETSNMP_DS_TOKEN_ID;#else goto not_there;#endif } } errno = EINVAL; return 0;not_there: errno = ENOENT; return 0;}MODULE = NetSNMP::default_store PACKAGE = NetSNMP::default_store doubleconstant(sv,arg) PREINIT: STRLEN len; INPUT: SV * sv char * s = SvPV(sv, len); int arg CODE: RETVAL = constant(s,len,arg); OUTPUT: RETVALintnetsnmp_ds_get_boolean(storeid, which) int storeid int whichintnetsnmp_ds_get_int(storeid, which) int storeid int whichchar *netsnmp_ds_get_string(storeid, which) int storeid int whichvoid *netsnmp_ds_get_void(storeid, which) int storeid int whichintnetsnmp_ds_register_config(type, ftype, token, storeid, which) unsigned char type const char * ftype const char * token int storeid int whichintnetsnmp_ds_register_premib(type, ftype, token, storeid, which) unsigned char type const char * ftype const char * token int storeid int whichintnetsnmp_ds_set_boolean(storeid, which, value) int storeid int which int valueintnetsnmp_ds_set_int(storeid, which, value) int storeid int which int valueintnetsnmp_ds_set_string(storeid, which, value) int storeid int which const char * valueintnetsnmp_ds_set_void(storeid, which, value) int storeid int which void * valuevoidnetsnmp_ds_shutdown()intnetsnmp_ds_toggle_boolean(storeid, which) int storeid int which
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -