netsnmp_ds_get_boolean:
  242|  2.31k|{
  243|  2.31k|    if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS || 
  ------------------
  |  |   38|  4.62k|#define NETSNMP_DS_MAX_IDS 3
  ------------------
  |  Branch (243:9): [True: 0, False: 2.31k]
  |  Branch (243:24): [True: 0, False: 2.31k]
  ------------------
  244|  2.31k|	which   < 0 || which   >= NETSNMP_DS_MAX_SUBIDS) {
  ------------------
  |  |   39|  2.31k|#define NETSNMP_DS_MAX_SUBIDS 48        /* needs to be a multiple of 8 */
  ------------------
  |  Branch (244:2): [True: 0, False: 2.31k]
  |  Branch (244:17): [True: 0, False: 2.31k]
  ------------------
  245|      0|        return SNMPERR_GENERR;
  ------------------
  |  |  216|      0|#define SNMPERR_GENERR			(-1)
  ------------------
  246|      0|    }
  247|       |
  248|  2.31k|    return (netsnmp_ds_booleans[storeid][which/8] & (1 << (which % 8))) ? 1:0;
  ------------------
  |  Branch (248:12): [True: 0, False: 2.31k]
  ------------------
  249|  2.31k|}
netsnmp_ds_get_int:
  268|     12|{
  269|     12|    if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS || 
  ------------------
  |  |   38|     24|#define NETSNMP_DS_MAX_IDS 3
  ------------------
  |  Branch (269:9): [True: 0, False: 12]
  |  Branch (269:24): [True: 0, False: 12]
  ------------------
  270|     12|	which   < 0 || which   >= NETSNMP_DS_MAX_SUBIDS) {
  ------------------
  |  |   39|     12|#define NETSNMP_DS_MAX_SUBIDS 48        /* needs to be a multiple of 8 */
  ------------------
  |  Branch (270:2): [True: 0, False: 12]
  |  Branch (270:17): [True: 0, False: 12]
  ------------------
  271|      0|        return SNMPERR_GENERR;
  ------------------
  |  |  216|      0|#define SNMPERR_GENERR			(-1)
  ------------------
  272|      0|    }
  273|       |
  274|     12|    return netsnmp_ds_integers[storeid][which];
  275|     12|}
netsnmp_ds_set_string:
  279|      1|{
  280|      1|    if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS || 
  ------------------
  |  |   38|      2|#define NETSNMP_DS_MAX_IDS 3
  ------------------
  |  Branch (280:9): [True: 0, False: 1]
  |  Branch (280:24): [True: 0, False: 1]
  ------------------
  281|      1|	which   < 0 || which   >= NETSNMP_DS_MAX_SUBIDS) {
  ------------------
  |  |   39|      1|#define NETSNMP_DS_MAX_SUBIDS 48        /* needs to be a multiple of 8 */
  ------------------
  |  Branch (281:2): [True: 0, False: 1]
  |  Branch (281:17): [True: 0, False: 1]
  ------------------
  282|      0|        return SNMPERR_GENERR;
  ------------------
  |  |  216|      0|#define SNMPERR_GENERR			(-1)
  ------------------
  283|      0|    }
  284|       |
  285|      1|    DEBUGMSGTL(("netsnmp_ds_set_string", "Setting %s:%d = \"%s\"\n",
  ------------------
  |  |   68|      1|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|      1|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (166:52): [True: 0, False: 0]
  |  |  |  |  |  Branch (166:64): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
  286|      1|                stores[storeid], which, (value ? value : "(null)")));
  287|       |
  288|       |    /*
  289|       |     * is some silly person is calling us with our own pointer?
  290|       |     */
  291|      1|    if (netsnmp_ds_strings[storeid][which] == value)
  ------------------
  |  Branch (291:9): [True: 0, False: 1]
  ------------------
  292|      0|        return SNMPERR_SUCCESS;
  ------------------
  |  |  215|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  ------------------
  293|       |
  294|      1|    snmp_res_lock(MT_LIBRARY_ID, MT_LIB_SESSION);
  ------------------
  |  |   79|      1|#define snmp_res_lock(x,y) do {} while (0)
  |  |  ------------------
  |  |  |  Branch (79:41): [Folded - Ignored]
  |  |  ------------------
  ------------------
  295|      1|    if (netsnmp_ds_strings[storeid][which] != NULL) {
  ------------------
  |  Branch (295:9): [True: 0, False: 1]
  ------------------
  296|      0|        free(netsnmp_ds_strings[storeid][which]);
  297|      0|	netsnmp_ds_strings[storeid][which] = NULL;
  298|      0|    }
  299|      1|    snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSION);
  ------------------
  |  |   80|      1|#define snmp_res_unlock(x,y) do {} while (0)
  |  |  ------------------
  |  |  |  Branch (80:43): [Folded - Ignored]
  |  |  ------------------
  ------------------
  300|       |
  301|      1|    if (value) {
  ------------------
  |  Branch (301:9): [True: 1, False: 0]
  ------------------
  302|      1|        netsnmp_ds_strings[storeid][which] = strdup(value);
  303|      1|    } else {
  304|      0|        netsnmp_ds_strings[storeid][which] = NULL;
  305|      0|    }
  306|       |
  307|      1|    return SNMPERR_SUCCESS;
  ------------------
  |  |  215|      1|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  ------------------
  308|      1|}
netsnmp_ds_get_string:
  312|  1.13k|{
  313|  1.13k|    if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS || 
  ------------------
  |  |   38|  2.27k|#define NETSNMP_DS_MAX_IDS 3
  ------------------
  |  Branch (313:9): [True: 0, False: 1.13k]
  |  Branch (313:24): [True: 0, False: 1.13k]
  ------------------
  314|  1.13k|	which   < 0 || which   >= NETSNMP_DS_MAX_SUBIDS) {
  ------------------
  |  |   39|  1.13k|#define NETSNMP_DS_MAX_SUBIDS 48        /* needs to be a multiple of 8 */
  ------------------
  |  Branch (314:2): [True: 0, False: 1.13k]
  |  Branch (314:17): [True: 0, False: 1.13k]
  ------------------
  315|      0|        return NULL;
  316|      0|    }
  317|       |
  318|  1.13k|    return netsnmp_ds_strings[storeid][which];
  319|  1.13k|}

get_tree_head:
 2129|     11|{
 2130|     11|    return (tree_head);
 2131|     11|}
netsnmp_set_mib_directory:
 2518|      1|{
 2519|      1|    const char *newdir;
 2520|      1|    char *olddir, *tmpdir = NULL;
 2521|       |
 2522|      1|    DEBUGTRACE;
  ------------------
  |  |   65|      1|#define DEBUGTRACE         do {if (_DBG_IF_) {__DBGTRACE;} }while(0)
  |  |  ------------------
  |  |  |  |  146|      1|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGTRACE         do {if (_DBG_IF_) {__DBGTRACE;} }while(0)
  |  |  ------------------
  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (65:67): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2523|      1|    if (NULL == dir) {
  ------------------
  |  Branch (2523:9): [True: 0, False: 1]
  ------------------
 2524|      0|        return;
 2525|      0|    }
 2526|       |    
 2527|      1|    olddir = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
  ------------------
  |  |   48|      1|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
 2528|      1|				   NETSNMP_DS_LIB_MIBDIRS);
  ------------------
  |  |  161|      1|#define NETSNMP_DS_LIB_MIBDIRS           11
  ------------------
 2529|      1|    if (olddir) {
  ------------------
  |  Branch (2529:9): [True: 0, False: 1]
  ------------------
 2530|      0|        if ((*dir == '+') || (*dir == '-')) {
  ------------------
  |  Branch (2530:13): [True: 0, False: 0]
  |  Branch (2530:30): [True: 0, False: 0]
  ------------------
 2531|       |            /** New dir starts with '+', thus we add it. */
 2532|      0|            tmpdir = (char *)malloc(strlen(dir) + strlen(olddir) + 2);
 2533|      0|            if (!tmpdir) {
  ------------------
  |  Branch (2533:17): [True: 0, False: 0]
  ------------------
 2534|      0|                DEBUGMSGTL(("read_config:initmib", "set mibdir malloc failed"));
  ------------------
  |  |   68|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2535|      0|                return;
 2536|      0|            }
 2537|      0|            if (*dir++ == '+')
  ------------------
  |  Branch (2537:17): [True: 0, False: 0]
  ------------------
 2538|      0|                sprintf(tmpdir, "%s%c%s", olddir, ENV_SEPARATOR_CHAR, dir);
  ------------------
  |  |   70|      0|#define ENV_SEPARATOR_CHAR ':'
  ------------------
 2539|      0|            else
 2540|      0|                sprintf(tmpdir, "%s%c%s", dir, ENV_SEPARATOR_CHAR, olddir);
  ------------------
  |  |   70|      0|#define ENV_SEPARATOR_CHAR ':'
  ------------------
 2541|      0|            newdir = tmpdir;
 2542|      0|        } else {
 2543|      0|            newdir = dir;
 2544|      0|        }
 2545|      1|    } else {
 2546|       |        /** If dir starts with '+' skip '+' it. */
 2547|      1|        newdir = ((*dir == '+') ? ++dir : dir);
  ------------------
  |  Branch (2547:19): [True: 0, False: 1]
  ------------------
 2548|      1|    }
 2549|      1|    netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIBDIRS,
  ------------------
  |  |   48|      1|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
                  netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIBDIRS,
  ------------------
  |  |  161|      1|#define NETSNMP_DS_LIB_MIBDIRS           11
  ------------------
 2550|      1|                          newdir);
 2551|       |
 2552|       |    /** set_string calls strdup, so if we allocated memory, free it */
 2553|      1|    if (tmpdir == newdir) {
  ------------------
  |  Branch (2553:9): [True: 0, False: 1]
  ------------------
 2554|      0|        SNMP_FREE(tmpdir);
  ------------------
  |  |   62|      0|#define SNMP_FREE(s)    do { if (s) { free(s); s=NULL; } } while(0)
  |  |  ------------------
  |  |  |  Branch (62:34): [True: 0, False: 0]
  |  |  |  Branch (62:66): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2555|      0|    }
 2556|      1|}
netsnmp_get_mib_directory:
 2573|      1|{
 2574|      1|    char *dir;
 2575|       |
 2576|      1|    DEBUGTRACE;
  ------------------
  |  |   65|      1|#define DEBUGTRACE         do {if (_DBG_IF_) {__DBGTRACE;} }while(0)
  |  |  ------------------
  |  |  |  |  146|      1|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGTRACE         do {if (_DBG_IF_) {__DBGTRACE;} }while(0)
  |  |  ------------------
  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (65:67): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2577|      1|    dir = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIBDIRS);
  ------------------
  |  |   48|      1|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
                  dir = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIBDIRS);
  ------------------
  |  |  161|      1|#define NETSNMP_DS_LIB_MIBDIRS           11
  ------------------
 2578|      1|    if (dir == NULL) {
  ------------------
  |  Branch (2578:9): [True: 1, False: 0]
  ------------------
 2579|      1|        DEBUGMSGTL(("get_mib_directory", "no mib directories set\n"));
  ------------------
  |  |   68|      1|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|      1|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2580|       |
 2581|       |        /** Check if the environment variable is set */
 2582|      1|        dir = netsnmp_getenv("MIBDIRS");
 2583|      1|        if (dir == NULL) {
  ------------------
  |  Branch (2583:13): [True: 1, False: 0]
  ------------------
 2584|      1|            DEBUGMSGTL(("get_mib_directory", "no mib directories set by environment\n"));
  ------------------
  |  |   68|      1|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|      1|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2585|       |            /** Not set use hard coded path */
 2586|      1|            if (confmibdir == NULL) {
  ------------------
  |  Branch (2586:17): [True: 1, False: 0]
  ------------------
 2587|      1|                DEBUGMSGTL(("get_mib_directory", "no mib directories set by config\n"));
  ------------------
  |  |   68|      1|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|      1|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2588|      1|                netsnmp_set_mib_directory(NETSNMP_DEFAULT_MIBDIRS);
  ------------------
  |  | 1614|      1|#define NETSNMP_DEFAULT_MIBDIRS "$HOME/.snmp/mibs:/usr/local/net-snmp-master/share/snmp/mibs"
  ------------------
 2589|      1|            }
 2590|      0|            else if ((*confmibdir == '+') || (*confmibdir == '-')) {
  ------------------
  |  Branch (2590:22): [True: 0, False: 0]
  |  Branch (2590:46): [True: 0, False: 0]
  ------------------
 2591|      0|                DEBUGMSGTL(("get_mib_directory", "mib directories set by config (but added)\n"));
  ------------------
  |  |   68|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2592|      0|                netsnmp_set_mib_directory(NETSNMP_DEFAULT_MIBDIRS);
  ------------------
  |  | 1614|      0|#define NETSNMP_DEFAULT_MIBDIRS "$HOME/.snmp/mibs:/usr/local/net-snmp-master/share/snmp/mibs"
  ------------------
 2593|      0|                netsnmp_set_mib_directory(confmibdir);
 2594|      0|            }
 2595|      0|            else {
 2596|      0|                DEBUGMSGTL(("get_mib_directory", "mib directories set by config\n"));
  ------------------
  |  |   68|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2597|      0|                netsnmp_set_mib_directory(confmibdir);
 2598|      0|            }
 2599|      1|        } else if ((*dir == '+') || (*dir == '-')) {
  ------------------
  |  Branch (2599:20): [True: 0, False: 0]
  |  Branch (2599:37): [True: 0, False: 0]
  ------------------
 2600|      0|            DEBUGMSGTL(("get_mib_directory", "mib directories set by environment (but added)\n"));
  ------------------
  |  |   68|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2601|      0|            netsnmp_set_mib_directory(NETSNMP_DEFAULT_MIBDIRS);
  ------------------
  |  | 1614|      0|#define NETSNMP_DEFAULT_MIBDIRS "$HOME/.snmp/mibs:/usr/local/net-snmp-master/share/snmp/mibs"
  ------------------
 2602|      0|            netsnmp_set_mib_directory(dir);
 2603|      0|        } else {
 2604|      0|            DEBUGMSGTL(("get_mib_directory", "mib directories set by environment\n"));
  ------------------
  |  |   68|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2605|      0|            netsnmp_set_mib_directory(dir);
 2606|      0|        }
 2607|      1|        dir = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIBDIRS);
  ------------------
  |  |   48|      1|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
                      dir = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIBDIRS);
  ------------------
  |  |  161|      1|#define NETSNMP_DS_LIB_MIBDIRS           11
  ------------------
 2608|      1|    }
 2609|      1|    DEBUGMSGTL(("get_mib_directory", "mib directories set '%s'\n", dir));
  ------------------
  |  |   68|      1|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|      1|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2610|      1|    return(dir);
 2611|      1|}
set_function:
 2906|      3|{
 2907|      3|    subtree->printer = NULL;
 2908|      3|    switch (subtree->type) {
 2909|      0|    case TYPE_OBJID:
  ------------------
  |  |  154|      0|#define TYPE_OBJID          1
  ------------------
  |  Branch (2909:5): [True: 0, False: 3]
  ------------------
 2910|      0|        subtree->printomat = sprint_realloc_object_identifier;
 2911|      0|        break;
 2912|      0|    case TYPE_OCTETSTR:
  ------------------
  |  |  155|      0|#define TYPE_OCTETSTR       2
  ------------------
  |  Branch (2912:5): [True: 0, False: 3]
  ------------------
 2913|      0|        subtree->printomat = sprint_realloc_octet_string;
 2914|      0|        break;
 2915|      0|    case TYPE_INTEGER:
  ------------------
  |  |  156|      0|#define TYPE_INTEGER        3
  ------------------
  |  Branch (2915:5): [True: 0, False: 3]
  ------------------
 2916|      0|        subtree->printomat = sprint_realloc_integer;
 2917|      0|        break;
 2918|      0|    case TYPE_INTEGER32:
  ------------------
  |  |  169|      0|#define TYPE_INTEGER32      16
  ------------------
  |  Branch (2918:5): [True: 0, False: 3]
  ------------------
 2919|      0|        subtree->printomat = sprint_realloc_integer;
 2920|      0|        break;
 2921|      0|    case TYPE_NETADDR:
  ------------------
  |  |  157|      0|#define TYPE_NETADDR        4
  ------------------
  |  Branch (2921:5): [True: 0, False: 3]
  ------------------
 2922|      0|        subtree->printomat = sprint_realloc_networkaddress;
 2923|      0|        break;
 2924|      0|    case TYPE_IPADDR:
  ------------------
  |  |  158|      0|#define TYPE_IPADDR         5
  ------------------
  |  Branch (2924:5): [True: 0, False: 3]
  ------------------
 2925|      0|        subtree->printomat = sprint_realloc_ipaddress;
 2926|      0|        break;
 2927|      0|    case TYPE_COUNTER:
  ------------------
  |  |  159|      0|#define TYPE_COUNTER        6
  ------------------
  |  Branch (2927:5): [True: 0, False: 3]
  ------------------
 2928|      0|        subtree->printomat = sprint_realloc_counter;
 2929|      0|        break;
 2930|      0|    case TYPE_GAUGE:
  ------------------
  |  |  160|      0|#define TYPE_GAUGE          7
  ------------------
  |  Branch (2930:5): [True: 0, False: 3]
  ------------------
 2931|      0|        subtree->printomat = sprint_realloc_gauge;
 2932|      0|        break;
 2933|      0|    case TYPE_TIMETICKS:
  ------------------
  |  |  161|      0|#define TYPE_TIMETICKS      8
  ------------------
  |  Branch (2933:5): [True: 0, False: 3]
  ------------------
 2934|      0|        subtree->printomat = sprint_realloc_timeticks;
 2935|      0|        break;
 2936|      0|    case TYPE_OPAQUE:
  ------------------
  |  |  162|      0|#define TYPE_OPAQUE         9
  ------------------
  |  Branch (2936:5): [True: 0, False: 3]
  ------------------
 2937|      0|        subtree->printomat = sprint_realloc_opaque;
 2938|      0|        break;
 2939|      0|    case TYPE_NULL:
  ------------------
  |  |  163|      0|#define TYPE_NULL           10
  ------------------
  |  Branch (2939:5): [True: 0, False: 3]
  ------------------
 2940|      0|        subtree->printomat = sprint_realloc_null;
 2941|      0|        break;
 2942|      0|    case TYPE_BITSTRING:
  ------------------
  |  |  165|      0|#define TYPE_BITSTRING      12
  ------------------
  |  Branch (2942:5): [True: 0, False: 3]
  ------------------
 2943|      0|        subtree->printomat = sprint_realloc_bitstring;
 2944|      0|        break;
 2945|      0|    case TYPE_NSAPADDRESS:
  ------------------
  |  |  166|      0|#define TYPE_NSAPADDRESS    13
  ------------------
  |  Branch (2945:5): [True: 0, False: 3]
  ------------------
 2946|      0|        subtree->printomat = sprint_realloc_nsapaddress;
 2947|      0|        break;
 2948|      0|    case TYPE_COUNTER64:
  ------------------
  |  |  164|      0|#define TYPE_COUNTER64      11
  ------------------
  |  Branch (2948:5): [True: 0, False: 3]
  ------------------
 2949|      0|        subtree->printomat = sprint_realloc_counter64;
 2950|      0|        break;
 2951|      0|    case TYPE_UINTEGER:
  ------------------
  |  |  167|      0|#define TYPE_UINTEGER       14
  ------------------
  |  Branch (2951:5): [True: 0, False: 3]
  ------------------
 2952|      0|        subtree->printomat = sprint_realloc_uinteger;
 2953|      0|        break;
 2954|      0|    case TYPE_UNSIGNED32:
  ------------------
  |  |  168|      0|#define TYPE_UNSIGNED32     15
  ------------------
  |  Branch (2954:5): [True: 0, False: 3]
  ------------------
 2955|      0|        subtree->printomat = sprint_realloc_gauge;
 2956|      0|        break;
 2957|      3|    case TYPE_OTHER:
  ------------------
  |  |  153|      3|#define TYPE_OTHER          0
  ------------------
  |  Branch (2957:5): [True: 3, False: 0]
  ------------------
 2958|      3|    default:
  ------------------
  |  Branch (2958:5): [True: 0, False: 3]
  ------------------
 2959|      3|        subtree->printomat = sprint_realloc_by_type;
 2960|      3|        break;
 2961|      3|    }
 2962|      3|}
read_objid:
 2983|    404|{
 2984|    404|#ifndef NETSNMP_DISABLE_MIB_LOADING
 2985|    404|    struct tree    *root = tree_top;
 2986|    404|    char            buf[SPRINT_MAX_LEN];
 2987|    404|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 2988|    404|    int             ret, max_out_len;
 2989|    404|    char           *name, ch;
 2990|    404|    const char     *cp;
 2991|       |
 2992|    404|    cp = input;
 2993|  2.78k|    while ((ch = *cp)) {
  ------------------
  |  Branch (2993:12): [True: 2.69k, False: 87]
  ------------------
 2994|  2.69k|        if (('0' <= ch && ch <= '9')
  ------------------
  |  Branch (2994:14): [True: 2.05k, False: 635]
  |  Branch (2994:27): [True: 501, False: 1.55k]
  ------------------
 2995|  2.69k|            || ('a' <= ch && ch <= 'z')
  ------------------
  |  Branch (2995:17): [True: 1.17k, False: 1.01k]
  |  Branch (2995:30): [True: 1.16k, False: 12]
  ------------------
 2996|  2.69k|            || ('A' <= ch && ch <= 'Z')
  ------------------
  |  Branch (2996:17): [True: 384, False: 641]
  |  Branch (2996:30): [True: 363, False: 21]
  ------------------
 2997|  2.69k|            || ch == '-')
  ------------------
  |  Branch (2997:16): [True: 345, False: 317]
  ------------------
 2998|  2.37k|            cp++;
 2999|    317|        else
 3000|    317|            break;
 3001|  2.69k|    }
 3002|    404|#ifndef NETSNMP_DISABLE_MIB_LOADING
 3003|    404|    if (ch == ':')
  ------------------
  |  Branch (3003:9): [True: 0, False: 404]
  ------------------
 3004|      0|        return get_node(input, output, out_len);
 3005|    404|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 3006|       |
 3007|    404|    if (*input == '.')
  ------------------
  |  Branch (3007:9): [True: 7, False: 397]
  ------------------
 3008|      7|        input++;
 3009|    397|#ifndef NETSNMP_DISABLE_MIB_LOADING
 3010|    397|    else if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_READ_UCD_STYLE_OID)) {
  ------------------
  |  |   48|    397|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
                  else if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_READ_UCD_STYLE_OID)) {
  ------------------
  |  |   85|    397|#define NETSNMP_DS_LIB_READ_UCD_STYLE_OID  25   /* require top-level OIDs to be prefixed with a dot */
  ------------------
  |  Branch (3010:14): [True: 0, False: 397]
  ------------------
 3011|       |        /*
 3012|       |         * get past leading '.', append '.' to Prefix. 
 3013|       |         */
 3014|      0|        if (*Prefix == '.')
  ------------------
  |  Branch (3014:13): [True: 0, False: 0]
  ------------------
 3015|      0|            strlcpy(buf, Prefix + 1, sizeof(buf));
 3016|      0|        else
 3017|      0|            strlcpy(buf, Prefix, sizeof(buf));
 3018|      0|        strlcat(buf, ".", sizeof(buf));
 3019|      0|        strlcat(buf, input, sizeof(buf));
 3020|      0|        input = buf;
 3021|      0|    }
 3022|    404|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 3023|       |
 3024|    404|#ifndef NETSNMP_DISABLE_MIB_LOADING
 3025|    404|    if ((root == NULL) && (tree_head != NULL)) {
  ------------------
  |  Branch (3025:9): [True: 404, False: 0]
  |  Branch (3025:27): [True: 393, False: 11]
  ------------------
 3026|    393|        root = tree_head;
 3027|    393|    }
 3028|     11|    else if (root == NULL) {
  ------------------
  |  Branch (3028:14): [True: 11, False: 0]
  ------------------
 3029|     11|        SET_SNMP_ERROR(SNMPERR_NOMIB);
  ------------------
  |  |   56|     11|#define SET_SNMP_ERROR(x) snmp_errno=(x)
  ------------------
 3030|     11|        *out_len = 0;
 3031|     11|        return 0;
 3032|     11|    }
 3033|    393|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 3034|    393|    name = strdup(input);
 3035|    393|    max_out_len = *out_len;
 3036|    393|    *out_len = 0;
 3037|    393|#ifndef NETSNMP_DISABLE_MIB_LOADING
 3038|    393|    if ((ret =
  ------------------
  |  Branch (3038:9): [True: 309, False: 84]
  ------------------
 3039|    393|         _add_strings_to_oid(root, name, output, out_len,
 3040|    393|                             max_out_len)) <= 0)
 3041|       |#else
 3042|       |    if ((ret =
 3043|       |         _add_strings_to_oid(NULL, name, output, out_len,
 3044|       |                             max_out_len)) <= 0)
 3045|       |#endif /* NETSNMP_DISABLE_MIB_LOADING */
 3046|    309|    {
 3047|    309|        if (ret == 0)
  ------------------
  |  Branch (3047:13): [True: 309, False: 0]
  ------------------
 3048|    309|            ret = SNMPERR_UNKNOWN_OBJID;
  ------------------
  |  |  273|    309|#define SNMPERR_UNKNOWN_OBJID		(-58)
  ------------------
 3049|    309|        SET_SNMP_ERROR(ret);
  ------------------
  |  |   56|    309|#define SET_SNMP_ERROR(x) snmp_errno=(x)
  ------------------
 3050|    309|        SNMP_FREE(name);
  ------------------
  |  |   62|    309|#define SNMP_FREE(s)    do { if (s) { free(s); s=NULL; } } while(0)
  |  |  ------------------
  |  |  |  Branch (62:34): [True: 309, False: 0]
  |  |  |  Branch (62:66): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3051|    309|        return 0;
 3052|    309|    }
 3053|     84|    SNMP_FREE(name);
  ------------------
  |  |   62|     84|#define SNMP_FREE(s)    do { if (s) { free(s); s=NULL; } } while(0)
  |  |  ------------------
  |  |  |  Branch (62:34): [True: 84, False: 0]
  |  |  |  Branch (62:66): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3054|       |
 3055|     84|    return 1;
 3056|    393|}
get_module_node:
 5152|    510|{
 5153|    510|    int             modid, rc = 0;
 5154|    510|    struct tree    *tp;
 5155|    510|    char           *name, *cp;
 5156|       |
 5157|    510|    if (!strcmp(module, "ANY"))
  ------------------
  |  Branch (5157:9): [True: 350, False: 160]
  ------------------
 5158|    350|        modid = -1;
 5159|    160|    else {
 5160|    160|        netsnmp_read_module(module);
 5161|    160|        modid = which_module(module);
 5162|    160|        if (modid == -1)
  ------------------
  |  Branch (5162:13): [True: 160, False: 0]
  ------------------
 5163|    160|            return 0;
 5164|    160|    }
 5165|       |
 5166|       |    /*
 5167|       |     * Isolate the first component of the name ... 
 5168|       |     */
 5169|    350|    name = strdup(fname);
 5170|    350|    cp = strchr(name, '.');
 5171|    350|    if (cp != NULL) {
  ------------------
  |  Branch (5171:9): [True: 57, False: 293]
  ------------------
 5172|     57|        *cp = '\0';
 5173|     57|        cp++;
 5174|     57|    }
 5175|       |    /*
 5176|       |     * ... and locate it in the tree. 
 5177|       |     */
 5178|    350|    tp = find_tree_node(name, modid);
 5179|    350|    if (tp) {
  ------------------
  |  Branch (5179:9): [True: 31, False: 319]
  ------------------
 5180|     31|        size_t          maxlen = *objidlen;
 5181|       |
 5182|       |        /*
 5183|       |         * Set the first element of the object ID 
 5184|       |         */
 5185|     31|        if (node_to_oid(tp, objid, objidlen)) {
  ------------------
  |  Branch (5185:13): [True: 31, False: 0]
  ------------------
 5186|     31|            rc = 1;
 5187|       |
 5188|       |            /*
 5189|       |             * If the name requested was more than one element,
 5190|       |             * tag on the rest of the components 
 5191|       |             */
 5192|     31|            if (cp != NULL)
  ------------------
  |  Branch (5192:17): [True: 2, False: 29]
  ------------------
 5193|      2|                rc = _add_strings_to_oid(tp, cp, objid, objidlen, maxlen);
 5194|     31|        }
 5195|     31|    }
 5196|       |
 5197|    350|    SNMP_FREE(name);
  ------------------
  |  |   62|    350|#define SNMP_FREE(s)    do { if (s) { free(s); s=NULL; } } while(0)
  |  |  ------------------
  |  |  |  Branch (62:34): [True: 350, False: 0]
  |  |  |  Branch (62:66): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5198|    350|    return (rc);
 5199|    510|}
get_wild_node:
 5692|    319|{
 5693|    319|    struct tree    *tp = find_best_tree_node(name, tree_head, NULL);
 5694|    319|    if (!tp)
  ------------------
  |  Branch (5694:9): [True: 292, False: 27]
  ------------------
 5695|    292|        return 0;
 5696|     27|    return get_node(tp->label, objid, objidlen);
 5697|    319|}
get_node:
 5701|    510|{
 5702|    510|    const char     *cp;
 5703|    510|    char            ch;
 5704|    510|    int             res;
 5705|       |
 5706|    510|    cp = name;
 5707|  4.85k|    while ((ch = *cp))
  ------------------
  |  Branch (5707:12): [True: 4.75k, False: 105]
  ------------------
 5708|  4.75k|        if (('0' <= ch && ch <= '9')
  ------------------
  |  Branch (5708:14): [True: 4.03k, False: 714]
  |  Branch (5708:27): [True: 1.00k, False: 3.02k]
  ------------------
 5709|  4.75k|            || ('a' <= ch && ch <= 'z')
  ------------------
  |  Branch (5709:17): [True: 1.66k, False: 2.08k]
  |  Branch (5709:30): [True: 1.64k, False: 12]
  ------------------
 5710|  4.75k|            || ('A' <= ch && ch <= 'Z')
  ------------------
  |  Branch (5710:17): [True: 1.21k, False: 881]
  |  Branch (5710:30): [True: 1.19k, False: 21]
  ------------------
 5711|  4.75k|            || ch == '-')
  ------------------
  |  Branch (5711:16): [True: 497, False: 405]
  ------------------
 5712|  4.34k|            cp++;
 5713|    405|        else
 5714|    405|            break;
 5715|    510|    if (ch != ':')
  ------------------
  |  Branch (5715:9): [True: 349, False: 161]
  ------------------
 5716|    349|        if (*name == '.')
  ------------------
  |  Branch (5716:13): [True: 4, False: 345]
  ------------------
 5717|      4|            res = get_module_node(name + 1, "ANY", objid, objidlen);
 5718|    345|        else
 5719|    345|            res = get_module_node(name, "ANY", objid, objidlen);
 5720|    161|    else {
 5721|    161|        char           *module;
 5722|       |        /*
 5723|       |         *  requested name is of the form
 5724|       |         *      "module:subidentifier"
 5725|       |         */
 5726|    161|        module = (char *) malloc((size_t) (cp - name + 1));
 5727|    161|        if (!module)
  ------------------
  |  Branch (5727:13): [True: 0, False: 161]
  ------------------
 5728|      0|            return SNMPERR_GENERR;
  ------------------
  |  |  216|      0|#define SNMPERR_GENERR			(-1)
  ------------------
 5729|    161|        sprintf(module, "%.*s", (int) (cp - name), name);
 5730|    161|        cp++;                   /* cp now point to the subidentifier */
 5731|    161|        if (*cp == ':')
  ------------------
  |  Branch (5731:13): [True: 1, False: 160]
  ------------------
 5732|      1|            cp++;
 5733|       |
 5734|       |        /*
 5735|       |         * 'cp' and 'name' *do* go that way round! 
 5736|       |         */
 5737|    161|        res = get_module_node(cp, module, objid, objidlen);
 5738|    161|        SNMP_FREE(module);
  ------------------
  |  |   62|    161|#define SNMP_FREE(s)    do { if (s) { free(s); s=NULL; } } while(0)
  |  |  ------------------
  |  |  |  Branch (62:34): [True: 161, False: 0]
  |  |  |  Branch (62:66): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5739|    161|    }
 5740|    510|    if (res == 0) {
  ------------------
  |  Branch (5740:9): [True: 481, False: 29]
  ------------------
 5741|    481|        SET_SNMP_ERROR(SNMPERR_UNKNOWN_OBJID);
  ------------------
  |  |   56|    481|#define SET_SNMP_ERROR(x) snmp_errno=(x)
  ------------------
 5742|    481|    }
 5743|       |
 5744|    510|    return res;
 5745|    510|}
clear_tree_flags:
 5782|    319|{
 5783|  1.24k|    for (; tp; tp = tp->next_peer) {
  ------------------
  |  Branch (5783:12): [True: 924, False: 319]
  ------------------
 5784|    924|        tp->reported = 0;
 5785|    924|        if (tp->child_list)
  ------------------
  |  Branch (5785:13): [True: 0, False: 924]
  ------------------
 5786|      0|            clear_tree_flags(tp->child_list);
 5787|    924|     /*RECURSE*/}
 5788|    319|}
snmp_parse_oid:
 6041|    567|{
 6042|    567|#ifndef NETSNMP_DISABLE_MIB_LOADING
 6043|    567|    size_t          savlen = *rootlen;
 6044|    567|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 6045|    567|    char           *tmpbuf = NULL;
 6046|    567|    const char     *suffix, *prefix;
 6047|       |
 6048|    567|    suffix = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
  ------------------
  |  |   48|    567|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
 6049|    567|                                   NETSNMP_DS_LIB_OIDSUFFIX);
  ------------------
  |  |  162|    567|#define NETSNMP_DS_LIB_OIDSUFFIX         12
  ------------------
 6050|    567|    prefix = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
  ------------------
  |  |   48|    567|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
 6051|    567|                                   NETSNMP_DS_LIB_OIDPREFIX);
  ------------------
  |  |  163|    567|#define NETSNMP_DS_LIB_OIDPREFIX         13
  ------------------
 6052|    567|    if ((suffix && suffix[0]) || (prefix && prefix[0])) {
  ------------------
  |  Branch (6052:10): [True: 0, False: 567]
  |  Branch (6052:20): [True: 0, False: 0]
  |  Branch (6052:35): [True: 0, False: 567]
  |  Branch (6052:45): [True: 0, False: 0]
  ------------------
 6053|      0|        if (!suffix)
  ------------------
  |  Branch (6053:13): [True: 0, False: 0]
  ------------------
 6054|      0|            suffix = "";
 6055|      0|        if (!prefix)
  ------------------
  |  Branch (6055:13): [True: 0, False: 0]
  ------------------
 6056|      0|            prefix = "";
 6057|      0|        if (asprintf(&tmpbuf, "%s%s%s%s", prefix, argv,
  ------------------
  |  Branch (6057:13): [True: 0, False: 0]
  ------------------
 6058|      0|                     suffix[0] == '.' || suffix[0] == '\0' ? "" : ".",
  ------------------
  |  Branch (6058:22): [True: 0, False: 0]
  |  Branch (6058:42): [True: 0, False: 0]
  ------------------
 6059|      0|                     suffix) < 0) {
 6060|      0|            DEBUGMSGTL(("snmp_parse_oid", "Out of memory\n"));
  ------------------
  |  |   68|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6061|      0|            return NULL;
 6062|      0|        }
 6063|      0|        argv = tmpbuf;
 6064|      0|        DEBUGMSGTL(("snmp_parse_oid","Parsing: %s\n",argv));
  ------------------
  |  |   68|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6065|      0|    }
 6066|       |
 6067|    567|#ifndef NETSNMP_DISABLE_MIB_LOADING
 6068|    567|    if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
  ------------------
  |  |   48|    567|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
  |  Branch (6068:9): [True: 0, False: 567]
  ------------------
 6069|    567|                               NETSNMP_DS_LIB_RANDOM_ACCESS)
  ------------------
  |  |   74|    567|#define NETSNMP_DS_LIB_RANDOM_ACCESS	   14   /* random access to oid labels */
  ------------------
 6070|    567|        || strchr(argv, ':')) {
  ------------------
  |  Branch (6070:12): [True: 163, False: 404]
  ------------------
 6071|    163|        if (get_node(argv, root, rootlen))
  ------------------
  |  Branch (6071:13): [True: 1, False: 162]
  ------------------
 6072|      1|            goto out;
 6073|    404|    } else if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
  ------------------
  |  |   48|    404|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
  |  Branch (6073:16): [True: 0, False: 404]
  ------------------
 6074|    404|                                      NETSNMP_DS_LIB_REGEX_ACCESS)) {
  ------------------
  |  |   75|    404|#define NETSNMP_DS_LIB_REGEX_ACCESS	   15   /* regex matching to oid labels */
  ------------------
 6075|      0|	clear_tree_flags(tree_head);
 6076|      0|        if (get_wild_node(argv, root, rootlen))
  ------------------
  |  Branch (6076:13): [True: 0, False: 0]
  ------------------
 6077|      0|            goto out;
 6078|    404|    } else {
 6079|    404|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 6080|    404|        if (read_objid(argv, root, rootlen))
  ------------------
  |  Branch (6080:13): [True: 84, False: 320]
  ------------------
 6081|     84|            goto out;
 6082|    320|#ifndef NETSNMP_DISABLE_MIB_LOADING
 6083|    320|        *rootlen = savlen;
 6084|    320|        if (get_node(argv, root, rootlen))
  ------------------
  |  Branch (6084:13): [True: 1, False: 319]
  ------------------
 6085|      1|            goto out;
 6086|    319|        *rootlen = savlen;
 6087|    319|        DEBUGMSGTL(("parse_oid", "wildly parsing\n"));
  ------------------
  |  |   68|    319|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|    319|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 319]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6088|    319|	clear_tree_flags(tree_head);
 6089|    319|        if (get_wild_node(argv, root, rootlen))
  ------------------
  |  Branch (6089:13): [True: 27, False: 292]
  ------------------
 6090|     27|            goto out;
 6091|    319|    }
 6092|    454|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 6093|       |
 6094|    454|    root = NULL;
 6095|       |
 6096|    567|out:
 6097|    567|    free(tmpbuf);
 6098|    567|    return root;
 6099|    454|}
mib.c:node_to_oid:
 5221|     31|{
 5222|     31|    size_t          numids, lenids;
 5223|     31|    oid            *op;
 5224|       |
 5225|     31|    if (!tp || !objid || !objidlen)
  ------------------
  |  Branch (5225:9): [True: 0, False: 31]
  |  Branch (5225:16): [True: 0, False: 31]
  |  Branch (5225:26): [True: 0, False: 31]
  ------------------
 5226|      0|        return 0;
 5227|       |
 5228|     31|    lenids = *objidlen;
 5229|     31|    op = objid + lenids;        /* points after the last element */
 5230|       |
 5231|     62|    for (numids = 0; tp; tp = tp->parent, numids++) {
  ------------------
  |  Branch (5231:22): [True: 31, False: 31]
  ------------------
 5232|     31|        if (numids >= lenids)
  ------------------
  |  Branch (5232:13): [True: 0, False: 31]
  ------------------
 5233|      0|            continue;
 5234|     31|        --op;
 5235|     31|        *op = tp->subid;
 5236|     31|    }
 5237|       |
 5238|     31|    *objidlen = numids;
 5239|     31|    if (numids > lenids) {
  ------------------
  |  Branch (5239:9): [True: 0, False: 31]
  ------------------
 5240|      0|        return 0;
 5241|      0|    }
 5242|       |
 5243|     31|    if (numids < lenids)
  ------------------
  |  Branch (5243:9): [True: 31, False: 0]
  ------------------
 5244|     31|        memmove(objid, op, numids * sizeof(oid));
 5245|       |
 5246|     31|    return numids;
 5247|     31|}
mib.c:_add_strings_to_oid:
 5291|    395|{
 5292|    395|    oid             subid;
 5293|    395|    char           *fcp, *ecp, *cp2 = NULL;
 5294|    395|    char            doingquote;
 5295|    395|    int             len = -1;
 5296|    395|#ifndef NETSNMP_DISABLE_MIB_LOADING
 5297|    395|    struct tree    *tp2 = NULL;
 5298|    395|    struct index_list *in_dices = NULL;
 5299|    395|    int             pos = -1;
 5300|    395|    int             check =
 5301|    395|        !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_CHECK_RANGE);
  ------------------
  |  |   48|    395|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
                      !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_CHECK_RANGE);
  ------------------
  |  |   76|    395|#define NETSNMP_DS_LIB_DONT_CHECK_RANGE    16   /* don't check values for ranges on send */
  ------------------
 5302|    395|    int             do_hint = !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NO_DISPLAY_HINT);
  ------------------
  |  |   48|    395|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
                  int             do_hint = !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NO_DISPLAY_HINT);
  ------------------
  |  |   90|    395|#define NETSNMP_DS_LIB_NO_DISPLAY_HINT     30 /* don't apply DISPLAY-HINTs */
  ------------------
 5303|    395|    int             len_index = 1000000;
 5304|       |
 5305|    395|    while (cp && tp && tp->child_list) {
  ------------------
  |  Branch (5305:12): [True: 395, False: 0]
  |  Branch (5305:18): [True: 395, False: 0]
  |  Branch (5305:24): [True: 0, False: 395]
  ------------------
 5306|      0|        fcp = cp;
 5307|      0|        tp2 = tp->child_list;
 5308|       |        /*
 5309|       |         * Isolate the next entry 
 5310|       |         */
 5311|      0|        cp2 = strchr(cp, '.');
 5312|      0|        if (cp2)
  ------------------
  |  Branch (5312:13): [True: 0, False: 0]
  ------------------
 5313|      0|            *cp2++ = '\0';
 5314|       |
 5315|       |        /*
 5316|       |         * Search for the appropriate child 
 5317|       |         */
 5318|      0|        if (isdigit((unsigned char)(*cp))) {
 5319|      0|            subid = strtoul(cp, &ecp, 0);
 5320|      0|            if (*ecp)
  ------------------
  |  Branch (5320:17): [True: 0, False: 0]
  ------------------
 5321|      0|                goto bad_id;
 5322|      0|            while (tp2 && tp2->subid != subid)
  ------------------
  |  Branch (5322:20): [True: 0, False: 0]
  |  Branch (5322:27): [True: 0, False: 0]
  ------------------
 5323|      0|                tp2 = tp2->next_peer;
 5324|      0|        } else {
 5325|      0|            while (tp2 && strcmp(tp2->label, fcp))
  ------------------
  |  Branch (5325:20): [True: 0, False: 0]
  |  Branch (5325:27): [True: 0, False: 0]
  ------------------
 5326|      0|                tp2 = tp2->next_peer;
 5327|      0|            if (!tp2)
  ------------------
  |  Branch (5327:17): [True: 0, False: 0]
  ------------------
 5328|      0|                goto bad_id;
 5329|      0|            subid = tp2->subid;
 5330|      0|        }
 5331|      0|        if (*objidlen >= maxlen)
  ------------------
  |  Branch (5331:13): [True: 0, False: 0]
  ------------------
 5332|      0|            goto bad_id;
 5333|      0|	while (tp2 && tp2->next_peer && tp2->next_peer->subid == subid)
  ------------------
  |  Branch (5333:9): [True: 0, False: 0]
  |  Branch (5333:16): [True: 0, False: 0]
  |  Branch (5333:34): [True: 0, False: 0]
  ------------------
 5334|      0|	    tp2 = tp2->next_peer;
 5335|      0|        objid[*objidlen] = subid;
 5336|      0|        (*objidlen)++;
 5337|       |
 5338|      0|        cp = cp2;
 5339|      0|        if (!tp2)
  ------------------
  |  Branch (5339:13): [True: 0, False: 0]
  ------------------
 5340|      0|            break;
 5341|      0|        tp = tp2;
 5342|      0|    }
 5343|       |
 5344|    395|    if (tp && !tp->child_list) {
  ------------------
  |  Branch (5344:9): [True: 395, False: 0]
  |  Branch (5344:15): [True: 395, False: 0]
  ------------------
 5345|    395|        if ((tp2 = tp->parent)) {
  ------------------
  |  Branch (5345:13): [True: 0, False: 395]
  ------------------
 5346|      0|            if (tp2->indexes)
  ------------------
  |  Branch (5346:17): [True: 0, False: 0]
  ------------------
 5347|      0|                in_dices = tp2->indexes;
 5348|      0|            else if (tp2->augments) {
  ------------------
  |  Branch (5348:22): [True: 0, False: 0]
  ------------------
 5349|      0|                tp2 = find_tree_node(tp2->augments, -1);
 5350|      0|                if (tp2)
  ------------------
  |  Branch (5350:21): [True: 0, False: 0]
  ------------------
 5351|      0|                    in_dices = tp2->indexes;
 5352|      0|            }
 5353|      0|        }
 5354|    395|        tp = NULL;
 5355|    395|    }
 5356|       |
 5357|    395|    while (cp && in_dices) {
  ------------------
  |  Branch (5357:12): [True: 395, False: 0]
  |  Branch (5357:18): [True: 0, False: 395]
  ------------------
 5358|      0|        fcp = cp;
 5359|       |
 5360|      0|        tp = find_tree_node(in_dices->ilabel, -1);
 5361|      0|        if (!tp)
  ------------------
  |  Branch (5361:13): [True: 0, False: 0]
  ------------------
 5362|      0|            break;
 5363|      0|        switch (tp->type) {
 5364|      0|        case TYPE_INTEGER:
  ------------------
  |  |  156|      0|#define TYPE_INTEGER        3
  ------------------
  |  Branch (5364:9): [True: 0, False: 0]
  ------------------
 5365|      0|        case TYPE_INTEGER32:
  ------------------
  |  |  169|      0|#define TYPE_INTEGER32      16
  ------------------
  |  Branch (5365:9): [True: 0, False: 0]
  ------------------
 5366|      0|        case TYPE_UINTEGER:
  ------------------
  |  |  167|      0|#define TYPE_UINTEGER       14
  ------------------
  |  Branch (5366:9): [True: 0, False: 0]
  ------------------
 5367|      0|        case TYPE_UNSIGNED32:
  ------------------
  |  |  168|      0|#define TYPE_UNSIGNED32     15
  ------------------
  |  Branch (5367:9): [True: 0, False: 0]
  ------------------
 5368|      0|        case TYPE_TIMETICKS:
  ------------------
  |  |  161|      0|#define TYPE_TIMETICKS      8
  ------------------
  |  Branch (5368:9): [True: 0, False: 0]
  ------------------
 5369|       |            /*
 5370|       |             * Isolate the next entry 
 5371|       |             */
 5372|      0|            cp2 = strchr(cp, '.');
 5373|      0|            if (cp2)
  ------------------
  |  Branch (5373:17): [True: 0, False: 0]
  ------------------
 5374|      0|                *cp2++ = '\0';
 5375|      0|            if (isdigit((unsigned char)(*cp))) {
 5376|      0|                subid = strtoul(cp, &ecp, 0);
 5377|      0|                if (*ecp)
  ------------------
  |  Branch (5377:21): [True: 0, False: 0]
  ------------------
 5378|      0|                    goto bad_id;
 5379|      0|            } else {
 5380|      0|                if (tp->enums) {
  ------------------
  |  Branch (5380:21): [True: 0, False: 0]
  ------------------
 5381|      0|                    struct enum_list *ep = tp->enums;
 5382|      0|                    while (ep && strcmp(ep->label, cp))
  ------------------
  |  Branch (5382:28): [True: 0, False: 0]
  |  Branch (5382:34): [True: 0, False: 0]
  ------------------
 5383|      0|                        ep = ep->next;
 5384|      0|                    if (!ep)
  ------------------
  |  Branch (5384:25): [True: 0, False: 0]
  ------------------
 5385|      0|                        goto bad_id;
 5386|      0|                    subid = ep->value;
 5387|      0|                } else
 5388|      0|                    goto bad_id;
 5389|      0|            }
 5390|      0|            if (check && tp->ranges) {
  ------------------
  |  Branch (5390:17): [True: 0, False: 0]
  |  Branch (5390:26): [True: 0, False: 0]
  ------------------
 5391|      0|                struct range_list *rp = tp->ranges;
 5392|      0|                int             ok = 0;
 5393|      0|                if (tp->type == TYPE_INTEGER ||
  ------------------
  |  |  156|      0|#define TYPE_INTEGER        3
  ------------------
  |  Branch (5393:21): [True: 0, False: 0]
  ------------------
 5394|      0|                    tp->type == TYPE_INTEGER32) {
  ------------------
  |  |  169|      0|#define TYPE_INTEGER32      16
  ------------------
  |  Branch (5394:21): [True: 0, False: 0]
  ------------------
 5395|      0|                  while (!ok && rp) {
  ------------------
  |  Branch (5395:26): [True: 0, False: 0]
  |  Branch (5395:33): [True: 0, False: 0]
  ------------------
 5396|      0|                    if ((rp->low <= (int) subid)
  ------------------
  |  Branch (5396:25): [True: 0, False: 0]
  ------------------
 5397|      0|                        && ((int) subid <= rp->high))
  ------------------
  |  Branch (5397:28): [True: 0, False: 0]
  ------------------
 5398|      0|                        ok = 1;
 5399|      0|                    else
 5400|      0|                        rp = rp->next;
 5401|      0|                  }
 5402|      0|                } else { /* check unsigned range */
 5403|      0|                  while (!ok && rp) {
  ------------------
  |  Branch (5403:26): [True: 0, False: 0]
  |  Branch (5403:33): [True: 0, False: 0]
  ------------------
 5404|      0|                    if (((unsigned int)rp->low <= subid)
  ------------------
  |  Branch (5404:25): [True: 0, False: 0]
  ------------------
 5405|      0|                        && (subid <= (unsigned int)rp->high))
  ------------------
  |  Branch (5405:28): [True: 0, False: 0]
  ------------------
 5406|      0|                        ok = 1;
 5407|      0|                    else
 5408|      0|                        rp = rp->next;
 5409|      0|                  }
 5410|      0|                }
 5411|      0|                if (!ok)
  ------------------
  |  Branch (5411:21): [True: 0, False: 0]
  ------------------
 5412|      0|                    goto bad_id;
 5413|      0|            }
 5414|      0|            if (*objidlen >= maxlen)
  ------------------
  |  Branch (5414:17): [True: 0, False: 0]
  ------------------
 5415|      0|                goto bad_id;
 5416|      0|            objid[*objidlen] = subid;
 5417|      0|            (*objidlen)++;
 5418|      0|            break;
 5419|      0|        case TYPE_IPADDR:
  ------------------
  |  |  158|      0|#define TYPE_IPADDR         5
  ------------------
  |  Branch (5419:9): [True: 0, False: 0]
  ------------------
 5420|      0|            if (*objidlen + 4 > maxlen)
  ------------------
  |  Branch (5420:17): [True: 0, False: 0]
  ------------------
 5421|      0|                goto bad_id;
 5422|      0|            for (subid = 0; cp && subid < 4; subid++) {
  ------------------
  |  Branch (5422:29): [True: 0, False: 0]
  |  Branch (5422:35): [True: 0, False: 0]
  ------------------
 5423|      0|                fcp = cp;
 5424|      0|                cp2 = strchr(cp, '.');
 5425|      0|                if (cp2)
  ------------------
  |  Branch (5425:21): [True: 0, False: 0]
  ------------------
 5426|      0|                    *cp2++ = 0;
 5427|      0|                objid[*objidlen] = strtoul(cp, &ecp, 0);
 5428|      0|                if (*ecp)
  ------------------
  |  Branch (5428:21): [True: 0, False: 0]
  ------------------
 5429|      0|                    goto bad_id;
 5430|      0|                if (check && objid[*objidlen] > 255)
  ------------------
  |  Branch (5430:21): [True: 0, False: 0]
  |  Branch (5430:30): [True: 0, False: 0]
  ------------------
 5431|      0|                    goto bad_id;
 5432|      0|                (*objidlen)++;
 5433|      0|                cp = cp2;
 5434|      0|            }
 5435|      0|            break;
 5436|      0|        case TYPE_OCTETSTR:
  ------------------
  |  |  155|      0|#define TYPE_OCTETSTR       2
  ------------------
  |  Branch (5436:9): [True: 0, False: 0]
  ------------------
 5437|      0|            if (tp->ranges && !tp->ranges->next
  ------------------
  |  Branch (5437:17): [True: 0, False: 0]
  |  Branch (5437:31): [True: 0, False: 0]
  ------------------
 5438|      0|                && tp->ranges->low == tp->ranges->high)
  ------------------
  |  Branch (5438:20): [True: 0, False: 0]
  ------------------
 5439|      0|                len = tp->ranges->low;
 5440|      0|            else
 5441|      0|                len = -1;
 5442|      0|            pos = 0;
 5443|      0|            if (*cp == '"' || *cp == '\'') {
  ------------------
  |  Branch (5443:17): [True: 0, False: 0]
  |  Branch (5443:31): [True: 0, False: 0]
  ------------------
 5444|      0|                doingquote = *cp++;
 5445|       |                /*
 5446|       |                 * insert length if requested 
 5447|       |                 */
 5448|      0|                if (!in_dices->isimplied && len == -1) {
  ------------------
  |  Branch (5448:21): [True: 0, False: 0]
  |  Branch (5448:45): [True: 0, False: 0]
  ------------------
 5449|      0|                    if (doingquote == '\'') {
  ------------------
  |  Branch (5449:25): [True: 0, False: 0]
  ------------------
 5450|      0|                        snmp_set_detail
 5451|      0|                            ("'-quote is for fixed length strings");
 5452|      0|                        return 0;
 5453|      0|                    }
 5454|      0|                    if (*objidlen >= maxlen)
  ------------------
  |  Branch (5454:25): [True: 0, False: 0]
  ------------------
 5455|      0|                        goto bad_id;
 5456|      0|                    len_index = *objidlen;
 5457|      0|                    (*objidlen)++;
 5458|      0|                } else if (doingquote == '"') {
  ------------------
  |  Branch (5458:28): [True: 0, False: 0]
  ------------------
 5459|      0|                    snmp_set_detail
 5460|      0|                        ("\"-quote is for variable length strings");
 5461|      0|                    return 0;
 5462|      0|                }
 5463|       |
 5464|      0|		cp2 = _apply_escapes(cp, doingquote);
 5465|      0|		if (!cp2) goto bad_id;
  ------------------
  |  Branch (5465:7): [True: 0, False: 0]
  ------------------
 5466|      0|		else {
 5467|      0|		    unsigned char *new_val;
 5468|      0|		    int new_val_len;
 5469|      0|		    int parsed_hint = 0;
 5470|      0|		    const char *parsed_value;
 5471|       |
 5472|      0|		    if (do_hint && tp->hint) {
  ------------------
  |  Branch (5472:11): [True: 0, False: 0]
  |  Branch (5472:22): [True: 0, False: 0]
  ------------------
 5473|      0|			parsed_value = parse_octet_hint(tp->hint, cp,
 5474|      0|			                                &new_val, &new_val_len);
 5475|      0|			parsed_hint = parsed_value == NULL;
 5476|      0|		    }
 5477|      0|		    if (parsed_hint) {
  ------------------
  |  Branch (5477:11): [True: 0, False: 0]
  ------------------
 5478|      0|			int i;
 5479|      0|			for (i = 0; i < new_val_len; i++) {
  ------------------
  |  Branch (5479:16): [True: 0, False: 0]
  ------------------
 5480|      0|			    if (*objidlen >= maxlen) goto bad_id;
  ------------------
  |  Branch (5480:12): [True: 0, False: 0]
  ------------------
 5481|      0|			    objid[ *objidlen ] = new_val[i];
 5482|      0|			    (*objidlen)++;
 5483|      0|			    pos++;
 5484|      0|			}
 5485|      0|			SNMP_FREE(new_val);
  ------------------
  |  |   62|      0|#define SNMP_FREE(s)    do { if (s) { free(s); s=NULL; } } while(0)
  |  |  ------------------
  |  |  |  Branch (62:34): [True: 0, False: 0]
  |  |  |  Branch (62:66): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5486|      0|		    } else {
 5487|      0|			while(*cp) {
  ------------------
  |  Branch (5487:10): [True: 0, False: 0]
  ------------------
 5488|      0|			    if (*objidlen >= maxlen) goto bad_id;
  ------------------
  |  Branch (5488:12): [True: 0, False: 0]
  ------------------
 5489|      0|			    objid[ *objidlen ] = *cp++;
 5490|      0|			    (*objidlen)++;
 5491|      0|			    pos++;
 5492|      0|			}
 5493|      0|		    }
 5494|      0|		}
 5495|       |		
 5496|      0|		cp2++;
 5497|      0|                if (!*cp2)
  ------------------
  |  Branch (5497:21): [True: 0, False: 0]
  ------------------
 5498|      0|                    cp2 = NULL;
 5499|      0|                else if (*cp2 != '.')
  ------------------
  |  Branch (5499:26): [True: 0, False: 0]
  ------------------
 5500|      0|                    goto bad_id;
 5501|      0|                else
 5502|      0|                    cp2++;
 5503|      0|		if (check) {
  ------------------
  |  Branch (5503:7): [True: 0, False: 0]
  ------------------
 5504|      0|                    if (len == -1) {
  ------------------
  |  Branch (5504:25): [True: 0, False: 0]
  ------------------
 5505|      0|                        struct range_list *rp = tp->ranges;
 5506|      0|                        int             ok = 0;
 5507|      0|                        while (rp && !ok)
  ------------------
  |  Branch (5507:32): [True: 0, False: 0]
  |  Branch (5507:38): [True: 0, False: 0]
  ------------------
 5508|      0|                            if (rp->low <= pos && pos <= rp->high)
  ------------------
  |  Branch (5508:33): [True: 0, False: 0]
  |  Branch (5508:51): [True: 0, False: 0]
  ------------------
 5509|      0|                                ok = 1;
 5510|      0|                            else
 5511|      0|                                rp = rp->next;
 5512|      0|                        if (!ok)
  ------------------
  |  Branch (5512:29): [True: 0, False: 0]
  ------------------
 5513|      0|                            goto bad_id;
 5514|      0|                        if (!in_dices->isimplied)
  ------------------
  |  Branch (5514:29): [True: 0, False: 0]
  ------------------
 5515|      0|                            objid[len_index] = pos;
 5516|      0|                    } else if (pos != len)
  ------------------
  |  Branch (5516:32): [True: 0, False: 0]
  ------------------
 5517|      0|                        goto bad_id;
 5518|      0|		}
 5519|      0|		else if (len == -1 && !in_dices->isimplied)
  ------------------
  |  Branch (5519:12): [True: 0, False: 0]
  |  Branch (5519:25): [True: 0, False: 0]
  ------------------
 5520|      0|		    objid[len_index] = pos;
 5521|      0|            } else {
 5522|      0|                if (!in_dices->isimplied && len == -1) {
  ------------------
  |  Branch (5522:21): [True: 0, False: 0]
  |  Branch (5522:45): [True: 0, False: 0]
  ------------------
 5523|      0|                    fcp = cp;
 5524|      0|                    cp2 = strchr(cp, '.');
 5525|      0|                    if (cp2)
  ------------------
  |  Branch (5525:25): [True: 0, False: 0]
  ------------------
 5526|      0|                        *cp2++ = 0;
 5527|      0|                    len = strtoul(cp, &ecp, 0);
 5528|      0|                    if (*ecp)
  ------------------
  |  Branch (5528:25): [True: 0, False: 0]
  ------------------
 5529|      0|                        goto bad_id;
 5530|      0|                    if (*objidlen + len + 1 >= maxlen)
  ------------------
  |  Branch (5530:25): [True: 0, False: 0]
  ------------------
 5531|      0|                        goto bad_id;
 5532|      0|                    objid[*objidlen] = len;
 5533|      0|                    (*objidlen)++;
 5534|      0|                    cp = cp2;
 5535|      0|                }
 5536|      0|                while (len && cp) {
  ------------------
  |  Branch (5536:24): [True: 0, False: 0]
  |  Branch (5536:31): [True: 0, False: 0]
  ------------------
 5537|      0|                    fcp = cp;
 5538|      0|                    cp2 = strchr(cp, '.');
 5539|      0|                    if (cp2)
  ------------------
  |  Branch (5539:25): [True: 0, False: 0]
  ------------------
 5540|      0|                        *cp2++ = 0;
 5541|      0|                    objid[*objidlen] = strtoul(cp, &ecp, 0);
 5542|      0|                    if (*ecp)
  ------------------
  |  Branch (5542:25): [True: 0, False: 0]
  ------------------
 5543|      0|                        goto bad_id;
 5544|      0|                    if (check && objid[*objidlen] > 255)
  ------------------
  |  Branch (5544:25): [True: 0, False: 0]
  |  Branch (5544:34): [True: 0, False: 0]
  ------------------
 5545|      0|                        goto bad_id;
 5546|      0|                    (*objidlen)++;
 5547|      0|                    len--;
 5548|      0|                    cp = cp2;
 5549|      0|                }
 5550|      0|            }
 5551|      0|            break;
 5552|      0|        case TYPE_OBJID:
  ------------------
  |  |  154|      0|#define TYPE_OBJID          1
  ------------------
  |  Branch (5552:9): [True: 0, False: 0]
  ------------------
 5553|      0|            in_dices = NULL;
 5554|      0|            cp2 = cp;
 5555|      0|            break;
 5556|      0|	case TYPE_NETADDR:
  ------------------
  |  |  157|      0|#define TYPE_NETADDR        4
  ------------------
  |  Branch (5556:2): [True: 0, False: 0]
  ------------------
 5557|      0|	    fcp = cp;
 5558|      0|	    cp2 = strchr(cp, '.');
 5559|      0|	    if (cp2)
  ------------------
  |  Branch (5559:10): [True: 0, False: 0]
  ------------------
 5560|      0|		*cp2++ = 0;
 5561|      0|	    subid = strtoul(cp, &ecp, 0);
 5562|      0|	    if (*ecp)
  ------------------
  |  Branch (5562:10): [True: 0, False: 0]
  ------------------
 5563|      0|		goto bad_id;
 5564|      0|	    if (*objidlen + 1 >= maxlen)
  ------------------
  |  Branch (5564:10): [True: 0, False: 0]
  ------------------
 5565|      0|		goto bad_id;
 5566|      0|	    objid[*objidlen] = subid;
 5567|      0|	    (*objidlen)++;
 5568|      0|	    cp = cp2;
 5569|      0|	    if (subid == 1) {
  ------------------
  |  Branch (5569:10): [True: 0, False: 0]
  ------------------
 5570|      0|		for (len = 0; cp && len < 4; len++) {
  ------------------
  |  Branch (5570:17): [True: 0, False: 0]
  |  Branch (5570:23): [True: 0, False: 0]
  ------------------
 5571|      0|		    fcp = cp;
 5572|      0|		    cp2 = strchr(cp, '.');
 5573|      0|		    if (cp2)
  ------------------
  |  Branch (5573:11): [True: 0, False: 0]
  ------------------
 5574|      0|			*cp2++ = 0;
 5575|      0|		    subid = strtoul(cp, &ecp, 0);
 5576|      0|		    if (*ecp)
  ------------------
  |  Branch (5576:11): [True: 0, False: 0]
  ------------------
 5577|      0|			goto bad_id;
 5578|      0|		    if (*objidlen + 1 >= maxlen)
  ------------------
  |  Branch (5578:11): [True: 0, False: 0]
  ------------------
 5579|      0|			goto bad_id;
 5580|      0|		    if (check && subid > 255)
  ------------------
  |  Branch (5580:11): [True: 0, False: 0]
  |  Branch (5580:20): [True: 0, False: 0]
  ------------------
 5581|      0|			goto bad_id;
 5582|      0|		    objid[*objidlen] = subid;
 5583|      0|		    (*objidlen)++;
 5584|      0|		    cp = cp2;
 5585|      0|		}
 5586|      0|	    }
 5587|      0|	    else {
 5588|      0|		in_dices = NULL;
 5589|      0|	    }
 5590|      0|	    break;
 5591|      0|        default:
  ------------------
  |  Branch (5591:9): [True: 0, False: 0]
  ------------------
 5592|      0|            snmp_log(LOG_ERR, "Unexpected index type: %d %s %s\n",
 5593|      0|                     tp->type, in_dices->ilabel, cp);
 5594|      0|            in_dices = NULL;
 5595|      0|            cp2 = cp;
 5596|      0|            break;
 5597|      0|        }
 5598|      0|        cp = cp2;
 5599|      0|        if (in_dices)
  ------------------
  |  Branch (5599:13): [True: 0, False: 0]
  ------------------
 5600|      0|            in_dices = in_dices->next;
 5601|      0|    }
 5602|       |
 5603|    395|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 5604|  3.03k|    while (cp) {
  ------------------
  |  Branch (5604:12): [True: 2.95k, False: 84]
  ------------------
 5605|  2.95k|        fcp = cp;
 5606|  2.95k|        switch (*cp) {
 5607|    207|        case '0':
  ------------------
  |  Branch (5607:9): [True: 207, False: 2.74k]
  ------------------
 5608|    420|        case '1':
  ------------------
  |  Branch (5608:9): [True: 213, False: 2.73k]
  ------------------
 5609|    618|        case '2':
  ------------------
  |  Branch (5609:9): [True: 198, False: 2.75k]
  ------------------
 5610|    817|        case '3':
  ------------------
  |  Branch (5610:9): [True: 199, False: 2.75k]
  ------------------
 5611|  1.03k|        case '4':
  ------------------
  |  Branch (5611:9): [True: 216, False: 2.73k]
  ------------------
 5612|  1.35k|        case '5':
  ------------------
  |  Branch (5612:9): [True: 325, False: 2.62k]
  ------------------
 5613|  1.58k|        case '6':
  ------------------
  |  Branch (5613:9): [True: 228, False: 2.72k]
  ------------------
 5614|  1.78k|        case '7':
  ------------------
  |  Branch (5614:9): [True: 195, False: 2.75k]
  ------------------
 5615|  1.97k|        case '8':
  ------------------
  |  Branch (5615:9): [True: 195, False: 2.75k]
  ------------------
 5616|  2.17k|        case '9':
  ------------------
  |  Branch (5616:9): [True: 195, False: 2.75k]
  ------------------
 5617|  2.17k|            cp2 = strchr(cp, '.');
 5618|  2.17k|            if (cp2)
  ------------------
  |  Branch (5618:17): [True: 2.07k, False: 97]
  ------------------
 5619|  2.07k|                *cp2++ = 0;
 5620|  2.17k|            subid = strtoul(cp, &ecp, 0);
 5621|  2.17k|            if (*ecp)
  ------------------
  |  Branch (5621:17): [True: 19, False: 2.15k]
  ------------------
 5622|     19|                goto bad_id;
 5623|  2.15k|            if (*objidlen >= maxlen)
  ------------------
  |  Branch (5623:17): [True: 4, False: 2.14k]
  ------------------
 5624|      4|                goto bad_id;
 5625|  2.14k|            objid[*objidlen] = subid;
 5626|  2.14k|            (*objidlen)++;
 5627|  2.14k|            break;
 5628|    306|        case '"':
  ------------------
  |  Branch (5628:9): [True: 306, False: 2.64k]
  ------------------
 5629|    559|        case '\'':
  ------------------
  |  Branch (5629:9): [True: 253, False: 2.69k]
  ------------------
 5630|    559|            doingquote = *cp++;
 5631|    559|            if (*cp == '\0')
  ------------------
  |  Branch (5631:17): [True: 12, False: 547]
  ------------------
 5632|     12|                goto bad_id;
 5633|       |            /*
 5634|       |             * insert length if requested 
 5635|       |             */
 5636|    547|            if (doingquote == '"') {
  ------------------
  |  Branch (5636:17): [True: 300, False: 247]
  ------------------
 5637|    300|                if (*objidlen >= maxlen)
  ------------------
  |  Branch (5637:21): [True: 2, False: 298]
  ------------------
 5638|      2|                    goto bad_id;
 5639|    298|                objid[*objidlen] = len = strchr(cp, doingquote) - cp;
 5640|    298|                (*objidlen)++;
 5641|    298|            }
 5642|       |
 5643|  2.38k|            while (*cp && *cp != doingquote) {
  ------------------
  |  Branch (5643:20): [True: 2.34k, False: 33]
  |  Branch (5643:27): [True: 1.84k, False: 506]
  ------------------
 5644|  1.84k|                if (*objidlen >= maxlen)
  ------------------
  |  Branch (5644:21): [True: 6, False: 1.83k]
  ------------------
 5645|      6|                    goto bad_id;
 5646|  1.83k|                objid[*objidlen] = *cp++;
 5647|  1.83k|                (*objidlen)++;
 5648|  1.83k|            }
 5649|    539|            if (!*cp)
  ------------------
  |  Branch (5649:17): [True: 33, False: 506]
  ------------------
 5650|     33|                goto bad_id;
 5651|    506|            cp2 = cp + 1;
 5652|    506|            if (!*cp2)
  ------------------
  |  Branch (5652:17): [True: 9, False: 497]
  ------------------
 5653|      9|                cp2 = NULL;
 5654|    497|            else if (*cp2 == '.')
  ------------------
  |  Branch (5654:22): [True: 482, False: 15]
  ------------------
 5655|    482|                cp2++;
 5656|     15|            else
 5657|     15|                goto bad_id;
 5658|    491|            break;
 5659|    491|        default:
  ------------------
  |  Branch (5659:9): [True: 220, False: 2.73k]
  ------------------
 5660|    220|            goto bad_id;
 5661|  2.95k|        }
 5662|  2.63k|        cp = cp2;
 5663|  2.63k|    }
 5664|     84|    return 1;
 5665|       |
 5666|    311|  bad_id:
 5667|    311|    {
 5668|    311|        char            buf[256];
 5669|    311|#ifndef NETSNMP_DISABLE_MIB_LOADING
 5670|    311|        if (in_dices)
  ------------------
  |  Branch (5670:13): [True: 0, False: 311]
  ------------------
 5671|      0|            snprintf(buf, sizeof(buf), "Index out of range: %s (%s)",
 5672|      0|                    fcp, in_dices->ilabel);
 5673|    311|        else if (tp)
  ------------------
  |  Branch (5673:18): [True: 0, False: 311]
  ------------------
 5674|      0|            snprintf(buf, sizeof(buf), "Sub-id not found: %s -> %s", tp->label, fcp);
 5675|    311|        else
 5676|    311|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 5677|    311|            snprintf(buf, sizeof(buf), "%s", fcp);
 5678|    311|        buf[ sizeof(buf)-1 ] = 0;
 5679|       |
 5680|    311|        snmp_set_detail(buf);
 5681|    311|    }
 5682|    311|    return 0;
 5683|    395|}

netsnmp_init_mib_internals:
  699|    172|{
  700|    172|    register struct tok *tp;
  701|    172|    register int    b, i;
  702|    172|    int             max_modc;
  703|       |
  704|    172|    if (tree_head)
  ------------------
  |  Branch (704:9): [True: 171, False: 1]
  ------------------
  705|    171|        return;
  706|       |
  707|       |    /*
  708|       |     * Set up hash list of pre-defined tokens
  709|       |     */
  710|      1|    memset(buckets, 0, sizeof(buckets));
  711|     93|    for (tp = tokens; tp->name; tp++) {
  ------------------
  |  Branch (711:23): [True: 92, False: 1]
  ------------------
  712|     92|        tp->hash = name_hash(tp->name);
  713|     92|        b = BUCKET(tp->hash);
  ------------------
  |  |  526|     92|#define BUCKET(x)       (x & (HASHSIZE-1))
  |  |  ------------------
  |  |  |  |  525|     92|#define HASHSIZE        32
  |  |  ------------------
  ------------------
  714|     92|        if (buckets[b])
  ------------------
  |  Branch (714:13): [True: 60, False: 32]
  ------------------
  715|     60|            tp->next = buckets[b];      /* BUG ??? */
  716|     92|        buckets[b] = tp;
  717|     92|    }
  718|       |
  719|       |    /*
  720|       |     * Initialise other internal structures
  721|       |     */
  722|       |
  723|      1|    max_modc = sizeof(module_map) / sizeof(module_map[0]) - 1;
  724|     22|    for (i = 0; i < max_modc; ++i)
  ------------------
  |  Branch (724:17): [True: 21, False: 1]
  ------------------
  725|     21|        module_map[i].next = &(module_map[i + 1]);
  726|      1|    module_map[max_modc].next = NULL;
  727|      1|    module_map_head = module_map;
  728|       |
  729|      1|    memset(nbuckets, 0, sizeof(nbuckets));
  730|      1|    memset(tbuckets, 0, sizeof(tbuckets));
  731|      1|    tc_alloc = TC_INCR;
  ------------------
  |  |  134|      1|#define TC_INCR 100
  ------------------
  732|      1|    tclist = calloc(tc_alloc, sizeof(struct tc));
  733|      1|    build_translation_table();
  734|      1|    init_tree_roots();          /* Set up initial roots */
  735|       |    /*
  736|       |     * Relies on 'add_mibdir' having set up the modules 
  737|       |     */
  738|      1|}
find_tree_node:
 1240|    350|{
 1241|    350|    struct tree    *tp, *headtp;
 1242|    350|    int             count, *int_p;
 1243|       |
 1244|    350|    if (!name || !*name)
  ------------------
  |  Branch (1244:9): [True: 0, False: 350]
  |  Branch (1244:18): [True: 2, False: 348]
  ------------------
 1245|      2|        return (NULL);
 1246|       |
 1247|    348|    headtp = tbuckets[NBUCKET(name_hash(name))];
  ------------------
  |  |  529|    348|#define NBUCKET(x)   (x & (NHASHSIZE-1))
  |  |  ------------------
  |  |  |  |  528|    348|#define NHASHSIZE    128
  |  |  ------------------
  ------------------
 1248|    471|    for (tp = headtp; tp; tp = tp->next) {
  ------------------
  |  Branch (1248:23): [True: 154, False: 317]
  ------------------
 1249|    154|        if (tp->label && !label_compare(tp->label, name)) {
  ------------------
  |  | 1234|    154|#define	label_compare	strcmp
  ------------------
  |  Branch (1249:13): [True: 154, False: 0]
  |  Branch (1249:26): [True: 31, False: 123]
  ------------------
 1250|       |
 1251|     31|            if (modid == -1)    /* Any module */
  ------------------
  |  Branch (1251:17): [True: 31, False: 0]
  ------------------
 1252|     31|                return (tp);
 1253|       |
 1254|      0|            for (int_p = tp->module_list, count = 0;
 1255|      0|                 count < tp->number_modules; ++count, ++int_p)
  ------------------
  |  Branch (1255:18): [True: 0, False: 0]
  ------------------
 1256|      0|                if (*int_p == modid)
  ------------------
  |  Branch (1256:21): [True: 0, False: 0]
  ------------------
 1257|      0|                    return (tp);
 1258|      0|        }
 1259|    154|    }
 1260|       |
 1261|    317|    return (NULL);
 1262|    348|}
find_best_tree_node:
 1340|    319|{
 1341|    319|    struct tree    *tp, *best_so_far = NULL, *retptr;
 1342|    319|    u_int           old_match = MAX_BAD, new_match = MAX_BAD;
  ------------------
  |  | 1269|    319|#define MAX_BAD 0xffffff
  ------------------
                  u_int           old_match = MAX_BAD, new_match = MAX_BAD;
  ------------------
  |  | 1269|    319|#define MAX_BAD 0xffffff
  ------------------
 1343|       |
 1344|    319|    if (!pattrn || !*pattrn)
  ------------------
  |  Branch (1344:9): [True: 0, False: 319]
  |  Branch (1344:20): [True: 1, False: 318]
  ------------------
 1345|      1|        return (NULL);
 1346|       |
 1347|    318|    if (!tree_top)
  ------------------
  |  Branch (1347:9): [True: 11, False: 307]
  ------------------
 1348|     11|        tree_top = get_tree_head();
 1349|       |
 1350|  1.21k|    for (tp = tree_top; tp; tp = tp->next_peer) {
  ------------------
  |  Branch (1350:25): [True: 907, False: 308]
  ------------------
 1351|    907|        if (!tp->reported && tp->label)
  ------------------
  |  Branch (1351:13): [True: 907, False: 0]
  |  Branch (1351:30): [True: 907, False: 0]
  ------------------
 1352|    907|            new_match = compute_match(tp->label, pattrn);
 1353|    907|        tp->reported = 1;
 1354|       |
 1355|    907|        if (new_match < old_match) {
  ------------------
  |  Branch (1355:13): [True: 36, False: 871]
  ------------------
 1356|     36|            best_so_far = tp;
 1357|     36|            old_match = new_match;
 1358|     36|        }
 1359|    907|        if (new_match == 0)
  ------------------
  |  Branch (1359:13): [True: 10, False: 897]
  ------------------
 1360|     10|            break;              /* this is the best result we can get */
 1361|    897|        if (tp->child_list) {
  ------------------
  |  Branch (1361:13): [True: 0, False: 897]
  ------------------
 1362|      0|            retptr =
 1363|      0|                find_best_tree_node(pattrn, tp->child_list, &new_match);
 1364|      0|            if (new_match < old_match) {
  ------------------
  |  Branch (1364:17): [True: 0, False: 0]
  ------------------
 1365|      0|                best_so_far = retptr;
 1366|      0|                old_match = new_match;
 1367|      0|            }
 1368|      0|            if (new_match == 0)
  ------------------
  |  Branch (1368:17): [True: 0, False: 0]
  ------------------
 1369|      0|                break;          /* this is the best result we can get */
 1370|      0|        }
 1371|    897|    }
 1372|    318|    if (match)
  ------------------
  |  Branch (1372:9): [True: 0, False: 318]
  ------------------
 1373|      0|        *match = old_match;
 1374|    318|    return (best_so_far);
 1375|    319|}
which_module:
 3769|    163|{
 3770|    163|    struct module  *mp;
 3771|       |
 3772|    163|    for (mp = module_head; mp; mp = mp->next)
  ------------------
  |  Branch (3772:28): [True: 0, False: 163]
  ------------------
 3773|      0|        if (!label_compare(mp->name, name))
  ------------------
  |  | 1234|      0|#define	label_compare	strcmp
  ------------------
  |  Branch (3773:13): [True: 0, False: 0]
  ------------------
 3774|      0|            return (mp->modid);
 3775|       |
 3776|    163|    DEBUGMSGTL(("parse-mibs", "Module %s not found\n", name));
  ------------------
  |  |   68|    163|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|    163|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 163]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3777|    163|    return (-1);
 3778|    163|}
netsnmp_read_module:
 4036|    172|{
 4037|    172|    int status = 0;
 4038|    172|    status = read_module_internal(name);
 4039|       |
 4040|    172|    if (status == MODULE_NOT_FOUND) {
  ------------------
  |  |  512|    172|#define MODULE_NOT_FOUND	0
  ------------------
  |  Branch (4040:9): [True: 172, False: 0]
  ------------------
 4041|    172|        if (!read_module_replacements(name))
  ------------------
  |  Branch (4041:13): [True: 160, False: 12]
  ------------------
 4042|    160|            print_module_not_found(name);
 4043|    172|    } else if (status == MODULE_SYNTAX_ERROR) {
  ------------------
  |  |  519|      0|#define MODULE_SYNTAX_ERROR     4
  ------------------
  |  Branch (4043:16): [True: 0, False: 0]
  ------------------
 4044|      0|        gMibError = 0;
 4045|      0|        gLoop = 1;
 4046|       |
 4047|      0|        strncat(gMibNames, " ", sizeof(gMibNames) - strlen(gMibNames) - 1);
 4048|      0|        strncat(gMibNames, name, sizeof(gMibNames) - strlen(gMibNames) - 1);
 4049|      0|    }
 4050|       |
 4051|    172|    return tree_head;
 4052|    172|}
parse.c:name_hash:
  686|    443|{
  687|    443|    int             hash = 0;
  688|    443|    const char     *cp;
  689|       |
  690|    443|    if (!name)
  ------------------
  |  Branch (690:9): [True: 0, False: 443]
  ------------------
  691|      0|        return 0;
  692|  6.27k|    for (cp = name; *cp; cp++)
  ------------------
  |  Branch (692:21): [True: 5.83k, False: 443]
  ------------------
  693|  5.83k|        hash += tolower((unsigned char)(*cp));
  694|    443|    return (hash);
  695|    443|}
parse.c:build_translation_table:
 1069|      1|{
 1070|      1|    int             count;
 1071|       |
 1072|    257|    for (count = 0; count < 256; count++) {
  ------------------
  |  Branch (1072:21): [True: 256, False: 1]
  ------------------
 1073|    256|        switch (count) {
 1074|      1|        case OBJID:
  ------------------
  |  |  166|      1|#define OBJID       (4 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1074:9): [True: 1, False: 255]
  ------------------
 1075|      1|            translation_table[count] = TYPE_OBJID;
  ------------------
  |  |  154|      1|#define TYPE_OBJID          1
  ------------------
 1076|      1|            break;
 1077|      1|        case OCTETSTR:
  ------------------
  |  |  167|      1|#define OCTETSTR    (5 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1077:9): [True: 1, False: 255]
  ------------------
 1078|      1|            translation_table[count] = TYPE_OCTETSTR;
  ------------------
  |  |  155|      1|#define TYPE_OCTETSTR       2
  ------------------
 1079|      1|            break;
 1080|      1|        case INTEGER:
  ------------------
  |  |  168|      1|#define INTEGER     (6 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1080:9): [True: 1, False: 255]
  ------------------
 1081|      1|            translation_table[count] = TYPE_INTEGER;
  ------------------
  |  |  156|      1|#define TYPE_INTEGER        3
  ------------------
 1082|      1|            break;
 1083|      1|        case NETADDR:
  ------------------
  |  |  169|      1|#define NETADDR     (7 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1083:9): [True: 1, False: 255]
  ------------------
 1084|      1|            translation_table[count] = TYPE_NETADDR;
  ------------------
  |  |  157|      1|#define TYPE_NETADDR        4
  ------------------
 1085|      1|            break;
 1086|      1|        case IPADDR:
  ------------------
  |  |  170|      1|#define IPADDR      (8 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1086:9): [True: 1, False: 255]
  ------------------
 1087|      1|            translation_table[count] = TYPE_IPADDR;
  ------------------
  |  |  158|      1|#define TYPE_IPADDR         5
  ------------------
 1088|      1|            break;
 1089|      1|        case COUNTER:
  ------------------
  |  |  171|      1|#define COUNTER     (9 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1089:9): [True: 1, False: 255]
  ------------------
 1090|      1|            translation_table[count] = TYPE_COUNTER;
  ------------------
  |  |  159|      1|#define TYPE_COUNTER        6
  ------------------
 1091|      1|            break;
 1092|      1|        case GAUGE:
  ------------------
  |  |  172|      1|#define GAUGE       (10 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1092:9): [True: 1, False: 255]
  ------------------
 1093|      1|            translation_table[count] = TYPE_GAUGE;
  ------------------
  |  |  160|      1|#define TYPE_GAUGE          7
  ------------------
 1094|      1|            break;
 1095|      1|        case TIMETICKS:
  ------------------
  |  |  173|      1|#define TIMETICKS   (11 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1095:9): [True: 1, False: 255]
  ------------------
 1096|      1|            translation_table[count] = TYPE_TIMETICKS;
  ------------------
  |  |  161|      1|#define TYPE_TIMETICKS      8
  ------------------
 1097|      1|            break;
 1098|      1|        case KW_OPAQUE:
  ------------------
  |  |  174|      1|#define KW_OPAQUE   (12 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1098:9): [True: 1, False: 255]
  ------------------
 1099|      1|            translation_table[count] = TYPE_OPAQUE;
  ------------------
  |  |  162|      1|#define TYPE_OPAQUE         9
  ------------------
 1100|      1|            break;
 1101|      1|        case NUL:
  ------------------
  |  |  175|      1|#define NUL         (13 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1101:9): [True: 1, False: 255]
  ------------------
 1102|      1|            translation_table[count] = TYPE_NULL;
  ------------------
  |  |  163|      1|#define TYPE_NULL           10
  ------------------
 1103|      1|            break;
 1104|      1|        case COUNTER64:
  ------------------
  |  |  210|      1|#define COUNTER64   (43 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1104:9): [True: 1, False: 255]
  ------------------
 1105|      1|            translation_table[count] = TYPE_COUNTER64;
  ------------------
  |  |  164|      1|#define TYPE_COUNTER64      11
  ------------------
 1106|      1|            break;
 1107|      1|        case BITSTRING:
  ------------------
  |  |  208|      1|#define BITSTRING   (41 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1107:9): [True: 1, False: 255]
  ------------------
 1108|      1|            translation_table[count] = TYPE_BITSTRING;
  ------------------
  |  |  165|      1|#define TYPE_BITSTRING      12
  ------------------
 1109|      1|            break;
 1110|      1|        case NSAPADDRESS:
  ------------------
  |  |  209|      1|#define NSAPADDRESS (42 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1110:9): [True: 1, False: 255]
  ------------------
 1111|      1|            translation_table[count] = TYPE_NSAPADDRESS;
  ------------------
  |  |  166|      1|#define TYPE_NSAPADDRESS    13
  ------------------
 1112|      1|            break;
 1113|      1|        case INTEGER32:
  ------------------
  |  |  273|      1|#define INTEGER32	(105 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1113:9): [True: 1, False: 255]
  ------------------
 1114|      1|            translation_table[count] = TYPE_INTEGER32;
  ------------------
  |  |  169|      1|#define TYPE_INTEGER32      16
  ------------------
 1115|      1|            break;
 1116|      1|        case UINTEGER32:
  ------------------
  |  |  223|      1|#define UINTEGER32 (56 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1116:9): [True: 1, False: 255]
  ------------------
 1117|      1|            translation_table[count] = TYPE_UINTEGER;
  ------------------
  |  |  167|      1|#define TYPE_UINTEGER       14
  ------------------
 1118|      1|            break;
 1119|      1|        case UNSIGNED32:
  ------------------
  |  |  272|      1|#define UNSIGNED32	(104 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  156|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1119:9): [True: 1, False: 255]
  ------------------
 1120|      1|            translation_table[count] = TYPE_UNSIGNED32;
  ------------------
  |  |  168|      1|#define TYPE_UNSIGNED32     15
  ------------------
 1121|      1|            break;
 1122|      1|        case TRAPTYPE:
  ------------------
  |  |  228|      1|#define TRAPTYPE    61
  ------------------
  |  Branch (1122:9): [True: 1, False: 255]
  ------------------
 1123|      1|            translation_table[count] = TYPE_TRAPTYPE;
  ------------------
  |  |  173|      1|#define TYPE_TRAPTYPE	    20
  ------------------
 1124|      1|            break;
 1125|      1|        case NOTIFTYPE:
  ------------------
  |  |  212|      1|#define NOTIFTYPE   45
  ------------------
  |  Branch (1125:9): [True: 1, False: 255]
  ------------------
 1126|      1|            translation_table[count] = TYPE_NOTIFTYPE;
  ------------------
  |  |  174|      1|#define TYPE_NOTIFTYPE      21
  ------------------
 1127|      1|            break;
 1128|      1|        case NOTIFGROUP:
  ------------------
  |  |  257|      1|#define NOTIFGROUP  88
  ------------------
  |  Branch (1128:9): [True: 1, False: 255]
  ------------------
 1129|      1|            translation_table[count] = TYPE_NOTIFGROUP;
  ------------------
  |  |  176|      1|#define TYPE_NOTIFGROUP	    23
  ------------------
 1130|      1|            break;
 1131|      1|        case OBJGROUP:
  ------------------
  |  |  211|      1|#define OBJGROUP    44
  ------------------
  |  Branch (1131:9): [True: 1, False: 255]
  ------------------
 1132|      1|            translation_table[count] = TYPE_OBJGROUP;
  ------------------
  |  |  175|      1|#define TYPE_OBJGROUP	    22
  ------------------
 1133|      1|            break;
 1134|      1|        case MODULEIDENTITY:
  ------------------
  |  |  219|      1|#define MODULEIDENTITY 52
  ------------------
  |  Branch (1134:9): [True: 1, False: 255]
  ------------------
 1135|      1|            translation_table[count] = TYPE_MODID;
  ------------------
  |  |  177|      1|#define TYPE_MODID	    24
  ------------------
 1136|      1|            break;
 1137|      1|        case OBJIDENTITY:
  ------------------
  |  |  274|      1|#define OBJIDENTITY	106
  ------------------
  |  Branch (1137:9): [True: 1, False: 255]
  ------------------
 1138|      1|            translation_table[count] = TYPE_OBJIDENTITY;
  ------------------
  |  |  180|      1|#define TYPE_OBJIDENTITY    27
  ------------------
 1139|      1|            break;
 1140|      1|        case AGENTCAP:
  ------------------
  |  |  242|      1|#define AGENTCAP    73
  ------------------
  |  Branch (1140:9): [True: 1, False: 255]
  ------------------
 1141|      1|            translation_table[count] = TYPE_AGENTCAP;
  ------------------
  |  |  178|      1|#define TYPE_AGENTCAP       25
  ------------------
 1142|      1|            break;
 1143|      1|        case COMPLIANCE:
  ------------------
  |  |  214|      1|#define COMPLIANCE  47
  ------------------
  |  Branch (1143:9): [True: 1, False: 255]
  ------------------
 1144|      1|            translation_table[count] = TYPE_MODCOMP;
  ------------------
  |  |  179|      1|#define TYPE_MODCOMP        26
  ------------------
 1145|      1|            break;
 1146|    232|        default:
  ------------------
  |  Branch (1146:9): [True: 232, False: 24]
  ------------------
 1147|    232|            translation_table[count] = TYPE_OTHER;
  ------------------
  |  |  153|    232|#define TYPE_OTHER          0
  ------------------
 1148|    232|            break;
 1149|    256|        }
 1150|    256|    }
 1151|      1|}
parse.c:init_tree_roots:
 1155|      1|{
 1156|      1|    struct tree    *tp, *lasttp;
 1157|      1|    int             base_modid;
 1158|      1|    int             hash;
 1159|       |
 1160|      1|    base_modid = which_module("SNMPv2-SMI");
 1161|      1|    if (base_modid == -1)
  ------------------
  |  Branch (1161:9): [True: 1, False: 0]
  ------------------
 1162|      1|        base_modid = which_module("RFC1155-SMI");
 1163|      1|    if (base_modid == -1)
  ------------------
  |  Branch (1163:9): [True: 1, False: 0]
  ------------------
 1164|      1|        base_modid = which_module("RFC1213-MIB");
 1165|       |
 1166|       |    /*
 1167|       |     * build root node 
 1168|       |     */
 1169|      1|    tp = calloc(1, sizeof(struct tree));
 1170|      1|    if (tp == NULL)
  ------------------
  |  Branch (1170:9): [True: 0, False: 1]
  ------------------
 1171|      0|        return;
 1172|      1|    tp->label = strdup("joint-iso-ccitt");
 1173|      1|    tp->modid = base_modid;
 1174|      1|    tp->number_modules = 1;
 1175|      1|    tp->module_list = &(tp->modid);
 1176|      1|    tp->subid = 2;
 1177|      1|    tp->tc_index = -1;
 1178|      1|    set_function(tp);           /* from mib.c */
 1179|      1|    hash = NBUCKET(name_hash(tp->label));
  ------------------
  |  |  529|      1|#define NBUCKET(x)   (x & (NHASHSIZE-1))
  |  |  ------------------
  |  |  |  |  528|      1|#define NHASHSIZE    128
  |  |  ------------------
  ------------------
 1180|      1|    tp->next = tbuckets[hash];
 1181|      1|    tbuckets[hash] = tp;
 1182|      1|    lasttp = tp;
 1183|      1|    root_imports[0].label = strdup(tp->label);
 1184|      1|    root_imports[0].modid = base_modid;
 1185|       |
 1186|       |    /*
 1187|       |     * build root node 
 1188|       |     */
 1189|      1|    tp = calloc(1, sizeof(struct tree));
 1190|      1|    if (tp == NULL)
  ------------------
  |  Branch (1190:9): [True: 0, False: 1]
  ------------------
 1191|      0|        return;
 1192|      1|    tp->next_peer = lasttp;
 1193|      1|    tp->label = strdup("ccitt");
 1194|      1|    tp->modid = base_modid;
 1195|      1|    tp->number_modules = 1;
 1196|      1|    tp->module_list = &(tp->modid);
 1197|      1|    tp->subid = 0;
 1198|      1|    tp->tc_index = -1;
 1199|      1|    set_function(tp);           /* from mib.c */
 1200|      1|    hash = NBUCKET(name_hash(tp->label));
  ------------------
  |  |  529|      1|#define NBUCKET(x)   (x & (NHASHSIZE-1))
  |  |  ------------------
  |  |  |  |  528|      1|#define NHASHSIZE    128
  |  |  ------------------
  ------------------
 1201|      1|    tp->next = tbuckets[hash];
 1202|      1|    tbuckets[hash] = tp;
 1203|      1|    lasttp = tp;
 1204|      1|    root_imports[1].label = strdup(tp->label);
 1205|      1|    root_imports[1].modid = base_modid;
 1206|       |
 1207|       |    /*
 1208|       |     * build root node 
 1209|       |     */
 1210|      1|    tp = calloc(1, sizeof(struct tree));
 1211|      1|    if (tp == NULL)
  ------------------
  |  Branch (1211:9): [True: 0, False: 1]
  ------------------
 1212|      0|        return;
 1213|      1|    tp->next_peer = lasttp;
 1214|      1|    tp->label = strdup("iso");
 1215|      1|    tp->modid = base_modid;
 1216|      1|    tp->number_modules = 1;
 1217|      1|    tp->module_list = &(tp->modid);
 1218|      1|    tp->subid = 1;
 1219|      1|    tp->tc_index = -1;
 1220|      1|    set_function(tp);           /* from mib.c */
 1221|      1|    hash = NBUCKET(name_hash(tp->label));
  ------------------
  |  |  529|      1|#define NBUCKET(x)   (x & (NHASHSIZE-1))
  |  |  ------------------
  |  |  |  |  528|      1|#define NHASHSIZE    128
  |  |  ------------------
  ------------------
 1222|      1|    tp->next = tbuckets[hash];
 1223|      1|    tbuckets[hash] = tp;
 1224|      1|    lasttp = tp;
 1225|      1|    root_imports[2].label = strdup(tp->label);
 1226|      1|    root_imports[2].modid = base_modid;
 1227|       |
 1228|      1|    tree_head = tp;
 1229|      1|}
parse.c:compute_match:
 1273|    907|{
 1274|    907|#if defined(HAVE_REGEX_H) && defined(HAVE_REGCOMP)
 1275|    907|    int             rc;
 1276|    907|    regex_t         parsetree;
 1277|    907|    regmatch_t      pmatch;
 1278|    907|    rc = regcomp(&parsetree, key, REG_ICASE | REG_EXTENDED);
 1279|    907|    if (rc == 0)
  ------------------
  |  Branch (1279:9): [True: 877, False: 30]
  ------------------
 1280|    877|        rc = regexec(&parsetree, search_base, 1, &pmatch, 0);
 1281|    907|    regfree(&parsetree);
 1282|    907|    if (rc == 0) {
  ------------------
  |  Branch (1282:9): [True: 41, False: 866]
  ------------------
 1283|       |        /*
 1284|       |         * found 
 1285|       |         */
 1286|     41|        return pmatch.rm_so;
 1287|     41|    }
 1288|       |#else                           /* use our own wildcard matcher */
 1289|       |    /*
 1290|       |     * first find the longest matching substring (ick) 
 1291|       |     */
 1292|       |    char           *first = NULL, *result = NULL, *entry;
 1293|       |    const char     *position;
 1294|       |    char           *newkey = strdup(key);
 1295|       |    char           *st;
 1296|       |
 1297|       |
 1298|       |    entry = strtok_r(newkey, "*", &st);
 1299|       |    position = search_base;
 1300|       |    while (entry) {
 1301|       |        result = strcasestr(position, entry);
 1302|       |
 1303|       |        if (result == NULL) {
 1304|       |            free(newkey);
 1305|       |            return MAX_BAD;
 1306|       |        }
 1307|       |
 1308|       |        if (first == NULL)
 1309|       |            first = result;
 1310|       |
 1311|       |        position = result + strlen(entry);
 1312|       |        entry = strtok_r(NULL, "*", &st);
 1313|       |    }
 1314|       |    free(newkey);
 1315|       |    if (result)
 1316|       |        return (first - search_base);
 1317|       |#endif
 1318|       |
 1319|       |    /*
 1320|       |     * not found 
 1321|       |     */
 1322|    866|    return MAX_BAD;
  ------------------
  |  | 1269|    866|#define MAX_BAD 0xffffff
  ------------------
 1323|    907|}
parse.c:read_module_internal:
 3902|    172|{
 3903|    172|    struct module  *mp;
 3904|    172|    FILE           *fp;
 3905|    172|    struct node    *np;
 3906|       |
 3907|    172|    netsnmp_init_mib_internals();
 3908|       |
 3909|    172|    for (mp = module_head; mp; mp = mp->next)
  ------------------
  |  Branch (3909:28): [True: 0, False: 172]
  ------------------
 3910|      0|        if (!label_compare(mp->name, name)) {
  ------------------
  |  | 1234|      0|#define	label_compare	strcmp
  ------------------
  |  Branch (3910:13): [True: 0, False: 0]
  ------------------
 3911|      0|            const char     *oldFile = File;
 3912|      0|            int             oldLine = mibLine;
 3913|      0|            int             oldModule = current_module;
 3914|       |
 3915|      0|            if (mp->no_imports != -1) {
  ------------------
  |  Branch (3915:17): [True: 0, False: 0]
  ------------------
 3916|      0|                DEBUGMSGTL(("parse-mibs", "Module %s already loaded\n",
  ------------------
  |  |   68|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3917|      0|                            name));
 3918|      0|                return MODULE_ALREADY_LOADED;
  ------------------
  |  |  514|      0|#define MODULE_ALREADY_LOADED	2
  ------------------
 3919|      0|            }
 3920|      0|            if ((fp = fopen(mp->file, "r")) == NULL) {
  ------------------
  |  Branch (3920:17): [True: 0, False: 0]
  ------------------
 3921|      0|                int rval;
 3922|      0|                if (errno == ENOTDIR || errno == ENOENT)
  ------------------
  |  Branch (3922:21): [True: 0, False: 0]
  |  Branch (3922:41): [True: 0, False: 0]
  ------------------
 3923|      0|                    rval = MODULE_NOT_FOUND;
  ------------------
  |  |  512|      0|#define MODULE_NOT_FOUND	0
  ------------------
 3924|      0|                else
 3925|      0|                    rval = MODULE_LOAD_FAILED;
  ------------------
  |  |  518|      0|#define MODULE_LOAD_FAILED	MODULE_NOT_FOUND
  |  |  ------------------
  |  |  |  |  512|      0|#define MODULE_NOT_FOUND	0
  |  |  ------------------
  ------------------
 3926|      0|                snmp_log_perror(mp->file);
 3927|      0|                return rval;
 3928|      0|            }
 3929|      0|#ifdef HAVE_FLOCKFILE
 3930|      0|            flockfile(fp);
 3931|      0|#endif
 3932|      0|            mp->no_imports = 0; /* Note that we've read the file */
 3933|      0|            File = mp->file;
 3934|      0|            mibLine = 1;
 3935|      0|            current_module = mp->modid;
 3936|       |            /*
 3937|       |             * Parse the file
 3938|       |             */
 3939|      0|            np = parse(fp, NULL);
 3940|      0|#ifdef HAVE_FUNLOCKFILE
 3941|      0|            funlockfile(fp);
 3942|      0|#endif
 3943|      0|            fclose(fp);
 3944|      0|            File = oldFile;
 3945|      0|            mibLine = oldLine;
 3946|      0|            current_module = oldModule;
 3947|      0|            if ((np == NULL) && (gMibError == MODULE_SYNTAX_ERROR) )
  ------------------
  |  |  519|      0|#define MODULE_SYNTAX_ERROR     4
  ------------------
  |  Branch (3947:17): [True: 0, False: 0]
  |  Branch (3947:33): [True: 0, False: 0]
  ------------------
 3948|      0|                return MODULE_SYNTAX_ERROR;
  ------------------
  |  |  519|      0|#define MODULE_SYNTAX_ERROR     4
  ------------------
 3949|      0|            return MODULE_LOADED_OK;
  ------------------
  |  |  513|      0|#define MODULE_LOADED_OK	1
  ------------------
 3950|      0|        }
 3951|       |
 3952|    172|    return MODULE_NOT_FOUND;
  ------------------
  |  |  512|    172|#define MODULE_NOT_FOUND	0
  ------------------
 3953|    172|}
parse.c:print_error:
  778|    151|{
  779|    151|    erroneousMibs++;
  780|    151|    if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
  ------------------
  |  |   48|    151|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
  |  Branch (780:9): [True: 151, False: 0]
  ------------------
  781|    151|                                NETSNMP_DS_LIB_MIB_ERRORS))
  ------------------
  |  |   59|    151|#define NETSNMP_DS_LIB_MIB_ERRORS          0
  ------------------
  782|    151|	return;
  783|      0|    DEBUGMSGTL(("parse-mibs", "\n"));
  ------------------
  |  |   68|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  146|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  166|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:70): [Folded - Ignored]
  |  |  ------------------
  ------------------
  784|      0|    if (type == ENDOFFILE)
  ------------------
  |  |  162|      0|#define ENDOFFILE   0
  ------------------
  |  Branch (784:9): [True: 0, False: 0]
  ------------------
  785|      0|        snmp_log(LOG_ERR, "%s (EOF): At line %d in %s\n", str, mibLine,
  786|      0|                 File);
  787|      0|    else if (token && *token)
  ------------------
  |  Branch (787:14): [True: 0, False: 0]
  |  Branch (787:23): [True: 0, False: 0]
  ------------------
  788|      0|        snmp_log(LOG_ERR, "%s (%s): At line %d in %s\n", str, token,
  789|      0|                 mibLine, File);
  790|      0|    else
  791|      0|        snmp_log(LOG_ERR, "%s: At line %d in %s\n", str, mibLine, File);
  792|      0|}
parse.c:read_module_replacements:
 3833|    172|{
 3834|    172|    struct module_compatability *mcp;
 3835|       |
 3836|  3.76k|    for (mcp = module_map_head; mcp; mcp = mcp->next) {
  ------------------
  |  Branch (3836:33): [True: 3.60k, False: 160]
  ------------------
 3837|  3.60k|        if (!label_compare(mcp->old_module, name)) {
  ------------------
  |  | 1234|  3.60k|#define	label_compare	strcmp
  ------------------
  |  Branch (3837:13): [True: 12, False: 3.59k]
  ------------------
 3838|     12|            if (netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, 
  ------------------
  |  |   48|     12|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
  |  Branch (3838:17): [True: 0, False: 12]
  ------------------
 3839|     12|				   NETSNMP_DS_LIB_MIB_WARNINGS)) {
  ------------------
  |  |  113|     12|#define NETSNMP_DS_LIB_MIB_WARNINGS         0
  ------------------
 3840|      0|                snmp_log(LOG_WARNING,
 3841|      0|                         "Loading replacement module %s for %s (%s)\n",
 3842|      0|                         mcp->new_module, name, File);
 3843|      0|	    }
 3844|     12|            (void) netsnmp_read_module(mcp->new_module);
 3845|     12|            return 1;
 3846|     12|        }
 3847|  3.60k|    }
 3848|    160|    return 0;
 3849|    172|}
parse.c:print_module_not_found:
  796|    160|{
  797|    160|    if (first_err_module) {
  ------------------
  |  Branch (797:9): [True: 1, False: 159]
  ------------------
  798|      1|        snmp_log(LOG_ERR, "MIB search path: %s\n",
  799|      1|                           netsnmp_get_mib_directory());
  800|      1|        first_err_module = 0;
  801|      1|    }
  802|    160|    if (!last_err_module || strcmp(cp, last_err_module))
  ------------------
  |  Branch (802:9): [True: 1, False: 159]
  |  Branch (802:29): [True: 150, False: 9]
  ------------------
  803|    151|        print_error("Cannot find module", cp, CONTINUE);
  ------------------
  |  |  161|    151|#define CONTINUE    -1
  ------------------
  804|    160|    if (last_err_module)
  ------------------
  |  Branch (804:9): [True: 159, False: 1]
  ------------------
  805|    159|        free(last_err_module);
  806|    160|    last_err_module = strdup(cp);
  807|    160|}

snmp_set_detail:
  516|    311|{
  517|    311|    if (detail_string != NULL) {
  ------------------
  |  Branch (517:9): [True: 311, False: 0]
  ------------------
  518|    311|        strlcpy(snmp_detail, detail_string, sizeof(snmp_detail));
  519|    311|        snmp_detail_f = 1;
  520|    311|    }
  521|    311|}

snmp_get_do_debugging:
  547|    489|{
  548|    489|    return dodebug;
  549|    489|}

netsnmp_set_line_buffering:
  187|      1|{
  188|       |#if defined(WIN32)
  189|       |    /*
  190|       |     * According to MSDN, the Microsoft Visual Studio C runtime library does
  191|       |     * not support line buffering, so turn off buffering completely.
  192|       |     * See also http://msdn.microsoft.com/en-us/library/86cebhfs(VS.71).aspx.
  193|       |     */
  194|       |    setvbuf(stream, NULL, _IONBF, BUFSIZ);
  195|       |#elif defined(HAVE_SETLINEBUF)
  196|       |    /* setlinefunction() is a function from the BSD Unix API. */
  197|       |    setlinebuf(stream);
  198|       |#else
  199|       |    /* See also the C89 or C99 standard for more information about setvbuf(). */
  200|      1|    setvbuf(stream, NULL, _IOLBF, BUFSIZ);
  201|      1|#endif
  202|      1|}
log_handler_stdouterr:
 1093|      1|{
 1094|      1|    static int      newline = 1;	 /* MTCRITICAL_RESOURCE */
 1095|      1|    const char     *newline_ptr;
 1096|      1|    char            sbuf[40];
 1097|       |
 1098|      1|    if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, 
  ------------------
  |  |   48|      1|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
  |  Branch (1098:9): [True: 0, False: 1]
  ------------------
 1099|      1|                               NETSNMP_DS_LIB_LOG_TIMESTAMP) && newline) {
  ------------------
  |  |   64|      1|#define NETSNMP_DS_LIB_LOG_TIMESTAMP       5
  ------------------
  |  Branch (1099:65): [True: 0, False: 0]
  ------------------
 1100|      0|        sprintf_stamp(NULL, sbuf);
 1101|      1|    } else {
 1102|      1|        strcpy(sbuf, "");
 1103|      1|    }
 1104|       |    /*
 1105|       |     * Remember whether or not the current line ends with a newline for the
 1106|       |     * next call of log_handler_stdouterr().
 1107|       |     */
 1108|      1|    newline_ptr = strrchr(str, '\n');
 1109|      1|    newline = newline_ptr && newline_ptr[1] == 0;
  ------------------
  |  Branch (1109:15): [True: 1, False: 0]
  |  Branch (1109:30): [True: 1, False: 0]
  ------------------
 1110|       |
 1111|      1|    if (logh->imagic)
  ------------------
  |  Branch (1111:9): [True: 0, False: 1]
  ------------------
 1112|      0|       printf(         "%s%s", sbuf, str);
 1113|      1|    else
 1114|      1|       fprintf(stderr, "%s%s", sbuf, str);
 1115|       |
 1116|      1|    return 1;
 1117|      1|}
snmp_log_string:
 1284|      1|{
 1285|      1|#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
 1286|      1|    static int stderr_enabled = 0;
 1287|      1|    static netsnmp_log_handler lh = { 1, 0, 0, 0, "stderr",
 1288|      1|                                      log_handler_stdouterr, 0, NULL,  NULL,
 1289|      1|                                      NULL };
 1290|      1|#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
 1291|      1|    netsnmp_log_handler *logh;
 1292|       |
 1293|       |    /*
 1294|       |     * We've got to be able to log messages *somewhere*!
 1295|       |     * If you don't want stderr logging, then enable something else.
 1296|       |     */
 1297|      1|    if (0 == logh_enabled) {
  ------------------
  |  Branch (1297:9): [True: 1, False: 0]
  ------------------
 1298|      1|#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
 1299|      1|        if (!stderr_enabled) {
  ------------------
  |  Branch (1299:13): [True: 1, False: 0]
  ------------------
 1300|      1|            ++stderr_enabled;
 1301|      1|            netsnmp_set_line_buffering(stderr);
 1302|      1|        }
 1303|      1|        log_handler_stdouterr( &lh, priority, str );
 1304|      1|#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
 1305|       |
 1306|      1|        return;
 1307|      1|    }
 1308|      0|#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
 1309|      0|    else if (stderr_enabled) {
  ------------------
  |  Branch (1309:14): [True: 0, False: 0]
  ------------------
 1310|      0|        stderr_enabled = 0;
 1311|      0|        log_handler_stdouterr( &lh, LOG_INFO,
 1312|      0|                               "Log handling defined - disabling stderr\n" );
 1313|      0|    }
 1314|      0|#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
 1315|       |        
 1316|       |
 1317|       |    /*
 1318|       |     * Start at the given priority, and work "upwards"....
 1319|       |     */
 1320|      0|    if (priority > LOG_DEBUG)
  ------------------
  |  Branch (1320:9): [True: 0, False: 0]
  ------------------
 1321|      0|        priority = LOG_DEBUG;
 1322|      0|    logh = logh_priorities[priority];
 1323|      0|    for ( ; logh; logh = logh->next ) {
  ------------------
  |  Branch (1323:13): [True: 0, False: 0]
  ------------------
 1324|       |        /*
 1325|       |         * ... but skipping any handlers with a "maximum priority"
 1326|       |         *     that we have already exceeded. And don't forget to
 1327|       |         *     ensure this logging is turned on (see snmp_disable_stderrlog
 1328|       |         *     and its cohorts).
 1329|       |         */
 1330|      0|        if (logh->enabled && (priority >= logh->pri_max))
  ------------------
  |  Branch (1330:13): [True: 0, False: 0]
  |  Branch (1330:30): [True: 0, False: 0]
  ------------------
 1331|      0|            logh->handler( logh, priority, str );
 1332|      0|    }
 1333|      0|}
snmp_vlog:
 1371|      1|{
 1372|      1|    char           *buffer = NULL;
 1373|      1|    int             length;
 1374|       |
 1375|      1|    length = vasprintf(&buffer, format, ap);
 1376|      1|    if (length < 0) {
  ------------------
  |  Branch (1376:9): [True: 0, False: 1]
  ------------------
 1377|      0|        snmp_log_string(LOG_ERR, "Could not format log-string\n");
 1378|      0|        return -1;
 1379|      0|    }
 1380|       |
 1381|      1|    snmp_log_string(priority, buffer);
 1382|      1|    free(buffer);
 1383|      1|    return 0;
 1384|      1|}
snmp_log:
 1395|      1|{
 1396|      1|    va_list         ap;
 1397|      1|    int             ret;
 1398|      1|    va_start(ap, format);
 1399|      1|    ret = snmp_vlog(priority, format, ap);
 1400|      1|    va_end(ap);
 1401|      1|    return (ret);
 1402|      1|}

strlcpy:
   26|    311|{ 
   27|    311|	size_t src_len = strlen(src); 
   28|    311|	size_t new_len; 
   29|       |
   30|    311|	if (len == 0) {
  ------------------
  |  Branch (30:6): [True: 0, False: 311]
  ------------------
   31|      0|		return (src_len);
   32|      0|	}
   33|       |
   34|    311|        if (src_len >= len) {
  ------------------
  |  Branch (34:13): [True: 9, False: 302]
  ------------------
   35|      9|		new_len = len - 1;
   36|    302|	} else {
   37|    302|                new_len = src_len;
   38|    302|	}
   39|       |
   40|    311|        memcpy(dest, src, new_len); 
   41|    311|	dest[new_len] = '\0'; 
   42|    311|	return (src_len); 
   43|    311|}

netsnmp_getenv:
 1181|      1|{
 1182|      1|#if !defined (WIN32) && !defined (cygwin)
 1183|      1|  return (getenv(name));
 1184|       |#else
 1185|       |  char *temp = NULL;  
 1186|       |  HKEY hKey;
 1187|       |  unsigned char * key_value = NULL;
 1188|       |  DWORD key_value_size = 0;
 1189|       |  DWORD key_value_type = 0;
 1190|       |  DWORD getenv_worked = 0;
 1191|       |
 1192|       |  DEBUGMSGTL(("read_config", "netsnmp_getenv called with name: %s\n",name));
 1193|       |
 1194|       |  if (!(name))
 1195|       |    return NULL;
 1196|       |  
 1197|       |  /* Try environment variable first */ 
 1198|       |  temp = getenv(name);
 1199|       |  if (temp) {
 1200|       |    getenv_worked = 1;
 1201|       |    DEBUGMSGTL(("read_config", "netsnmp_getenv will return from ENV: %s\n",temp));
 1202|       |  }
 1203|       |  
 1204|       |  /* Next try HKCU */
 1205|       |  if (temp == NULL)
 1206|       |  {
 1207|       |    if (getenv("SNMP_IGNORE_WINDOWS_REGISTRY"))
 1208|       |      return NULL;
 1209|       |
 1210|       |    if (RegOpenKeyExA(
 1211|       |          HKEY_CURRENT_USER, 
 1212|       |          "SOFTWARE\\Net-SNMP", 
 1213|       |          0, 
 1214|       |          KEY_QUERY_VALUE, 
 1215|       |          &hKey) == ERROR_SUCCESS) {   
 1216|       |      
 1217|       |      if (RegQueryValueExA(
 1218|       |            hKey, 
 1219|       |            name, 
 1220|       |            NULL, 
 1221|       |            &key_value_type, 
 1222|       |            NULL,               /* Just get the size */
 1223|       |            &key_value_size) == ERROR_SUCCESS) {
 1224|       |
 1225|       |        SNMP_FREE(key_value);
 1226|       |
 1227|       |        /* Allocate memory needed +1 to allow RegQueryValueExA to NULL terminate the
 1228|       |         * string data in registry is missing one (which is unlikely).
 1229|       |         */
 1230|       |        key_value = malloc((sizeof(char) * key_value_size)+sizeof(char));
 1231|       |        
 1232|       |        if (RegQueryValueExA(
 1233|       |              hKey, 
 1234|       |              name, 
 1235|       |              NULL, 
 1236|       |              &key_value_type, 
 1237|       |              key_value, 
 1238|       |              &key_value_size) == ERROR_SUCCESS) {
 1239|       |        }
 1240|       |        temp = (char *) key_value;
 1241|       |      }
 1242|       |      RegCloseKey(hKey);
 1243|       |      if (temp)
 1244|       |        DEBUGMSGTL(("read_config", "netsnmp_getenv will return from HKCU: %s\n",temp));
 1245|       |    }
 1246|       |  }
 1247|       |
 1248|       |  /* Next try HKLM */
 1249|       |  if (temp == NULL)
 1250|       |  {
 1251|       |    if (RegOpenKeyExA(
 1252|       |          HKEY_LOCAL_MACHINE, 
 1253|       |          "SOFTWARE\\Net-SNMP", 
 1254|       |          0, 
 1255|       |          KEY_QUERY_VALUE, 
 1256|       |          &hKey) == ERROR_SUCCESS) {   
 1257|       |      
 1258|       |      if (RegQueryValueExA(
 1259|       |            hKey, 
 1260|       |            name, 
 1261|       |            NULL, 
 1262|       |            &key_value_type, 
 1263|       |            NULL,               /* Just get the size */
 1264|       |            &key_value_size) == ERROR_SUCCESS) {
 1265|       |
 1266|       |        SNMP_FREE(key_value);
 1267|       |
 1268|       |        /* Allocate memory needed +1 to allow RegQueryValueExA to NULL terminate the
 1269|       |         * string data in registry is missing one (which is unlikely).
 1270|       |         */
 1271|       |        key_value = malloc((sizeof(char) * key_value_size)+sizeof(char));
 1272|       |        
 1273|       |        if (RegQueryValueExA(
 1274|       |              hKey, 
 1275|       |              name, 
 1276|       |              NULL, 
 1277|       |              &key_value_type, 
 1278|       |              key_value, 
 1279|       |              &key_value_size) == ERROR_SUCCESS) {
 1280|       |        }
 1281|       |        temp = (char *) key_value;
 1282|       |
 1283|       |      }
 1284|       |      RegCloseKey(hKey);
 1285|       |      if (temp)
 1286|       |        DEBUGMSGTL(("read_config", "netsnmp_getenv will return from HKLM: %s\n",temp));
 1287|       |    }
 1288|       |  }
 1289|       |  
 1290|       |  if (temp && !getenv_worked) {
 1291|       |    setenv(name, temp, 1);
 1292|       |    SNMP_FREE(temp);
 1293|       |  }
 1294|       |
 1295|       |  DEBUGMSGTL(("read_config", "netsnmp_getenv returning: %s\n",getenv(name)));
 1296|       |
 1297|       |  return(getenv(name));
 1298|       |#endif
 1299|      1|}

LLVMFuzzerInitialize:
   36|      2|int LLVMFuzzerInitialize(int *argc, char ***argv) {
   37|      2|    if (getenv("NETSNMP_DEBUGGING") != NULL) {
  ------------------
  |  Branch (37:9): [True: 0, False: 2]
  ------------------
   38|       |        /*
   39|       |         * Turn on all debugging, to help understand what
   40|       |         * bits of the parser are running.
   41|       |         */
   42|      0|        snmp_enable_stderrlog();
   43|      0|        snmp_set_do_debugging(1);
   44|      0|        debug_register_tokens("");
   45|      0|    }
   46|      2|    return 0;
   47|      2|}
LLVMFuzzerTestOneInput:
   53|    567|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   54|    567|    oid *root = malloc(MAX_OID_LEN * sizeof(oid));
  ------------------
  |  |  103|    567|#define MAX_OID_LEN	    128 /* max subid's in an oid */
  ------------------
   55|    567|    size_t rootlen = MAX_OID_LEN;
  ------------------
  |  |  103|    567|#define MAX_OID_LEN	    128 /* max subid's in an oid */
  ------------------
   56|    567|    char *input;
   57|       |
   58|    567|    input = strndup((const char *)data, size);
   59|    567|    if (root && input)
  ------------------
  |  Branch (59:9): [True: 567, False: 0]
  |  Branch (59:17): [True: 567, False: 0]
  ------------------
   60|    567|        snmp_parse_oid((const char *)input, root, &rootlen);
   61|    567|    free(root);
   62|    567|    free(input);
   63|    567|    return 0; 
   64|    567|}

