netsnmp_ds_get_boolean:
  242|  2.38k|{
  243|  2.38k|    if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS || 
  ------------------
  |  |   38|  4.76k|#define NETSNMP_DS_MAX_IDS 3
  ------------------
  |  Branch (243:9): [True: 0, False: 2.38k]
  |  Branch (243:24): [True: 0, False: 2.38k]
  ------------------
  244|  2.38k|	which   < 0 || which   >= NETSNMP_DS_MAX_SUBIDS) {
  ------------------
  |  |   39|  2.38k|#define NETSNMP_DS_MAX_SUBIDS 64        /* needs to be a multiple of 8 */
  ------------------
  |  Branch (244:2): [True: 0, False: 2.38k]
  |  Branch (244:17): [True: 0, False: 2.38k]
  ------------------
  245|      0|        return SNMPERR_GENERR;
  ------------------
  |  |  185|      0|#define SNMPERR_GENERR			(-1)
  ------------------
  246|      0|    }
  247|       |
  248|  2.38k|    return (netsnmp_ds_booleans[storeid][which/8] & (1 << (which % 8))) ? 1:0;
  ------------------
  |  Branch (248:12): [True: 0, False: 2.38k]
  ------------------
  249|  2.38k|}
netsnmp_ds_get_int:
  268|     10|{
  269|     10|    if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS || 
  ------------------
  |  |   38|     20|#define NETSNMP_DS_MAX_IDS 3
  ------------------
  |  Branch (269:9): [True: 0, False: 10]
  |  Branch (269:24): [True: 0, False: 10]
  ------------------
  270|     10|	which   < 0 || which   >= NETSNMP_DS_MAX_SUBIDS) {
  ------------------
  |  |   39|     10|#define NETSNMP_DS_MAX_SUBIDS 64        /* needs to be a multiple of 8 */
  ------------------
  |  Branch (270:2): [True: 0, False: 10]
  |  Branch (270:17): [True: 0, False: 10]
  ------------------
  271|      0|        return SNMPERR_GENERR;
  ------------------
  |  |  185|      0|#define SNMPERR_GENERR			(-1)
  ------------------
  272|      0|    }
  273|       |
  274|     10|    return netsnmp_ds_integers[storeid][which];
  275|     10|}
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 64        /* 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;
  ------------------
  |  |  185|      0|#define SNMPERR_GENERR			(-1)
  ------------------
  283|      0|    }
  284|       |
  285|      1|    DEBUGMSGTL(("netsnmp_ds_set_string", "Setting %s:%d = \"%s\"\n",
  ------------------
  |  |   66|      1|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      1|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  164|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (164:52): [True: 0, False: 0]
  |  |  |  |  |  Branch (164:64): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 1]
  |  |  ------------------
  ------------------
  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;
  ------------------
  |  |  184|      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, False: 1]
  |  |  ------------------
  ------------------
  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, False: 1]
  |  |  ------------------
  ------------------
  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;
  ------------------
  |  |  184|      1|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  ------------------
  308|      1|}
netsnmp_ds_get_string:
  312|  1.15k|{
  313|  1.15k|    if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS || 
  ------------------
  |  |   38|  2.30k|#define NETSNMP_DS_MAX_IDS 3
  ------------------
  |  Branch (313:9): [True: 0, False: 1.15k]
  |  Branch (313:24): [True: 0, False: 1.15k]
  ------------------
  314|  1.15k|	which   < 0 || which   >= NETSNMP_DS_MAX_SUBIDS) {
  ------------------
  |  |   39|  1.15k|#define NETSNMP_DS_MAX_SUBIDS 64        /* needs to be a multiple of 8 */
  ------------------
  |  Branch (314:2): [True: 0, False: 1.15k]
  |  Branch (314:17): [True: 0, False: 1.15k]
  ------------------
  315|      0|        return NULL;
  316|      0|    }
  317|       |
  318|  1.15k|    return netsnmp_ds_strings[storeid][which];
  319|  1.15k|}

netsnmp_set_mib_directory:
 2558|      1|{
 2559|      1|    const char *newdir;
 2560|      1|    char *olddir, *tmpdir = NULL;
 2561|       |
 2562|      1|    DEBUGTRACE;
  ------------------
  |  |   63|      1|#define DEBUGTRACE         do {if (_DBG_IF_) {__DBGTRACE;} }while(0)
  |  |  ------------------
  |  |  |  |  144|      1|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGTRACE         do {if (_DBG_IF_) {__DBGTRACE;} }while(0)
  |  |  ------------------
  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (63:67): [Folded, False: 1]
  |  |  ------------------
  ------------------
 2563|      1|    if (NULL == dir) {
  ------------------
  |  Branch (2563:9): [True: 0, False: 1]
  ------------------
 2564|      0|        return;
 2565|      0|    }
 2566|       |    
 2567|      1|    olddir = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
  ------------------
  |  |   48|      1|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
 2568|      1|				   NETSNMP_DS_LIB_MIBDIRS);
  ------------------
  |  |  162|      1|#define NETSNMP_DS_LIB_MIBDIRS           11
  ------------------
 2569|      1|    if (olddir) {
  ------------------
  |  Branch (2569:9): [True: 0, False: 1]
  ------------------
 2570|      0|        if ((*dir == '+') || (*dir == '-')) {
  ------------------
  |  Branch (2570:13): [True: 0, False: 0]
  |  Branch (2570:30): [True: 0, False: 0]
  ------------------
 2571|       |            /** New dir starts with '+', thus we add it. */
 2572|      0|            if (*dir++ == '+') {
  ------------------
  |  Branch (2572:17): [True: 0, False: 0]
  ------------------
 2573|      0|                if (asprintf(&tmpdir, "%s%c%s", olddir, ENV_SEPARATOR_CHAR, dir) < 0)
  ------------------
  |  |   70|      0|#define ENV_SEPARATOR_CHAR ':'
  ------------------
  |  Branch (2573:21): [True: 0, False: 0]
  ------------------
 2574|      0|                    tmpdir = NULL;
 2575|      0|            } else {
 2576|      0|                if (asprintf(&tmpdir, "%s%c%s", dir, ENV_SEPARATOR_CHAR, olddir) < 0)
  ------------------
  |  |   70|      0|#define ENV_SEPARATOR_CHAR ':'
  ------------------
  |  Branch (2576:21): [True: 0, False: 0]
  ------------------
 2577|      0|                    tmpdir = NULL;
 2578|      0|            }
 2579|      0|            if (!tmpdir) {
  ------------------
  |  Branch (2579:17): [True: 0, False: 0]
  ------------------
 2580|      0|                DEBUGMSGTL(("read_config:initmib", "set mibdir malloc failed"));
  ------------------
  |  |   66|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  164|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2581|      0|                return;
 2582|      0|            }
 2583|      0|            newdir = tmpdir;
 2584|      0|        } else {
 2585|      0|            newdir = dir;
 2586|      0|        }
 2587|      1|    } else {
 2588|       |        /** If dir starts with '+' skip '+' it. */
 2589|      1|        newdir = ((*dir == '+') ? ++dir : dir);
  ------------------
  |  Branch (2589:19): [True: 0, False: 1]
  ------------------
 2590|      1|    }
 2591|      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,
  ------------------
  |  |  162|      1|#define NETSNMP_DS_LIB_MIBDIRS           11
  ------------------
 2592|      1|                          newdir);
 2593|       |
 2594|       |    /** set_string calls strdup, so if we allocated memory, free it */
 2595|      1|    if (tmpdir == newdir) {
  ------------------
  |  Branch (2595:9): [True: 0, False: 1]
  ------------------
 2596|       |        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, False: 0]
  |  |  ------------------
  ------------------
 2597|      0|    }
 2598|      1|}
netsnmp_get_mib_directory:
 2615|      1|{
 2616|      1|    char *dir;
 2617|       |
 2618|      1|    DEBUGTRACE;
  ------------------
  |  |   63|      1|#define DEBUGTRACE         do {if (_DBG_IF_) {__DBGTRACE;} }while(0)
  |  |  ------------------
  |  |  |  |  144|      1|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGTRACE         do {if (_DBG_IF_) {__DBGTRACE;} }while(0)
  |  |  ------------------
  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (63:67): [Folded, False: 1]
  |  |  ------------------
  ------------------
 2619|      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);
  ------------------
  |  |  162|      1|#define NETSNMP_DS_LIB_MIBDIRS           11
  ------------------
 2620|      1|    if (dir == NULL) {
  ------------------
  |  Branch (2620:9): [True: 1, False: 0]
  ------------------
 2621|      1|        DEBUGMSGTL(("get_mib_directory", "no mib directories set\n"));
  ------------------
  |  |   66|      1|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      1|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  164|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 1]
  |  |  ------------------
  ------------------
 2622|       |
 2623|       |        /** Check if the environment variable is set */
 2624|      1|        dir = netsnmp_getenv("MIBDIRS");
 2625|      1|        if (dir == NULL) {
  ------------------
  |  Branch (2625:13): [True: 1, False: 0]
  ------------------
 2626|      1|            DEBUGMSGTL(("get_mib_directory", "no mib directories set by environment\n"));
  ------------------
  |  |   66|      1|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      1|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  164|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 1]
  |  |  ------------------
  ------------------
 2627|       |            /** Not set use hard coded path */
 2628|      1|            if (confmibdir == NULL) {
  ------------------
  |  Branch (2628:17): [True: 1, False: 0]
  ------------------
 2629|      1|                DEBUGMSGTL(("get_mib_directory", "no mib directories set by config\n"));
  ------------------
  |  |   66|      1|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      1|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  164|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 1]
  |  |  ------------------
  ------------------
 2630|      1|                netsnmp_set_mib_directory(NETSNMP_DEFAULT_MIBDIRS);
  ------------------
  |  | 1669|      1|#define NETSNMP_DEFAULT_MIBDIRS "$HOME/.snmp/mibs:/usr/local/net-snmp-master/share/snmp/mibs"
  ------------------
 2631|      1|            }
 2632|      0|            else if ((*confmibdir == '+') || (*confmibdir == '-')) {
  ------------------
  |  Branch (2632:22): [True: 0, False: 0]
  |  Branch (2632:46): [True: 0, False: 0]
  ------------------
 2633|      0|                DEBUGMSGTL(("get_mib_directory", "mib directories set by config (but added)\n"));
  ------------------
  |  |   66|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  164|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2634|      0|                netsnmp_set_mib_directory(NETSNMP_DEFAULT_MIBDIRS);
  ------------------
  |  | 1669|      0|#define NETSNMP_DEFAULT_MIBDIRS "$HOME/.snmp/mibs:/usr/local/net-snmp-master/share/snmp/mibs"
  ------------------
 2635|      0|                netsnmp_set_mib_directory(confmibdir);
 2636|      0|            }
 2637|      0|            else {
 2638|      0|                DEBUGMSGTL(("get_mib_directory", "mib directories set by config\n"));
  ------------------
  |  |   66|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  164|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2639|      0|                netsnmp_set_mib_directory(confmibdir);
 2640|      0|            }
 2641|      1|        } else if ((*dir == '+') || (*dir == '-')) {
  ------------------
  |  Branch (2641:20): [True: 0, False: 0]
  |  Branch (2641:37): [True: 0, False: 0]
  ------------------
 2642|      0|            DEBUGMSGTL(("get_mib_directory", "mib directories set by environment (but added)\n"));
  ------------------
  |  |   66|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  164|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2643|      0|            netsnmp_set_mib_directory(NETSNMP_DEFAULT_MIBDIRS);
  ------------------
  |  | 1669|      0|#define NETSNMP_DEFAULT_MIBDIRS "$HOME/.snmp/mibs:/usr/local/net-snmp-master/share/snmp/mibs"
  ------------------
 2644|      0|            netsnmp_set_mib_directory(dir);
 2645|      0|        } else {
 2646|      0|            DEBUGMSGTL(("get_mib_directory", "mib directories set by environment\n"));
  ------------------
  |  |   66|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  164|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2647|      0|            netsnmp_set_mib_directory(dir);
 2648|      0|        }
 2649|      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);
  ------------------
  |  |  162|      1|#define NETSNMP_DS_LIB_MIBDIRS           11
  ------------------
 2650|      1|    }
 2651|      1|    DEBUGMSGTL(("get_mib_directory", "mib directories set '%s'\n", dir));
  ------------------
  |  |   66|      1|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      1|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  164|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 1]
  |  |  ------------------
  ------------------
 2652|      1|    return(dir);
 2653|      1|}
set_function:
 2947|      3|{
 2948|      3|    subtree->printer = NULL;
 2949|      3|    switch (subtree->type) {
 2950|      0|    case TYPE_OBJID:
  ------------------
  |  |  155|      0|#define TYPE_OBJID          1
  ------------------
  |  Branch (2950:5): [True: 0, False: 3]
  ------------------
 2951|      0|        subtree->printomat = sprint_realloc_object_identifier;
 2952|      0|        break;
 2953|      0|    case TYPE_OCTETSTR:
  ------------------
  |  |  156|      0|#define TYPE_OCTETSTR       2
  ------------------
  |  Branch (2953:5): [True: 0, False: 3]
  ------------------
 2954|      0|        subtree->printomat = sprint_realloc_octet_string;
 2955|      0|        break;
 2956|      0|    case TYPE_INTEGER:
  ------------------
  |  |  157|      0|#define TYPE_INTEGER        3
  ------------------
  |  Branch (2956:5): [True: 0, False: 3]
  ------------------
 2957|      0|        subtree->printomat = sprint_realloc_integer;
 2958|      0|        break;
 2959|      0|    case TYPE_INTEGER32:
  ------------------
  |  |  170|      0|#define TYPE_INTEGER32      16
  ------------------
  |  Branch (2959:5): [True: 0, False: 3]
  ------------------
 2960|      0|        subtree->printomat = sprint_realloc_integer;
 2961|      0|        break;
 2962|      0|    case TYPE_NETADDR:
  ------------------
  |  |  158|      0|#define TYPE_NETADDR        4
  ------------------
  |  Branch (2962:5): [True: 0, False: 3]
  ------------------
 2963|      0|        subtree->printomat = sprint_realloc_networkaddress;
 2964|      0|        break;
 2965|      0|    case TYPE_IPADDR:
  ------------------
  |  |  159|      0|#define TYPE_IPADDR         5
  ------------------
  |  Branch (2965:5): [True: 0, False: 3]
  ------------------
 2966|      0|        subtree->printomat = sprint_realloc_ipaddress;
 2967|      0|        break;
 2968|      0|    case TYPE_COUNTER:
  ------------------
  |  |  160|      0|#define TYPE_COUNTER        6
  ------------------
  |  Branch (2968:5): [True: 0, False: 3]
  ------------------
 2969|      0|        subtree->printomat = sprint_realloc_counter;
 2970|      0|        break;
 2971|      0|    case TYPE_GAUGE:
  ------------------
  |  |  161|      0|#define TYPE_GAUGE          7
  ------------------
  |  Branch (2971:5): [True: 0, False: 3]
  ------------------
 2972|      0|        subtree->printomat = sprint_realloc_gauge;
 2973|      0|        break;
 2974|      0|    case TYPE_TIMETICKS:
  ------------------
  |  |  162|      0|#define TYPE_TIMETICKS      8
  ------------------
  |  Branch (2974:5): [True: 0, False: 3]
  ------------------
 2975|      0|        subtree->printomat = sprint_realloc_timeticks;
 2976|      0|        break;
 2977|      0|    case TYPE_OPAQUE:
  ------------------
  |  |  163|      0|#define TYPE_OPAQUE         9
  ------------------
  |  Branch (2977:5): [True: 0, False: 3]
  ------------------
 2978|      0|        subtree->printomat = sprint_realloc_opaque;
 2979|      0|        break;
 2980|      0|    case TYPE_NULL:
  ------------------
  |  |  164|      0|#define TYPE_NULL           10
  ------------------
  |  Branch (2980:5): [True: 0, False: 3]
  ------------------
 2981|      0|        subtree->printomat = sprint_realloc_null;
 2982|      0|        break;
 2983|      0|    case TYPE_BITSTRING:
  ------------------
  |  |  166|      0|#define TYPE_BITSTRING      12
  ------------------
  |  Branch (2983:5): [True: 0, False: 3]
  ------------------
 2984|      0|        subtree->printomat = sprint_realloc_bitstring;
 2985|      0|        break;
 2986|      0|    case TYPE_NSAPADDRESS:
  ------------------
  |  |  167|      0|#define TYPE_NSAPADDRESS    13
  ------------------
  |  Branch (2986:5): [True: 0, False: 3]
  ------------------
 2987|      0|        subtree->printomat = sprint_realloc_nsapaddress;
 2988|      0|        break;
 2989|      0|    case TYPE_COUNTER64:
  ------------------
  |  |  165|      0|#define TYPE_COUNTER64      11
  ------------------
  |  Branch (2989:5): [True: 0, False: 3]
  ------------------
 2990|      0|        subtree->printomat = sprint_realloc_counter64;
 2991|      0|        break;
 2992|      0|    case TYPE_UINTEGER:
  ------------------
  |  |  168|      0|#define TYPE_UINTEGER       14
  ------------------
  |  Branch (2992:5): [True: 0, False: 3]
  ------------------
 2993|      0|        subtree->printomat = sprint_realloc_uinteger;
 2994|      0|        break;
 2995|      0|    case TYPE_UNSIGNED32:
  ------------------
  |  |  169|      0|#define TYPE_UNSIGNED32     15
  ------------------
  |  Branch (2995:5): [True: 0, False: 3]
  ------------------
 2996|      0|        subtree->printomat = sprint_realloc_gauge;
 2997|      0|        break;
 2998|      3|    case TYPE_OTHER:
  ------------------
  |  |  154|      3|#define TYPE_OTHER          0
  ------------------
  |  Branch (2998:5): [True: 3, False: 0]
  ------------------
 2999|      3|    default:
  ------------------
  |  Branch (2999:5): [True: 0, False: 3]
  ------------------
 3000|      3|        subtree->printomat = sprint_realloc_by_type;
 3001|      3|        break;
 3002|      3|    }
 3003|      3|}
read_objid:
 3024|    413|{
 3025|    413|#ifndef NETSNMP_DISABLE_MIB_LOADING
 3026|    413|    struct tree    *root = tree_top;
 3027|    413|    char            buf[SPRINT_MAX_LEN];
 3028|    413|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 3029|    413|    int             ret, max_out_len;
 3030|    413|    char           *name, ch;
 3031|    413|    const char     *cp;
 3032|       |
 3033|    413|    cp = input;
 3034|  2.89k|    while ((ch = *cp)) {
  ------------------
  |  Branch (3034:12): [True: 2.79k, False: 102]
  ------------------
 3035|  2.79k|        if (('0' <= ch && ch <= '9')
  ------------------
  |  Branch (3035:14): [True: 2.18k, False: 609]
  |  Branch (3035:27): [True: 435, False: 1.74k]
  ------------------
 3036|  2.35k|            || ('a' <= ch && ch <= 'z')
  ------------------
  |  Branch (3036:17): [True: 1.29k, False: 1.06k]
  |  Branch (3036:30): [True: 1.28k, False: 11]
  ------------------
 3037|  1.07k|            || ('A' <= ch && ch <= 'Z')
  ------------------
  |  Branch (3037:17): [True: 458, False: 616]
  |  Branch (3037:30): [True: 439, False: 19]
  ------------------
 3038|    635|            || ch == '-')
  ------------------
  |  Branch (3038:16): [True: 324, False: 311]
  ------------------
 3039|  2.48k|            cp++;
 3040|    311|        else
 3041|    311|            break;
 3042|  2.79k|    }
 3043|    413|#ifndef NETSNMP_DISABLE_MIB_LOADING
 3044|    413|    if (ch == ':')
  ------------------
  |  Branch (3044:9): [True: 0, False: 413]
  ------------------
 3045|      0|        return get_node(input, output, out_len);
 3046|    413|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 3047|       |
 3048|    413|    if (*input == '.')
  ------------------
  |  Branch (3048:9): [True: 6, False: 407]
  ------------------
 3049|      6|        input++;
 3050|    407|#ifndef NETSNMP_DISABLE_MIB_LOADING
 3051|    407|    else if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_READ_UCD_STYLE_OID)) {
  ------------------
  |  |   48|    407|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
                  else if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_READ_UCD_STYLE_OID)) {
  ------------------
  |  |   85|    407|#define NETSNMP_DS_LIB_READ_UCD_STYLE_OID  25   /* require top-level OIDs to be prefixed with a dot */
  ------------------
  |  Branch (3051:14): [True: 0, False: 407]
  ------------------
 3052|       |        /*
 3053|       |         * get past leading '.', append '.' to Prefix. 
 3054|       |         */
 3055|      0|        if (*Prefix == '.')
  ------------------
  |  Branch (3055:13): [True: 0, False: 0]
  ------------------
 3056|      0|            strlcpy(buf, Prefix + 1, sizeof(buf));
 3057|      0|        else
 3058|      0|            strlcpy(buf, Prefix, sizeof(buf));
 3059|      0|        strlcat(buf, ".", sizeof(buf));
 3060|      0|        strlcat(buf, input, sizeof(buf));
 3061|      0|        input = buf;
 3062|      0|    }
 3063|    413|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 3064|       |
 3065|    413|#ifndef NETSNMP_DISABLE_MIB_LOADING
 3066|    413|    if ((root == NULL) && (tree_head != NULL)) {
  ------------------
  |  Branch (3066:9): [True: 413, False: 0]
  |  Branch (3066:27): [True: 413, False: 0]
  ------------------
 3067|    413|        root = tree_head;
 3068|    413|    }
 3069|      0|    else if (root == NULL) {
  ------------------
  |  Branch (3069:14): [True: 0, False: 0]
  ------------------
 3070|      0|        SET_SNMP_ERROR(SNMPERR_NOMIB);
  ------------------
  |  |   43|      0|#define SET_SNMP_ERROR(x) snmp_errno=(x)
  ------------------
 3071|      0|        *out_len = 0;
 3072|      0|        return 0;
 3073|      0|    }
 3074|    413|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 3075|    413|    name = strdup(input);
 3076|    413|    max_out_len = *out_len;
 3077|    413|    *out_len = 0;
 3078|    413|#ifndef NETSNMP_DISABLE_MIB_LOADING
 3079|    413|    if ((ret =
  ------------------
  |  Branch (3079:9): [True: 321, False: 92]
  ------------------
 3080|    413|         _add_strings_to_oid(root, name, output, out_len,
 3081|    413|                             max_out_len)) <= 0)
 3082|       |#else
 3083|       |    if ((ret =
 3084|       |         _add_strings_to_oid(NULL, name, output, out_len,
 3085|       |                             max_out_len)) <= 0)
 3086|       |#endif /* NETSNMP_DISABLE_MIB_LOADING */
 3087|    321|    {
 3088|    321|        if (ret == 0)
  ------------------
  |  Branch (3088:13): [True: 321, False: 0]
  ------------------
 3089|    321|            ret = SNMPERR_UNKNOWN_OBJID;
  ------------------
  |  |  242|    321|#define SNMPERR_UNKNOWN_OBJID		(-58)
  ------------------
 3090|    321|        SET_SNMP_ERROR(ret);
  ------------------
  |  |   43|    321|#define SET_SNMP_ERROR(x) snmp_errno=(x)
  ------------------
 3091|    321|        SNMP_FREE(name);
  ------------------
  |  |   62|    321|#define SNMP_FREE(s)    do { if (s) { free(s); s=NULL; } } while(0)
  |  |  ------------------
  |  |  |  Branch (62:34): [True: 321, False: 0]
  |  |  |  Branch (62:66): [Folded, False: 321]
  |  |  ------------------
  ------------------
 3092|    321|        return 0;
 3093|    321|    }
 3094|     92|    SNMP_FREE(name);
  ------------------
  |  |   62|     92|#define SNMP_FREE(s)    do { if (s) { free(s); s=NULL; } } while(0)
  |  |  ------------------
  |  |  |  Branch (62:34): [True: 92, False: 0]
  |  |  |  Branch (62:66): [Folded, False: 92]
  |  |  ------------------
  ------------------
 3095|       |
 3096|     92|    return 1;
 3097|    413|}
get_module_node:
 5192|    520|{
 5193|    520|    int             modid, rc = 0;
 5194|    520|    struct tree    *tp;
 5195|    520|    char           *name, *cp;
 5196|       |
 5197|    520|    if (!strcmp(module, "ANY"))
  ------------------
  |  Branch (5197:9): [True: 362, False: 158]
  ------------------
 5198|    362|        modid = -1;
 5199|    158|    else {
 5200|    158|        netsnmp_read_module(module);
 5201|    158|        modid = which_module(module);
 5202|    158|        if (modid == -1)
  ------------------
  |  Branch (5202:13): [True: 158, False: 0]
  ------------------
 5203|    158|            return 0;
 5204|    158|    }
 5205|       |
 5206|       |    /*
 5207|       |     * Isolate the first component of the name ... 
 5208|       |     */
 5209|    362|    name = strdup(fname);
 5210|    362|    if (name == NULL)
  ------------------
  |  Branch (5210:9): [True: 0, False: 362]
  ------------------
 5211|      0|        return -1;
 5212|    362|    cp = strchr(name, '.');
 5213|    362|    if (cp != NULL) {
  ------------------
  |  Branch (5213:9): [True: 63, False: 299]
  ------------------
 5214|     63|        *cp = '\0';
 5215|     63|        cp++;
 5216|     63|    }
 5217|       |    /*
 5218|       |     * ... and locate it in the tree. 
 5219|       |     */
 5220|    362|    tp = find_tree_node(name, modid);
 5221|    362|    if (tp) {
  ------------------
  |  Branch (5221:9): [True: 45, False: 317]
  ------------------
 5222|     45|        size_t          maxlen = *objidlen;
 5223|       |
 5224|       |        /*
 5225|       |         * Set the first element of the object ID 
 5226|       |         */
 5227|     45|        if (node_to_oid(tp, objid, objidlen)) {
  ------------------
  |  Branch (5227:13): [True: 45, False: 0]
  ------------------
 5228|     45|            rc = 1;
 5229|       |
 5230|       |            /*
 5231|       |             * If the name requested was more than one element,
 5232|       |             * tag on the rest of the components 
 5233|       |             */
 5234|     45|            if (cp != NULL)
  ------------------
  |  Branch (5234:17): [True: 6, False: 39]
  ------------------
 5235|      6|                rc = _add_strings_to_oid(tp, cp, objid, objidlen, maxlen);
 5236|     45|        }
 5237|     45|    }
 5238|       |
 5239|       |    SNMP_FREE(name);
  ------------------
  |  |   62|    362|#define SNMP_FREE(s)    do { if (s) { free(s); s=NULL; } } while(0)
  |  |  ------------------
  |  |  |  Branch (62:34): [True: 362, False: 0]
  |  |  |  Branch (62:66): [Folded, False: 362]
  |  |  ------------------
  ------------------
 5240|    362|    return (rc);
 5241|    362|}
get_wild_node:
 5742|    320|{
 5743|    320|    struct tree    *tp = find_best_tree_node(name, tree_head, NULL);
 5744|    320|    if (!tp)
  ------------------
  |  Branch (5744:9): [True: 283, False: 37]
  ------------------
 5745|    283|        return 0;
 5746|     37|    return get_node(tp->label, objid, objidlen);
 5747|    320|}
get_node:
 5751|    520|{
 5752|    520|    const char     *cp;
 5753|    520|    char            ch;
 5754|    520|    int             res;
 5755|       |
 5756|    520|    cp = name;
 5757|  11.1k|    while ((ch = *cp))
  ------------------
  |  Branch (5757:12): [True: 10.9k, False: 127]
  ------------------
 5758|  10.9k|        if (('0' <= ch && ch <= '9')
  ------------------
  |  Branch (5758:14): [True: 10.3k, False: 672]
  |  Branch (5758:27): [True: 4.36k, False: 5.93k]
  ------------------
 5759|  6.60k|            || ('a' <= ch && ch <= 'z')
  ------------------
  |  Branch (5759:17): [True: 1.68k, False: 4.92k]
  |  Branch (5759:30): [True: 1.67k, False: 11]
  ------------------
 5760|  4.93k|            || ('A' <= ch && ch <= 'Z')
  ------------------
  |  Branch (5760:17): [True: 4.09k, False: 838]
  |  Branch (5760:30): [True: 4.07k, False: 20]
  ------------------
 5761|    858|            || ch == '-')
  ------------------
  |  Branch (5761:16): [True: 465, False: 393]
  ------------------
 5762|  10.5k|            cp++;
 5763|    393|        else
 5764|    393|            break;
 5765|    520|    if (ch != ':')
  ------------------
  |  Branch (5765:9): [True: 361, False: 159]
  ------------------
 5766|    361|        if (*name == '.')
  ------------------
  |  Branch (5766:13): [True: 5, False: 356]
  ------------------
 5767|      5|            res = get_module_node(name + 1, "ANY", objid, objidlen);
 5768|    356|        else
 5769|    356|            res = get_module_node(name, "ANY", objid, objidlen);
 5770|    159|    else {
 5771|    159|        char           *module;
 5772|    159|        size_t          module_len;
 5773|       |        /*
 5774|       |         *  requested name is of the form
 5775|       |         *      "module:subidentifier"
 5776|       |         */
 5777|    159|        module_len = (size_t) (cp - name + 1);
 5778|    159|        module = (char *) malloc(module_len);
 5779|    159|        if (!module)
  ------------------
  |  Branch (5779:13): [True: 0, False: 159]
  ------------------
 5780|      0|            return SNMPERR_GENERR;
  ------------------
  |  |  185|      0|#define SNMPERR_GENERR			(-1)
  ------------------
 5781|    159|        snprintf(module, module_len, "%.*s", (int) (cp - name), name);
 5782|    159|        cp++;                   /* cp now point to the subidentifier */
 5783|    159|        if (*cp == ':')
  ------------------
  |  Branch (5783:13): [True: 1, False: 158]
  ------------------
 5784|      1|            cp++;
 5785|       |
 5786|       |        /*
 5787|       |         * 'cp' and 'name' *do* go that way round! 
 5788|       |         */
 5789|    159|        res = get_module_node(cp, module, objid, objidlen);
 5790|    159|        SNMP_FREE(module);
  ------------------
  |  |   62|    159|#define SNMP_FREE(s)    do { if (s) { free(s); s=NULL; } } while(0)
  |  |  ------------------
  |  |  |  Branch (62:34): [True: 159, False: 0]
  |  |  |  Branch (62:66): [Folded, False: 159]
  |  |  ------------------
  ------------------
 5791|    159|    }
 5792|    520|    if (res == 0) {
  ------------------
  |  Branch (5792:9): [True: 481, False: 39]
  ------------------
 5793|    481|        SET_SNMP_ERROR(SNMPERR_UNKNOWN_OBJID);
  ------------------
  |  |   43|    481|#define SET_SNMP_ERROR(x) snmp_errno=(x)
  ------------------
 5794|    481|    }
 5795|       |
 5796|    520|    return res;
 5797|    520|}
clear_tree_flags:
 5834|    320|{
 5835|  1.28k|    for (; tp; tp = tp->next_peer) {
  ------------------
  |  Branch (5835:12): [True: 960, False: 320]
  ------------------
 5836|    960|        tp->reported = 0;
 5837|    960|        if (tp->child_list)
  ------------------
  |  Branch (5837:13): [True: 0, False: 960]
  ------------------
 5838|      0|            clear_tree_flags(tp->child_list);
 5839|    960|     /*RECURSE*/}
 5840|    320|}
snmp_parse_oid:
 6095|    575|{
 6096|    575|#ifndef NETSNMP_DISABLE_MIB_LOADING
 6097|    575|    size_t          savlen = *rootlen;
 6098|    575|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 6099|    575|    char           *tmpbuf = NULL;
 6100|    575|    const char     *suffix, *prefix;
 6101|       |
 6102|    575|    suffix = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
  ------------------
  |  |   48|    575|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
 6103|    575|                                   NETSNMP_DS_LIB_OIDSUFFIX);
  ------------------
  |  |  163|    575|#define NETSNMP_DS_LIB_OIDSUFFIX         12
  ------------------
 6104|    575|    prefix = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
  ------------------
  |  |   48|    575|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
 6105|    575|                                   NETSNMP_DS_LIB_OIDPREFIX);
  ------------------
  |  |  164|    575|#define NETSNMP_DS_LIB_OIDPREFIX         13
  ------------------
 6106|    575|    if ((suffix && suffix[0]) || (prefix && prefix[0])) {
  ------------------
  |  Branch (6106:10): [True: 0, False: 575]
  |  Branch (6106:20): [True: 0, False: 0]
  |  Branch (6106:35): [True: 0, False: 575]
  |  Branch (6106:45): [True: 0, False: 0]
  ------------------
 6107|      0|        if (!suffix)
  ------------------
  |  Branch (6107:13): [True: 0, False: 0]
  ------------------
 6108|      0|            suffix = "";
 6109|      0|        if (!prefix)
  ------------------
  |  Branch (6109:13): [True: 0, False: 0]
  ------------------
 6110|      0|            prefix = "";
 6111|      0|        if (asprintf(&tmpbuf, "%s%s%s%s", prefix, argv,
  ------------------
  |  Branch (6111:13): [True: 0, False: 0]
  ------------------
 6112|      0|                     suffix[0] == '.' || suffix[0] == '\0' ? "" : ".",
  ------------------
  |  Branch (6112:22): [True: 0, False: 0]
  |  Branch (6112:42): [True: 0, False: 0]
  ------------------
 6113|      0|                     suffix) < 0) {
 6114|      0|            DEBUGMSGTL(("snmp_parse_oid", "Out of memory\n"));
  ------------------
  |  |   66|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  164|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6115|      0|            return NULL;
 6116|      0|        }
 6117|      0|        argv = tmpbuf;
 6118|      0|        DEBUGMSGTL(("snmp_parse_oid","Parsing: %s\n",argv));
  ------------------
  |  |   66|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  164|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6119|      0|    }
 6120|       |
 6121|    575|#ifndef NETSNMP_DISABLE_MIB_LOADING
 6122|    575|    if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
  ------------------
  |  |   48|    575|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
  |  Branch (6122:9): [True: 0, False: 575]
  ------------------
 6123|    575|                               NETSNMP_DS_LIB_RANDOM_ACCESS)
  ------------------
  |  |   74|    575|#define NETSNMP_DS_LIB_RANDOM_ACCESS	   14   /* random access to oid labels */
  ------------------
 6124|    575|        || strchr(argv, ':')) {
  ------------------
  |  Branch (6124:12): [True: 162, False: 413]
  ------------------
 6125|    162|        if (get_node(argv, root, rootlen))
  ------------------
  |  Branch (6125:13): [True: 1, False: 161]
  ------------------
 6126|      1|            goto out;
 6127|    413|    } else if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
  ------------------
  |  |   48|    413|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
  |  Branch (6127:16): [True: 0, False: 413]
  ------------------
 6128|    413|                                      NETSNMP_DS_LIB_REGEX_ACCESS)) {
  ------------------
  |  |   75|    413|#define NETSNMP_DS_LIB_REGEX_ACCESS	   15   /* regex matching to oid labels */
  ------------------
 6129|      0|	clear_tree_flags(tree_head);
 6130|      0|        if (get_wild_node(argv, root, rootlen))
  ------------------
  |  Branch (6130:13): [True: 0, False: 0]
  ------------------
 6131|      0|            goto out;
 6132|    413|    } else {
 6133|    413|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 6134|    413|        if (read_objid(argv, root, rootlen))
  ------------------
  |  Branch (6134:13): [True: 92, False: 321]
  ------------------
 6135|     92|            goto out;
 6136|    321|#ifndef NETSNMP_DISABLE_MIB_LOADING
 6137|    321|        *rootlen = savlen;
 6138|    321|        if (get_node(argv, root, rootlen))
  ------------------
  |  Branch (6138:13): [True: 1, False: 320]
  ------------------
 6139|      1|            goto out;
 6140|    320|        *rootlen = savlen;
 6141|    320|        DEBUGMSGTL(("parse_oid", "wildly parsing\n"));
  ------------------
  |  |   66|    320|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    320|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 320]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  164|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 320]
  |  |  ------------------
  ------------------
 6142|    320|	clear_tree_flags(tree_head);
 6143|    320|        if (get_wild_node(argv, root, rootlen))
  ------------------
  |  Branch (6143:13): [True: 37, False: 283]
  ------------------
 6144|     37|            goto out;
 6145|    320|    }
 6146|    444|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 6147|       |
 6148|    444|    root = NULL;
 6149|       |
 6150|    575|out:
 6151|    575|    free(tmpbuf);
 6152|    575|    return root;
 6153|    444|}
mib.c:node_to_oid:
 5263|     45|{
 5264|     45|    size_t          numids, lenids;
 5265|     45|    oid            *op;
 5266|       |
 5267|     45|    if (!tp || !objid || !objidlen)
  ------------------
  |  Branch (5267:9): [True: 0, False: 45]
  |  Branch (5267:16): [True: 0, False: 45]
  |  Branch (5267:26): [True: 0, False: 45]
  ------------------
 5268|      0|        return 0;
 5269|       |
 5270|     45|    lenids = *objidlen;
 5271|     45|    op = objid + lenids;        /* points after the last element */
 5272|       |
 5273|     90|    for (numids = 0; tp; tp = tp->parent, numids++) {
  ------------------
  |  Branch (5273:22): [True: 45, False: 45]
  ------------------
 5274|     45|        if (numids >= lenids)
  ------------------
  |  Branch (5274:13): [True: 0, False: 45]
  ------------------
 5275|      0|            continue;
 5276|     45|        --op;
 5277|     45|        *op = tp->subid;
 5278|     45|    }
 5279|       |
 5280|     45|    *objidlen = numids;
 5281|     45|    if (numids > lenids) {
  ------------------
  |  Branch (5281:9): [True: 0, False: 45]
  ------------------
 5282|      0|        return 0;
 5283|      0|    }
 5284|       |
 5285|     45|    if (numids < lenids)
  ------------------
  |  Branch (5285:9): [True: 45, False: 0]
  ------------------
 5286|     45|        memmove(objid, op, numids * sizeof(oid));
 5287|       |
 5288|     45|    return numids;
 5289|     45|}
mib.c:_add_strings_to_oid:
 5333|    419|{
 5334|    419|    oid             subid;
 5335|    419|    char           *fcp, *ecp, *cp2 = NULL;
 5336|    419|    char            doingquote;
 5337|    419|    int             len = -1;
 5338|    419|#ifndef NETSNMP_DISABLE_MIB_LOADING
 5339|    419|    struct tree    *tp2 = NULL;
 5340|    419|    struct index_list *in_dices = NULL;
 5341|    419|    int             pos = -1;
 5342|    419|    int             check =
 5343|    419|        !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_CHECK_RANGE);
  ------------------
  |  |   48|    419|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
                      !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_CHECK_RANGE);
  ------------------
  |  |   76|    419|#define NETSNMP_DS_LIB_DONT_CHECK_RANGE    16   /* don't check values for ranges on send */
  ------------------
 5344|    419|    int             do_hint = !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NO_DISPLAY_HINT);
  ------------------
  |  |   48|    419|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
                  int             do_hint = !netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NO_DISPLAY_HINT);
  ------------------
  |  |   90|    419|#define NETSNMP_DS_LIB_NO_DISPLAY_HINT     30 /* don't apply DISPLAY-HINTs */
  ------------------
 5345|    419|    int             len_index = 1000000;
 5346|       |
 5347|    419|    while (cp && tp && tp->child_list) {
  ------------------
  |  Branch (5347:12): [True: 419, False: 0]
  |  Branch (5347:18): [True: 419, False: 0]
  |  Branch (5347:24): [True: 0, False: 419]
  ------------------
 5348|      0|        fcp = cp;
 5349|      0|        tp2 = tp->child_list;
 5350|       |        /*
 5351|       |         * Isolate the next entry 
 5352|       |         */
 5353|      0|        cp2 = strchr(cp, '.');
 5354|      0|        if (cp2)
  ------------------
  |  Branch (5354:13): [True: 0, False: 0]
  ------------------
 5355|      0|            *cp2++ = '\0';
 5356|       |
 5357|       |        /*
 5358|       |         * Search for the appropriate child 
 5359|       |         */
 5360|      0|        if (isdigit((unsigned char)(*cp))) {
  ------------------
  |  Branch (5360:13): [True: 0, False: 0]
  ------------------
 5361|      0|            subid = strtoul(cp, &ecp, 0);
 5362|      0|            if (*ecp)
  ------------------
  |  Branch (5362:17): [True: 0, False: 0]
  ------------------
 5363|      0|                goto bad_id;
 5364|      0|            while (tp2 && tp2->subid != subid)
  ------------------
  |  Branch (5364:20): [True: 0, False: 0]
  |  Branch (5364:27): [True: 0, False: 0]
  ------------------
 5365|      0|                tp2 = tp2->next_peer;
 5366|      0|        } else {
 5367|      0|            while (tp2 && strcmp(tp2->label, fcp))
  ------------------
  |  Branch (5367:20): [True: 0, False: 0]
  |  Branch (5367:27): [True: 0, False: 0]
  ------------------
 5368|      0|                tp2 = tp2->next_peer;
 5369|      0|            if (!tp2)
  ------------------
  |  Branch (5369:17): [True: 0, False: 0]
  ------------------
 5370|      0|                goto bad_id;
 5371|      0|            subid = tp2->subid;
 5372|      0|        }
 5373|      0|        if (*objidlen >= maxlen)
  ------------------
  |  Branch (5373:13): [True: 0, False: 0]
  ------------------
 5374|      0|            goto bad_id;
 5375|      0|	while (tp2 && tp2->next_peer && tp2->next_peer->subid == subid)
  ------------------
  |  Branch (5375:9): [True: 0, False: 0]
  |  Branch (5375:16): [True: 0, False: 0]
  |  Branch (5375:34): [True: 0, False: 0]
  ------------------
 5376|      0|	    tp2 = tp2->next_peer;
 5377|      0|        objid[*objidlen] = subid;
 5378|      0|        (*objidlen)++;
 5379|       |
 5380|      0|        cp = cp2;
 5381|      0|        if (!tp2)
  ------------------
  |  Branch (5381:13): [True: 0, False: 0]
  ------------------
 5382|      0|            break;
 5383|      0|        tp = tp2;
 5384|      0|    }
 5385|       |
 5386|    419|    if (tp && !tp->child_list) {
  ------------------
  |  Branch (5386:9): [True: 419, False: 0]
  |  Branch (5386:15): [True: 419, False: 0]
  ------------------
 5387|    419|        if ((tp2 = tp->parent)) {
  ------------------
  |  Branch (5387:13): [True: 0, False: 419]
  ------------------
 5388|      0|            if (tp2->indexes)
  ------------------
  |  Branch (5388:17): [True: 0, False: 0]
  ------------------
 5389|      0|                in_dices = tp2->indexes;
 5390|      0|            else if (tp2->augments) {
  ------------------
  |  Branch (5390:22): [True: 0, False: 0]
  ------------------
 5391|      0|                tp2 = find_tree_node(tp2->augments, -1);
 5392|      0|                if (tp2)
  ------------------
  |  Branch (5392:21): [True: 0, False: 0]
  ------------------
 5393|      0|                    in_dices = tp2->indexes;
 5394|      0|            }
 5395|      0|        }
 5396|    419|        tp = NULL;
 5397|    419|    }
 5398|       |
 5399|    419|    while (cp && in_dices) {
  ------------------
  |  Branch (5399:12): [True: 419, False: 0]
  |  Branch (5399:18): [True: 0, False: 419]
  ------------------
 5400|      0|        fcp = cp;
 5401|       |
 5402|      0|        tp = find_tree_node(in_dices->ilabel, -1);
 5403|      0|        if (!tp)
  ------------------
  |  Branch (5403:13): [True: 0, False: 0]
  ------------------
 5404|      0|            break;
 5405|      0|        switch (tp->type) {
 5406|      0|        case TYPE_INTEGER:
  ------------------
  |  |  157|      0|#define TYPE_INTEGER        3
  ------------------
  |  Branch (5406:9): [True: 0, False: 0]
  ------------------
 5407|      0|        case TYPE_INTEGER32:
  ------------------
  |  |  170|      0|#define TYPE_INTEGER32      16
  ------------------
  |  Branch (5407:9): [True: 0, False: 0]
  ------------------
 5408|      0|        case TYPE_UINTEGER:
  ------------------
  |  |  168|      0|#define TYPE_UINTEGER       14
  ------------------
  |  Branch (5408:9): [True: 0, False: 0]
  ------------------
 5409|      0|        case TYPE_UNSIGNED32:
  ------------------
  |  |  169|      0|#define TYPE_UNSIGNED32     15
  ------------------
  |  Branch (5409:9): [True: 0, False: 0]
  ------------------
 5410|      0|        case TYPE_TIMETICKS:
  ------------------
  |  |  162|      0|#define TYPE_TIMETICKS      8
  ------------------
  |  Branch (5410:9): [True: 0, False: 0]
  ------------------
 5411|       |            /*
 5412|       |             * Isolate the next entry 
 5413|       |             */
 5414|      0|            cp2 = strchr(cp, '.');
 5415|      0|            if (cp2)
  ------------------
  |  Branch (5415:17): [True: 0, False: 0]
  ------------------
 5416|      0|                *cp2++ = '\0';
 5417|      0|            if (isdigit((unsigned char)(*cp))) {
  ------------------
  |  Branch (5417:17): [True: 0, False: 0]
  ------------------
 5418|      0|                subid = strtoul(cp, &ecp, 0);
 5419|      0|                if (*ecp)
  ------------------
  |  Branch (5419:21): [True: 0, False: 0]
  ------------------
 5420|      0|                    goto bad_id;
 5421|      0|            } else {
 5422|      0|                if (tp->enums) {
  ------------------
  |  Branch (5422:21): [True: 0, False: 0]
  ------------------
 5423|      0|                    struct enum_list *ep = tp->enums;
 5424|      0|                    while (ep && strcmp(ep->label, cp))
  ------------------
  |  Branch (5424:28): [True: 0, False: 0]
  |  Branch (5424:34): [True: 0, False: 0]
  ------------------
 5425|      0|                        ep = ep->next;
 5426|      0|                    if (!ep)
  ------------------
  |  Branch (5426:25): [True: 0, False: 0]
  ------------------
 5427|      0|                        goto bad_id;
 5428|      0|                    subid = ep->value;
 5429|      0|                } else
 5430|      0|                    goto bad_id;
 5431|      0|            }
 5432|      0|            if (check && tp->ranges) {
  ------------------
  |  Branch (5432:17): [True: 0, False: 0]
  |  Branch (5432:26): [True: 0, False: 0]
  ------------------
 5433|      0|                struct range_list *rp = tp->ranges;
 5434|      0|                int             ok = 0;
 5435|      0|                if (tp->type == TYPE_INTEGER ||
  ------------------
  |  |  157|      0|#define TYPE_INTEGER        3
  ------------------
  |  Branch (5435:21): [True: 0, False: 0]
  ------------------
 5436|      0|                    tp->type == TYPE_INTEGER32) {
  ------------------
  |  |  170|      0|#define TYPE_INTEGER32      16
  ------------------
  |  Branch (5436:21): [True: 0, False: 0]
  ------------------
 5437|      0|                  while (!ok && rp) {
  ------------------
  |  Branch (5437:26): [True: 0, False: 0]
  |  Branch (5437:33): [True: 0, False: 0]
  ------------------
 5438|      0|                    if ((rp->low <= (int) subid)
  ------------------
  |  Branch (5438:25): [True: 0, False: 0]
  ------------------
 5439|      0|                        && ((int) subid <= rp->high))
  ------------------
  |  Branch (5439:28): [True: 0, False: 0]
  ------------------
 5440|      0|                        ok = 1;
 5441|      0|                    else
 5442|      0|                        rp = rp->next;
 5443|      0|                  }
 5444|      0|                } else { /* check unsigned range */
 5445|      0|                  while (!ok && rp) {
  ------------------
  |  Branch (5445:26): [True: 0, False: 0]
  |  Branch (5445:33): [True: 0, False: 0]
  ------------------
 5446|      0|                    if (((unsigned int)rp->low <= subid)
  ------------------
  |  Branch (5446:25): [True: 0, False: 0]
  ------------------
 5447|      0|                        && (subid <= (unsigned int)rp->high))
  ------------------
  |  Branch (5447:28): [True: 0, False: 0]
  ------------------
 5448|      0|                        ok = 1;
 5449|      0|                    else
 5450|      0|                        rp = rp->next;
 5451|      0|                  }
 5452|      0|                }
 5453|      0|                if (!ok)
  ------------------
  |  Branch (5453:21): [True: 0, False: 0]
  ------------------
 5454|      0|                    goto bad_id;
 5455|      0|            }
 5456|      0|            if (*objidlen >= maxlen)
  ------------------
  |  Branch (5456:17): [True: 0, False: 0]
  ------------------
 5457|      0|                goto bad_id;
 5458|      0|            objid[*objidlen] = subid;
 5459|      0|            (*objidlen)++;
 5460|      0|            break;
 5461|      0|        case TYPE_IPADDR:
  ------------------
  |  |  159|      0|#define TYPE_IPADDR         5
  ------------------
  |  Branch (5461:9): [True: 0, False: 0]
  ------------------
 5462|      0|            if (*objidlen + 4 > maxlen)
  ------------------
  |  Branch (5462:17): [True: 0, False: 0]
  ------------------
 5463|      0|                goto bad_id;
 5464|      0|            for (subid = 0; cp && subid < 4; subid++) {
  ------------------
  |  Branch (5464:29): [True: 0, False: 0]
  |  Branch (5464:35): [True: 0, False: 0]
  ------------------
 5465|      0|                fcp = cp;
 5466|      0|                cp2 = strchr(cp, '.');
 5467|      0|                if (cp2)
  ------------------
  |  Branch (5467:21): [True: 0, False: 0]
  ------------------
 5468|      0|                    *cp2++ = 0;
 5469|      0|                objid[*objidlen] = strtoul(cp, &ecp, 0);
 5470|      0|                if (*ecp)
  ------------------
  |  Branch (5470:21): [True: 0, False: 0]
  ------------------
 5471|      0|                    goto bad_id;
 5472|      0|                if (check && objid[*objidlen] > 255)
  ------------------
  |  Branch (5472:21): [True: 0, False: 0]
  |  Branch (5472:30): [True: 0, False: 0]
  ------------------
 5473|      0|                    goto bad_id;
 5474|      0|                (*objidlen)++;
 5475|      0|                cp = cp2;
 5476|      0|            }
 5477|      0|            break;
 5478|      0|        case TYPE_OCTETSTR:
  ------------------
  |  |  156|      0|#define TYPE_OCTETSTR       2
  ------------------
  |  Branch (5478:9): [True: 0, False: 0]
  ------------------
 5479|      0|            if (tp->ranges && !tp->ranges->next
  ------------------
  |  Branch (5479:17): [True: 0, False: 0]
  |  Branch (5479:31): [True: 0, False: 0]
  ------------------
 5480|      0|                && tp->ranges->low == tp->ranges->high)
  ------------------
  |  Branch (5480:20): [True: 0, False: 0]
  ------------------
 5481|      0|                len = tp->ranges->low;
 5482|      0|            else
 5483|      0|                len = -1;
 5484|      0|            pos = 0;
 5485|      0|            if (*cp == '"' || *cp == '\'') {
  ------------------
  |  Branch (5485:17): [True: 0, False: 0]
  |  Branch (5485:31): [True: 0, False: 0]
  ------------------
 5486|      0|                doingquote = *cp++;
 5487|       |                /*
 5488|       |                 * insert length if requested 
 5489|       |                 */
 5490|      0|                if (!in_dices->isimplied && len == -1) {
  ------------------
  |  Branch (5490:21): [True: 0, False: 0]
  |  Branch (5490:45): [True: 0, False: 0]
  ------------------
 5491|      0|                    if (doingquote == '\'') {
  ------------------
  |  Branch (5491:25): [True: 0, False: 0]
  ------------------
 5492|      0|                        snmp_set_detail
 5493|      0|                            ("'-quote is for fixed length strings");
 5494|      0|                        return 0;
 5495|      0|                    }
 5496|      0|                    if (*objidlen >= maxlen)
  ------------------
  |  Branch (5496:25): [True: 0, False: 0]
  ------------------
 5497|      0|                        goto bad_id;
 5498|      0|                    len_index = *objidlen;
 5499|      0|                    (*objidlen)++;
 5500|      0|                } else if (doingquote == '"') {
  ------------------
  |  Branch (5500:28): [True: 0, False: 0]
  ------------------
 5501|      0|                    snmp_set_detail
 5502|      0|                        ("\"-quote is for variable length strings");
 5503|      0|                    return 0;
 5504|      0|                }
 5505|       |
 5506|      0|		cp2 = _apply_escapes(cp, doingquote);
 5507|      0|		if (!cp2) goto bad_id;
  ------------------
  |  Branch (5507:7): [True: 0, False: 0]
  ------------------
 5508|      0|		else {
 5509|      0|		    unsigned char *new_val;
 5510|      0|		    int new_val_len;
 5511|      0|		    int parsed_hint = 0;
 5512|      0|		    const char *parsed_value;
 5513|       |
 5514|      0|		    if (do_hint && tp->hint) {
  ------------------
  |  Branch (5514:11): [True: 0, False: 0]
  |  Branch (5514:22): [True: 0, False: 0]
  ------------------
 5515|      0|			parsed_value = parse_octet_hint(tp->hint, cp,
 5516|      0|			                                &new_val, &new_val_len);
 5517|      0|			parsed_hint = parsed_value == NULL;
 5518|      0|		    }
 5519|      0|		    if (parsed_hint) {
  ------------------
  |  Branch (5519:11): [True: 0, False: 0]
  ------------------
 5520|      0|			int i;
 5521|      0|			for (i = 0; i < new_val_len; i++) {
  ------------------
  |  Branch (5521:16): [True: 0, False: 0]
  ------------------
 5522|      0|			    if (*objidlen >= maxlen) {
  ------------------
  |  Branch (5522:12): [True: 0, False: 0]
  ------------------
 5523|      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, False: 0]
  |  |  ------------------
  ------------------
 5524|      0|				goto bad_id;
 5525|      0|			    }
 5526|      0|			    objid[ *objidlen ] = new_val[i];
 5527|      0|			    (*objidlen)++;
 5528|      0|			    pos++;
 5529|      0|			}
 5530|      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, False: 0]
  |  |  ------------------
  ------------------
 5531|      0|		    } else {
 5532|      0|			while(*cp) {
  ------------------
  |  Branch (5532:10): [True: 0, False: 0]
  ------------------
 5533|      0|			    if (*objidlen >= maxlen) goto bad_id;
  ------------------
  |  Branch (5533:12): [True: 0, False: 0]
  ------------------
 5534|      0|			    objid[ *objidlen ] = *cp++;
 5535|      0|			    (*objidlen)++;
 5536|      0|			    pos++;
 5537|      0|			}
 5538|      0|		    }
 5539|      0|		}
 5540|       |		
 5541|      0|		cp2++;
 5542|      0|                if (!*cp2)
  ------------------
  |  Branch (5542:21): [True: 0, False: 0]
  ------------------
 5543|      0|                    cp2 = NULL;
 5544|      0|                else if (*cp2 != '.')
  ------------------
  |  Branch (5544:26): [True: 0, False: 0]
  ------------------
 5545|      0|                    goto bad_id;
 5546|      0|                else
 5547|      0|                    cp2++;
 5548|      0|		if (check) {
  ------------------
  |  Branch (5548:7): [True: 0, False: 0]
  ------------------
 5549|      0|                    if (len == -1) {
  ------------------
  |  Branch (5549:25): [True: 0, False: 0]
  ------------------
 5550|      0|                        struct range_list *rp = tp->ranges;
 5551|      0|                        int             ok = 0;
 5552|      0|                        while (rp && !ok)
  ------------------
  |  Branch (5552:32): [True: 0, False: 0]
  |  Branch (5552:38): [True: 0, False: 0]
  ------------------
 5553|      0|                            if (rp->low <= pos && pos <= rp->high)
  ------------------
  |  Branch (5553:33): [True: 0, False: 0]
  |  Branch (5553:51): [True: 0, False: 0]
  ------------------
 5554|      0|                                ok = 1;
 5555|      0|                            else
 5556|      0|                                rp = rp->next;
 5557|      0|                        if (!ok)
  ------------------
  |  Branch (5557:29): [True: 0, False: 0]
  ------------------
 5558|      0|                            goto bad_id;
 5559|      0|                        if (!in_dices->isimplied)
  ------------------
  |  Branch (5559:29): [True: 0, False: 0]
  ------------------
 5560|      0|                            objid[len_index] = pos;
 5561|      0|                    } else if (pos != len)
  ------------------
  |  Branch (5561:32): [True: 0, False: 0]
  ------------------
 5562|      0|                        goto bad_id;
 5563|      0|		}
 5564|      0|		else if (len == -1 && !in_dices->isimplied)
  ------------------
  |  Branch (5564:12): [True: 0, False: 0]
  |  Branch (5564:25): [True: 0, False: 0]
  ------------------
 5565|      0|		    objid[len_index] = pos;
 5566|      0|            } else {
 5567|      0|                if (!in_dices->isimplied && len == -1) {
  ------------------
  |  Branch (5567:21): [True: 0, False: 0]
  |  Branch (5567:45): [True: 0, False: 0]
  ------------------
 5568|      0|                    fcp = cp;
 5569|      0|                    cp2 = strchr(cp, '.');
 5570|      0|                    if (cp2)
  ------------------
  |  Branch (5570:25): [True: 0, False: 0]
  ------------------
 5571|      0|                        *cp2++ = 0;
 5572|      0|                    len = strtoul(cp, &ecp, 0);
 5573|      0|                    if (len < 0 || *ecp)
  ------------------
  |  Branch (5573:25): [True: 0, False: 0]
  |  Branch (5573:36): [True: 0, False: 0]
  ------------------
 5574|      0|                        goto bad_id;
 5575|      0|                    if (*objidlen + len + 1 >= maxlen)
  ------------------
  |  Branch (5575:25): [True: 0, False: 0]
  ------------------
 5576|      0|                        goto bad_id;
 5577|      0|                    objid[*objidlen] = len;
 5578|      0|                    (*objidlen)++;
 5579|      0|                    cp = cp2;
 5580|      0|                }
 5581|      0|                while (len && cp) {
  ------------------
  |  Branch (5581:24): [True: 0, False: 0]
  |  Branch (5581:31): [True: 0, False: 0]
  ------------------
 5582|      0|                    fcp = cp;
 5583|      0|                    cp2 = strchr(cp, '.');
 5584|      0|                    if (cp2)
  ------------------
  |  Branch (5584:25): [True: 0, False: 0]
  ------------------
 5585|      0|                        *cp2++ = 0;
 5586|      0|                    if (*objidlen >= maxlen)
  ------------------
  |  Branch (5586:25): [True: 0, False: 0]
  ------------------
 5587|      0|                        goto bad_id;
 5588|      0|                    objid[*objidlen] = strtoul(cp, &ecp, 0);
 5589|      0|                    if (*ecp)
  ------------------
  |  Branch (5589:25): [True: 0, False: 0]
  ------------------
 5590|      0|                        goto bad_id;
 5591|      0|                    if (check && objid[*objidlen] > 255)
  ------------------
  |  Branch (5591:25): [True: 0, False: 0]
  |  Branch (5591:34): [True: 0, False: 0]
  ------------------
 5592|      0|                        goto bad_id;
 5593|      0|                    (*objidlen)++;
 5594|      0|                    len--;
 5595|      0|                    cp = cp2;
 5596|      0|                }
 5597|      0|            }
 5598|      0|            break;
 5599|      0|        case TYPE_OBJID:
  ------------------
  |  |  155|      0|#define TYPE_OBJID          1
  ------------------
  |  Branch (5599:9): [True: 0, False: 0]
  ------------------
 5600|      0|            in_dices = NULL;
 5601|      0|            cp2 = cp;
 5602|      0|            break;
 5603|      0|	case TYPE_NETADDR:
  ------------------
  |  |  158|      0|#define TYPE_NETADDR        4
  ------------------
  |  Branch (5603:2): [True: 0, False: 0]
  ------------------
 5604|      0|	    fcp = cp;
 5605|      0|	    cp2 = strchr(cp, '.');
 5606|      0|	    if (cp2)
  ------------------
  |  Branch (5606:10): [True: 0, False: 0]
  ------------------
 5607|      0|		*cp2++ = 0;
 5608|      0|	    subid = strtoul(cp, &ecp, 0);
 5609|      0|	    if (*ecp)
  ------------------
  |  Branch (5609:10): [True: 0, False: 0]
  ------------------
 5610|      0|		goto bad_id;
 5611|      0|	    if (*objidlen + 1 >= maxlen)
  ------------------
  |  Branch (5611:10): [True: 0, False: 0]
  ------------------
 5612|      0|		goto bad_id;
 5613|      0|	    objid[*objidlen] = subid;
 5614|      0|	    (*objidlen)++;
 5615|      0|	    cp = cp2;
 5616|      0|	    if (subid == 1) {
  ------------------
  |  Branch (5616:10): [True: 0, False: 0]
  ------------------
 5617|      0|		for (len = 0; cp && len < 4; len++) {
  ------------------
  |  Branch (5617:17): [True: 0, False: 0]
  |  Branch (5617:23): [True: 0, False: 0]
  ------------------
 5618|      0|		    fcp = cp;
 5619|      0|		    cp2 = strchr(cp, '.');
 5620|      0|		    if (cp2)
  ------------------
  |  Branch (5620:11): [True: 0, False: 0]
  ------------------
 5621|      0|			*cp2++ = 0;
 5622|      0|		    subid = strtoul(cp, &ecp, 0);
 5623|      0|		    if (*ecp)
  ------------------
  |  Branch (5623:11): [True: 0, False: 0]
  ------------------
 5624|      0|			goto bad_id;
 5625|      0|		    if (*objidlen + 1 >= maxlen)
  ------------------
  |  Branch (5625:11): [True: 0, False: 0]
  ------------------
 5626|      0|			goto bad_id;
 5627|      0|		    if (check && subid > 255)
  ------------------
  |  Branch (5627:11): [True: 0, False: 0]
  |  Branch (5627:20): [True: 0, False: 0]
  ------------------
 5628|      0|			goto bad_id;
 5629|      0|		    objid[*objidlen] = subid;
 5630|      0|		    (*objidlen)++;
 5631|      0|		    cp = cp2;
 5632|      0|		}
 5633|      0|	    }
 5634|      0|	    else {
 5635|      0|		in_dices = NULL;
 5636|      0|	    }
 5637|      0|	    break;
 5638|      0|        default:
  ------------------
  |  Branch (5638:9): [True: 0, False: 0]
  ------------------
 5639|      0|            snmp_log(LOG_ERR, "Unexpected index type: %d %s %s\n",
 5640|      0|                     tp->type, in_dices->ilabel, cp);
 5641|      0|            in_dices = NULL;
 5642|      0|            cp2 = cp;
 5643|      0|            break;
 5644|      0|        }
 5645|      0|        cp = cp2;
 5646|      0|        if (in_dices)
  ------------------
  |  Branch (5646:13): [True: 0, False: 0]
  ------------------
 5647|      0|            in_dices = in_dices->next;
 5648|      0|    }
 5649|       |
 5650|    419|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 5651|  3.28k|    while (cp) {
  ------------------
  |  Branch (5651:12): [True: 3.19k, False: 92]
  ------------------
 5652|  3.19k|        fcp = cp;
 5653|  3.19k|        switch (*cp) {
 5654|    203|        case '0':
  ------------------
  |  Branch (5654:9): [True: 203, False: 2.99k]
  ------------------
 5655|    407|        case '1':
  ------------------
  |  Branch (5655:9): [True: 204, False: 2.99k]
  ------------------
 5656|    604|        case '2':
  ------------------
  |  Branch (5656:9): [True: 197, False: 2.99k]
  ------------------
 5657|    804|        case '3':
  ------------------
  |  Branch (5657:9): [True: 200, False: 2.99k]
  ------------------
 5658|  1.04k|        case '4':
  ------------------
  |  Branch (5658:9): [True: 236, False: 2.95k]
  ------------------
 5659|  1.23k|        case '5':
  ------------------
  |  Branch (5659:9): [True: 199, False: 2.99k]
  ------------------
 5660|  1.43k|        case '6':
  ------------------
  |  Branch (5660:9): [True: 198, False: 2.99k]
  ------------------
 5661|  1.75k|        case '7':
  ------------------
  |  Branch (5661:9): [True: 322, False: 2.87k]
  ------------------
 5662|  1.95k|        case '8':
  ------------------
  |  Branch (5662:9): [True: 198, False: 2.99k]
  ------------------
 5663|  2.16k|        case '9':
  ------------------
  |  Branch (5663:9): [True: 212, False: 2.98k]
  ------------------
 5664|  2.16k|            cp2 = strchr(cp, '.');
 5665|  2.16k|            if (cp2)
  ------------------
  |  Branch (5665:17): [True: 2.06k, False: 106]
  ------------------
 5666|  2.06k|                *cp2++ = 0;
 5667|  2.16k|            subid = strtoul(cp, &ecp, 0);
 5668|  2.16k|            if (*ecp)
  ------------------
  |  Branch (5668:17): [True: 20, False: 2.14k]
  ------------------
 5669|     20|                goto bad_id;
 5670|  2.14k|            if (*objidlen >= maxlen)
  ------------------
  |  Branch (5670:17): [True: 1, False: 2.14k]
  ------------------
 5671|      1|                goto bad_id;
 5672|  2.14k|            objid[*objidlen] = subid;
 5673|  2.14k|            (*objidlen)++;
 5674|  2.14k|            break;
 5675|    441|        case '"':
  ------------------
  |  Branch (5675:9): [True: 441, False: 2.75k]
  ------------------
 5676|    786|        case '\'':
  ------------------
  |  Branch (5676:9): [True: 345, False: 2.84k]
  ------------------
 5677|    786|            doingquote = *cp++;
 5678|    786|            if (*cp == '\0')
  ------------------
  |  Branch (5678:17): [True: 15, False: 771]
  ------------------
 5679|     15|                goto bad_id;
 5680|       |            /*
 5681|       |             * insert length if requested 
 5682|       |             */
 5683|    771|            if (doingquote == '"') {
  ------------------
  |  Branch (5683:17): [True: 433, False: 338]
  ------------------
 5684|    433|                char *endq;
 5685|    433|                if (*objidlen >= maxlen)
  ------------------
  |  Branch (5685:21): [True: 3, False: 430]
  ------------------
 5686|      3|                    goto bad_id;
 5687|    430|                endq = strchr(cp, doingquote);
 5688|    430|                if (!endq)
  ------------------
  |  Branch (5688:21): [True: 9, False: 421]
  ------------------
 5689|      9|                    goto bad_id;
 5690|    421|                objid[*objidlen] = len = endq - cp;
 5691|    421|                (*objidlen)++;
 5692|    421|            }
 5693|       |
 5694|  2.45k|            while (*cp && *cp != doingquote) {
  ------------------
  |  Branch (5694:20): [True: 2.42k, False: 21]
  |  Branch (5694:27): [True: 1.69k, False: 734]
  ------------------
 5695|  1.69k|                if (*objidlen >= maxlen)
  ------------------
  |  Branch (5695:21): [True: 4, False: 1.69k]
  ------------------
 5696|      4|                    goto bad_id;
 5697|  1.69k|                objid[*objidlen] = *cp++;
 5698|  1.69k|                (*objidlen)++;
 5699|  1.69k|            }
 5700|    755|            if (!*cp)
  ------------------
  |  Branch (5700:17): [True: 21, False: 734]
  ------------------
 5701|     21|                goto bad_id;
 5702|    734|            cp2 = cp + 1;
 5703|    734|            if (!*cp2)
  ------------------
  |  Branch (5703:17): [True: 7, False: 727]
  ------------------
 5704|      7|                cp2 = NULL;
 5705|    727|            else if (*cp2 == '.')
  ------------------
  |  Branch (5705:22): [True: 712, False: 15]
  ------------------
 5706|    712|                cp2++;
 5707|     15|            else
 5708|     15|                goto bad_id;
 5709|    719|            break;
 5710|    719|        default:
  ------------------
  |  Branch (5710:9): [True: 239, False: 2.95k]
  ------------------
 5711|    239|            goto bad_id;
 5712|  3.19k|        }
 5713|  2.86k|        cp = cp2;
 5714|  2.86k|    }
 5715|     92|    return 1;
 5716|       |
 5717|    327|  bad_id:
 5718|    327|    {
 5719|    327|        char            buf[256];
 5720|    327|#ifndef NETSNMP_DISABLE_MIB_LOADING
 5721|    327|        if (in_dices)
  ------------------
  |  Branch (5721:13): [True: 0, False: 327]
  ------------------
 5722|      0|            snprintf(buf, sizeof(buf), "Index out of range: %s (%s)",
 5723|      0|                    fcp, in_dices->ilabel);
 5724|    327|        else if (tp)
  ------------------
  |  Branch (5724:18): [True: 0, False: 327]
  ------------------
 5725|      0|            snprintf(buf, sizeof(buf), "Sub-id not found: %s -> %s", tp->label, fcp);
 5726|    327|        else
 5727|    327|#endif /* NETSNMP_DISABLE_MIB_LOADING */
 5728|    327|            snprintf(buf, sizeof(buf), "%s", fcp);
 5729|       |
 5730|    327|        snmp_set_detail(buf);
 5731|    327|    }
 5732|    327|    return 0;
 5733|    419|}

netsnmp_init_mib_internals:
  703|    168|{
  704|    168|    register struct tok *tp;
  705|    168|    register int    b, i;
  706|    168|    int             max_modc;
  707|       |
  708|    168|    if (tree_head)
  ------------------
  |  Branch (708:9): [True: 167, False: 1]
  ------------------
  709|    167|        return;
  710|       |
  711|       |    /*
  712|       |     * Set up hash list of pre-defined tokens
  713|       |     */
  714|      1|    memset(buckets, 0, sizeof(buckets));
  715|     93|    for (tp = tokens; tp->name; tp++) {
  ------------------
  |  Branch (715:23): [True: 92, False: 1]
  ------------------
  716|     92|        tp->hash = name_hash(tp->name);
  717|     92|        b = BUCKET(tp->hash);
  ------------------
  |  |  527|     92|#define BUCKET(x)       (x & (HASHSIZE-1))
  |  |  ------------------
  |  |  |  |  526|     92|#define HASHSIZE        32
  |  |  ------------------
  ------------------
  718|     92|        if (buckets[b])
  ------------------
  |  Branch (718:13): [True: 60, False: 32]
  ------------------
  719|     60|            tp->next = buckets[b];      /* BUG ??? */
  720|     92|        buckets[b] = tp;
  721|     92|    }
  722|       |
  723|       |    /*
  724|       |     * Initialise other internal structures
  725|       |     */
  726|       |
  727|      1|    max_modc = sizeof(module_map) / sizeof(module_map[0]) - 1;
  728|     22|    for (i = 0; i < max_modc; ++i)
  ------------------
  |  Branch (728:17): [True: 21, False: 1]
  ------------------
  729|     21|        module_map[i].next = &(module_map[i + 1]);
  730|      1|    module_map[max_modc].next = NULL;
  731|      1|    module_map_head = module_map;
  732|       |
  733|      1|    memset(nbuckets, 0, sizeof(nbuckets));
  734|      1|    memset(tbuckets, 0, sizeof(tbuckets));
  735|      1|    free(tclist);
  736|      1|    tc_alloc = TC_INCR;
  ------------------
  |  |  134|      1|#define TC_INCR 100
  ------------------
  737|      1|    tclist = calloc(tc_alloc, sizeof(struct tc));
  738|      1|    build_translation_table();
  739|      1|    init_tree_roots();          /* Set up initial roots */
  740|       |    /*
  741|       |     * Relies on 'add_mibdir' having set up the modules 
  742|       |     */
  743|      1|}
find_tree_node:
 1246|    362|{
 1247|    362|    struct tree    *tp, *headtp;
 1248|    362|    int             count, *int_p;
 1249|       |
 1250|    362|    if (!name || !*name)
  ------------------
  |  Branch (1250:9): [True: 0, False: 362]
  |  Branch (1250:18): [True: 2, False: 360]
  ------------------
 1251|      2|        return (NULL);
 1252|       |
 1253|    360|    headtp = tbuckets[NBUCKET(name_hash(name))];
  ------------------
  |  |  530|    360|#define NBUCKET(x)   (x & (NHASHSIZE-1))
  |  |  ------------------
  |  |  |  |  529|    360|#define NHASHSIZE    128
  |  |  ------------------
  ------------------
 1254|    473|    for (tp = headtp; tp; tp = tp->next) {
  ------------------
  |  Branch (1254:23): [True: 158, False: 315]
  ------------------
 1255|    158|        if (tp->label && !label_compare(tp->label, name)) {
  ------------------
  |  | 1240|    158|#define	label_compare	strcmp
  ------------------
  |  Branch (1255:13): [True: 158, False: 0]
  |  Branch (1255:26): [True: 45, False: 113]
  ------------------
 1256|       |
 1257|     45|            if (modid == -1)    /* Any module */
  ------------------
  |  Branch (1257:17): [True: 45, False: 0]
  ------------------
 1258|     45|                return (tp);
 1259|       |
 1260|      0|            for (int_p = tp->module_list, count = 0;
 1261|      0|                 count < tp->number_modules; ++count, ++int_p)
  ------------------
  |  Branch (1261:18): [True: 0, False: 0]
  ------------------
 1262|      0|                if (*int_p == modid)
  ------------------
  |  Branch (1262:21): [True: 0, False: 0]
  ------------------
 1263|      0|                    return (tp);
 1264|      0|        }
 1265|    158|    }
 1266|       |
 1267|    315|    return (NULL);
 1268|    360|}
find_best_tree_node:
 1388|    320|{
 1389|    320|    struct tree    *tp, *best_so_far = NULL, *retptr;
 1390|    320|    u_int           old_match = MAX_BAD, new_match = MAX_BAD;
  ------------------
  |  | 1275|    320|#define MAX_BAD 0xffffff
  ------------------
                  u_int           old_match = MAX_BAD, new_match = MAX_BAD;
  ------------------
  |  | 1275|    320|#define MAX_BAD 0xffffff
  ------------------
 1391|       |
 1392|    320|    if (!pattrn || !*pattrn)
  ------------------
  |  Branch (1392:9): [True: 0, False: 320]
  |  Branch (1392:20): [True: 1, False: 319]
  ------------------
 1393|      1|        return (NULL);
 1394|       |
 1395|    319|    if (!tree_top)
  ------------------
  |  Branch (1395:9): [True: 0, False: 319]
  ------------------
 1396|      0|        tree_top = get_tree_head();
 1397|       |
 1398|  1.24k|    for (tp = tree_top; tp; tp = tp->next_peer) {
  ------------------
  |  Branch (1398:25): [True: 937, False: 303]
  ------------------
 1399|    937|        if (!tp->reported && tp->label)
  ------------------
  |  Branch (1399:13): [True: 937, False: 0]
  |  Branch (1399:30): [True: 937, False: 0]
  ------------------
 1400|    937|            new_match = compute_match(tp->label, pattrn);
 1401|    937|        tp->reported = 1;
 1402|       |
 1403|    937|        if (new_match < old_match) {
  ------------------
  |  Branch (1403:13): [True: 45, False: 892]
  ------------------
 1404|     45|            best_so_far = tp;
 1405|     45|            old_match = new_match;
 1406|     45|        }
 1407|    937|        if (new_match == 0)
  ------------------
  |  Branch (1407:13): [True: 16, False: 921]
  ------------------
 1408|     16|            break;              /* this is the best result we can get */
 1409|    921|        if (tp->child_list) {
  ------------------
  |  Branch (1409:13): [True: 0, False: 921]
  ------------------
 1410|      0|            retptr =
 1411|      0|                find_best_tree_node(pattrn, tp->child_list, &new_match);
 1412|      0|            if (new_match < old_match) {
  ------------------
  |  Branch (1412:17): [True: 0, False: 0]
  ------------------
 1413|      0|                best_so_far = retptr;
 1414|      0|                old_match = new_match;
 1415|      0|            }
 1416|      0|            if (new_match == 0)
  ------------------
  |  Branch (1416:17): [True: 0, False: 0]
  ------------------
 1417|      0|                break;          /* this is the best result we can get */
 1418|      0|        }
 1419|    921|    }
 1420|    319|    if (match)
  ------------------
  |  Branch (1420:9): [True: 0, False: 319]
  ------------------
 1421|      0|        *match = old_match;
 1422|    319|    return (best_so_far);
 1423|    320|}
which_module:
 4125|    161|{
 4126|    161|    struct module  *mp;
 4127|       |
 4128|    161|    for (mp = module_head; mp; mp = mp->next)
  ------------------
  |  Branch (4128:28): [True: 0, False: 161]
  ------------------
 4129|      0|        if (!label_compare(mp->name, name))
  ------------------
  |  | 1240|      0|#define	label_compare	strcmp
  ------------------
  |  Branch (4129:13): [True: 0, False: 0]
  ------------------
 4130|      0|            return (mp->modid);
 4131|       |
 4132|    161|    DEBUGMSGTL(("parse-mibs", "Module %s not found\n", name));
  ------------------
  |  |   66|    161|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    161|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 161]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  164|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 161]
  |  |  ------------------
  ------------------
 4133|    161|    return (-1);
 4134|    161|}
netsnmp_read_module:
 4401|    168|{
 4402|    168|    int status = 0;
 4403|    168|    status = read_module_internal(name);
 4404|       |
 4405|    168|    if (status == MODULE_NOT_FOUND) {
  ------------------
  |  |  513|    168|#define MODULE_NOT_FOUND	0
  ------------------
  |  Branch (4405:9): [True: 168, False: 0]
  ------------------
 4406|    168|        if (!read_module_replacements(name))
  ------------------
  |  Branch (4406:13): [True: 158, False: 10]
  ------------------
 4407|    158|            print_module_not_found(name);
 4408|    168|    } else if (status == MODULE_SYNTAX_ERROR) {
  ------------------
  |  |  520|      0|#define MODULE_SYNTAX_ERROR     4
  ------------------
  |  Branch (4408:16): [True: 0, False: 0]
  ------------------
 4409|      0|        gMibError = 0;
 4410|      0|        gLoop = 1;
 4411|       |
 4412|      0|        strncat(gMibNames, " ", sizeof(gMibNames) - strlen(gMibNames) - 1);
 4413|      0|        strncat(gMibNames, name, sizeof(gMibNames) - strlen(gMibNames) - 1);
 4414|      0|    }
 4415|       |
 4416|    168|    return tree_head;
 4417|    168|}
parse.c:name_hash:
  690|    455|{
  691|    455|    int             hash = 0;
  692|    455|    const char     *cp;
  693|       |
  694|    455|    if (!name)
  ------------------
  |  Branch (694:9): [True: 0, False: 455]
  ------------------
  695|      0|        return 0;
  696|  5.52k|    for (cp = name; *cp; cp++)
  ------------------
  |  Branch (696:21): [True: 5.06k, False: 455]
  ------------------
  697|  5.06k|        hash += tolower((unsigned char)(*cp));
  ------------------
  |  Branch (697:17): [True: 0, False: 0]
  |  Branch (697:17): [True: 0, False: 0]
  |  Branch (697:17): [Folded, False: 5.06k]
  ------------------
  698|    455|    return (hash);
  699|    455|}
parse.c:build_translation_table:
 1075|      1|{
 1076|      1|    int             count;
 1077|       |
 1078|    257|    for (count = 0; count < 256; count++) {
  ------------------
  |  Branch (1078:21): [True: 256, False: 1]
  ------------------
 1079|    256|        switch (count) {
 1080|      1|        case OBJID:
  ------------------
  |  |  167|      1|#define OBJID       (4 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1080:9): [True: 1, False: 255]
  ------------------
 1081|      1|            translation_table[count] = TYPE_OBJID;
  ------------------
  |  |  155|      1|#define TYPE_OBJID          1
  ------------------
 1082|      1|            break;
 1083|      1|        case OCTETSTR:
  ------------------
  |  |  168|      1|#define OCTETSTR    (5 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1083:9): [True: 1, False: 255]
  ------------------
 1084|      1|            translation_table[count] = TYPE_OCTETSTR;
  ------------------
  |  |  156|      1|#define TYPE_OCTETSTR       2
  ------------------
 1085|      1|            break;
 1086|      1|        case INTEGER:
  ------------------
  |  |  169|      1|#define INTEGER     (6 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1086:9): [True: 1, False: 255]
  ------------------
 1087|      1|            translation_table[count] = TYPE_INTEGER;
  ------------------
  |  |  157|      1|#define TYPE_INTEGER        3
  ------------------
 1088|      1|            break;
 1089|      1|        case NETADDR:
  ------------------
  |  |  170|      1|#define NETADDR     (7 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1089:9): [True: 1, False: 255]
  ------------------
 1090|      1|            translation_table[count] = TYPE_NETADDR;
  ------------------
  |  |  158|      1|#define TYPE_NETADDR        4
  ------------------
 1091|      1|            break;
 1092|      1|        case IPADDR:
  ------------------
  |  |  171|      1|#define IPADDR      (8 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1092:9): [True: 1, False: 255]
  ------------------
 1093|      1|            translation_table[count] = TYPE_IPADDR;
  ------------------
  |  |  159|      1|#define TYPE_IPADDR         5
  ------------------
 1094|      1|            break;
 1095|      1|        case COUNTER:
  ------------------
  |  |  172|      1|#define COUNTER     (9 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1095:9): [True: 1, False: 255]
  ------------------
 1096|      1|            translation_table[count] = TYPE_COUNTER;
  ------------------
  |  |  160|      1|#define TYPE_COUNTER        6
  ------------------
 1097|      1|            break;
 1098|      1|        case GAUGE:
  ------------------
  |  |  173|      1|#define GAUGE       (10 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1098:9): [True: 1, False: 255]
  ------------------
 1099|      1|            translation_table[count] = TYPE_GAUGE;
  ------------------
  |  |  161|      1|#define TYPE_GAUGE          7
  ------------------
 1100|      1|            break;
 1101|      1|        case TIMETICKS:
  ------------------
  |  |  174|      1|#define TIMETICKS   (11 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1101:9): [True: 1, False: 255]
  ------------------
 1102|      1|            translation_table[count] = TYPE_TIMETICKS;
  ------------------
  |  |  162|      1|#define TYPE_TIMETICKS      8
  ------------------
 1103|      1|            break;
 1104|      1|        case KW_OPAQUE:
  ------------------
  |  |  175|      1|#define KW_OPAQUE   (12 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1104:9): [True: 1, False: 255]
  ------------------
 1105|      1|            translation_table[count] = TYPE_OPAQUE;
  ------------------
  |  |  163|      1|#define TYPE_OPAQUE         9
  ------------------
 1106|      1|            break;
 1107|      1|        case NUL:
  ------------------
  |  |  176|      1|#define NUL         (13 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1107:9): [True: 1, False: 255]
  ------------------
 1108|      1|            translation_table[count] = TYPE_NULL;
  ------------------
  |  |  164|      1|#define TYPE_NULL           10
  ------------------
 1109|      1|            break;
 1110|      1|        case COUNTER64:
  ------------------
  |  |  211|      1|#define COUNTER64   (43 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1110:9): [True: 1, False: 255]
  ------------------
 1111|      1|            translation_table[count] = TYPE_COUNTER64;
  ------------------
  |  |  165|      1|#define TYPE_COUNTER64      11
  ------------------
 1112|      1|            break;
 1113|      1|        case BITSTRING:
  ------------------
  |  |  209|      1|#define BITSTRING   (41 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1113:9): [True: 1, False: 255]
  ------------------
 1114|      1|            translation_table[count] = TYPE_BITSTRING;
  ------------------
  |  |  166|      1|#define TYPE_BITSTRING      12
  ------------------
 1115|      1|            break;
 1116|      1|        case NSAPADDRESS:
  ------------------
  |  |  210|      1|#define NSAPADDRESS (42 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1116:9): [True: 1, False: 255]
  ------------------
 1117|      1|            translation_table[count] = TYPE_NSAPADDRESS;
  ------------------
  |  |  167|      1|#define TYPE_NSAPADDRESS    13
  ------------------
 1118|      1|            break;
 1119|      1|        case INTEGER32:
  ------------------
  |  |  274|      1|#define INTEGER32	(105 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1119:9): [True: 1, False: 255]
  ------------------
 1120|      1|            translation_table[count] = TYPE_INTEGER32;
  ------------------
  |  |  170|      1|#define TYPE_INTEGER32      16
  ------------------
 1121|      1|            break;
 1122|      1|        case UINTEGER32:
  ------------------
  |  |  224|      1|#define UINTEGER32 (56 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1122:9): [True: 1, False: 255]
  ------------------
 1123|      1|            translation_table[count] = TYPE_UINTEGER;
  ------------------
  |  |  168|      1|#define TYPE_UINTEGER       14
  ------------------
 1124|      1|            break;
 1125|      1|        case UNSIGNED32:
  ------------------
  |  |  273|      1|#define UNSIGNED32	(104 | SYNTAX_MASK)
  |  |  ------------------
  |  |  |  |  157|      1|#define SYNTAX_MASK     0x80
  |  |  ------------------
  ------------------
  |  Branch (1125:9): [True: 1, False: 255]
  ------------------
 1126|      1|            translation_table[count] = TYPE_UNSIGNED32;
  ------------------
  |  |  169|      1|#define TYPE_UNSIGNED32     15
  ------------------
 1127|      1|            break;
 1128|      1|        case TRAPTYPE:
  ------------------
  |  |  229|      1|#define TRAPTYPE    61
  ------------------
  |  Branch (1128:9): [True: 1, False: 255]
  ------------------
 1129|      1|            translation_table[count] = TYPE_TRAPTYPE;
  ------------------
  |  |  174|      1|#define TYPE_TRAPTYPE	    20
  ------------------
 1130|      1|            break;
 1131|      1|        case NOTIFTYPE:
  ------------------
  |  |  213|      1|#define NOTIFTYPE   45
  ------------------
  |  Branch (1131:9): [True: 1, False: 255]
  ------------------
 1132|      1|            translation_table[count] = TYPE_NOTIFTYPE;
  ------------------
  |  |  175|      1|#define TYPE_NOTIFTYPE      21
  ------------------
 1133|      1|            break;
 1134|      1|        case NOTIFGROUP:
  ------------------
  |  |  258|      1|#define NOTIFGROUP  88
  ------------------
  |  Branch (1134:9): [True: 1, False: 255]
  ------------------
 1135|      1|            translation_table[count] = TYPE_NOTIFGROUP;
  ------------------
  |  |  177|      1|#define TYPE_NOTIFGROUP	    23
  ------------------
 1136|      1|            break;
 1137|      1|        case OBJGROUP:
  ------------------
  |  |  212|      1|#define OBJGROUP    44
  ------------------
  |  Branch (1137:9): [True: 1, False: 255]
  ------------------
 1138|      1|            translation_table[count] = TYPE_OBJGROUP;
  ------------------
  |  |  176|      1|#define TYPE_OBJGROUP	    22
  ------------------
 1139|      1|            break;
 1140|      1|        case MODULEIDENTITY:
  ------------------
  |  |  220|      1|#define MODULEIDENTITY 52
  ------------------
  |  Branch (1140:9): [True: 1, False: 255]
  ------------------
 1141|      1|            translation_table[count] = TYPE_MODID;
  ------------------
  |  |  178|      1|#define TYPE_MODID	    24
  ------------------
 1142|      1|            break;
 1143|      1|        case OBJIDENTITY:
  ------------------
  |  |  275|      1|#define OBJIDENTITY	106
  ------------------
  |  Branch (1143:9): [True: 1, False: 255]
  ------------------
 1144|      1|            translation_table[count] = TYPE_OBJIDENTITY;
  ------------------
  |  |  181|      1|#define TYPE_OBJIDENTITY    27
  ------------------
 1145|      1|            break;
 1146|      1|        case AGENTCAP:
  ------------------
  |  |  243|      1|#define AGENTCAP    73
  ------------------
  |  Branch (1146:9): [True: 1, False: 255]
  ------------------
 1147|      1|            translation_table[count] = TYPE_AGENTCAP;
  ------------------
  |  |  179|      1|#define TYPE_AGENTCAP       25
  ------------------
 1148|      1|            break;
 1149|      1|        case COMPLIANCE:
  ------------------
  |  |  215|      1|#define COMPLIANCE  47
  ------------------
  |  Branch (1149:9): [True: 1, False: 255]
  ------------------
 1150|      1|            translation_table[count] = TYPE_MODCOMP;
  ------------------
  |  |  180|      1|#define TYPE_MODCOMP        26
  ------------------
 1151|      1|            break;
 1152|    232|        default:
  ------------------
  |  Branch (1152:9): [True: 232, False: 24]
  ------------------
 1153|    232|            translation_table[count] = TYPE_OTHER;
  ------------------
  |  |  154|    232|#define TYPE_OTHER          0
  ------------------
 1154|    232|            break;
 1155|    256|        }
 1156|    256|    }
 1157|      1|}
parse.c:init_tree_roots:
 1161|      1|{
 1162|      1|    struct tree    *tp, *lasttp;
 1163|      1|    int             base_modid;
 1164|      1|    int             hash;
 1165|       |
 1166|      1|    base_modid = which_module("SNMPv2-SMI");
 1167|      1|    if (base_modid == -1)
  ------------------
  |  Branch (1167:9): [True: 1, False: 0]
  ------------------
 1168|      1|        base_modid = which_module("RFC1155-SMI");
 1169|      1|    if (base_modid == -1)
  ------------------
  |  Branch (1169:9): [True: 1, False: 0]
  ------------------
 1170|      1|        base_modid = which_module("RFC1213-MIB");
 1171|       |
 1172|       |    /*
 1173|       |     * build root node 
 1174|       |     */
 1175|      1|    tp = calloc(1, sizeof(struct tree));
 1176|      1|    if (tp == NULL)
  ------------------
  |  Branch (1176:9): [True: 0, False: 1]
  ------------------
 1177|      0|        return;
 1178|      1|    tp->label = strdup("joint-iso-ccitt");
 1179|      1|    tp->modid = base_modid;
 1180|      1|    tp->number_modules = 1;
 1181|      1|    tp->module_list = &(tp->modid);
 1182|      1|    tp->subid = 2;
 1183|      1|    tp->tc_index = -1;
 1184|      1|    set_function(tp);           /* from mib.c */
 1185|      1|    hash = NBUCKET(name_hash(tp->label));
  ------------------
  |  |  530|      1|#define NBUCKET(x)   (x & (NHASHSIZE-1))
  |  |  ------------------
  |  |  |  |  529|      1|#define NHASHSIZE    128
  |  |  ------------------
  ------------------
 1186|      1|    tp->next = tbuckets[hash];
 1187|      1|    tbuckets[hash] = tp;
 1188|      1|    lasttp = tp;
 1189|      1|    root_imports[0].label = strdup(tp->label);
 1190|      1|    root_imports[0].modid = base_modid;
 1191|       |
 1192|       |    /*
 1193|       |     * build root node 
 1194|       |     */
 1195|      1|    tp = calloc(1, sizeof(struct tree));
 1196|      1|    if (tp == NULL)
  ------------------
  |  Branch (1196:9): [True: 0, False: 1]
  ------------------
 1197|      0|        return;
 1198|      1|    tp->next_peer = lasttp;
 1199|      1|    tp->label = strdup("ccitt");
 1200|      1|    tp->modid = base_modid;
 1201|      1|    tp->number_modules = 1;
 1202|      1|    tp->module_list = &(tp->modid);
 1203|      1|    tp->subid = 0;
 1204|      1|    tp->tc_index = -1;
 1205|      1|    set_function(tp);           /* from mib.c */
 1206|      1|    hash = NBUCKET(name_hash(tp->label));
  ------------------
  |  |  530|      1|#define NBUCKET(x)   (x & (NHASHSIZE-1))
  |  |  ------------------
  |  |  |  |  529|      1|#define NHASHSIZE    128
  |  |  ------------------
  ------------------
 1207|      1|    tp->next = tbuckets[hash];
 1208|      1|    tbuckets[hash] = tp;
 1209|      1|    lasttp = tp;
 1210|      1|    root_imports[1].label = strdup(tp->label);
 1211|      1|    root_imports[1].modid = base_modid;
 1212|       |
 1213|       |    /*
 1214|       |     * build root node 
 1215|       |     */
 1216|      1|    tp = calloc(1, sizeof(struct tree));
 1217|      1|    if (tp == NULL)
  ------------------
  |  Branch (1217:9): [True: 0, False: 1]
  ------------------
 1218|      0|        return;
 1219|      1|    tp->next_peer = lasttp;
 1220|      1|    tp->label = strdup("iso");
 1221|      1|    tp->modid = base_modid;
 1222|      1|    tp->number_modules = 1;
 1223|      1|    tp->module_list = &(tp->modid);
 1224|      1|    tp->subid = 1;
 1225|      1|    tp->tc_index = -1;
 1226|      1|    set_function(tp);           /* from mib.c */
 1227|      1|    hash = NBUCKET(name_hash(tp->label));
  ------------------
  |  |  530|      1|#define NBUCKET(x)   (x & (NHASHSIZE-1))
  |  |  ------------------
  |  |  |  |  529|      1|#define NHASHSIZE    128
  |  |  ------------------
  ------------------
 1228|      1|    tp->next = tbuckets[hash];
 1229|      1|    tbuckets[hash] = tp;
 1230|      1|    lasttp = tp;
 1231|      1|    root_imports[2].label = strdup(tp->label);
 1232|      1|    root_imports[2].modid = base_modid;
 1233|       |
 1234|      1|    tree_head = tp;
 1235|      1|}
parse.c:compute_match:
 1318|    937|{
 1319|    937|#if defined(HAVE_REGEX_H) && defined(HAVE_REGCOMP)
 1320|    937|    int             rc;
 1321|    937|    regex_t         parsetree;
 1322|    937|    regmatch_t      pmatch;
 1323|       |
 1324|    937|    if (regex_nesting_too_deep(key))
  ------------------
  |  Branch (1324:9): [True: 0, False: 937]
  ------------------
 1325|      0|        return MAX_BAD;
  ------------------
  |  | 1275|      0|#define MAX_BAD 0xffffff
  ------------------
 1326|    937|    rc = regcomp(&parsetree, key, REG_ICASE | REG_EXTENDED);
 1327|    937|    if (rc == 0)
  ------------------
  |  Branch (1327:9): [True: 892, False: 45]
  ------------------
 1328|    892|        rc = regexec(&parsetree, search_base, 1, &pmatch, 0);
 1329|    937|    regfree(&parsetree);
 1330|    937|    if (rc == 0) {
  ------------------
  |  Branch (1330:9): [True: 55, False: 882]
  ------------------
 1331|       |        /*
 1332|       |         * found 
 1333|       |         */
 1334|     55|        return pmatch.rm_so;
 1335|     55|    }
 1336|       |#else                           /* use our own wildcard matcher */
 1337|       |    /*
 1338|       |     * first find the longest matching substring (ick) 
 1339|       |     */
 1340|       |    char           *first = NULL, *result = NULL, *entry;
 1341|       |    const char     *position;
 1342|       |    char           *newkey = strdup(key);
 1343|       |    char           *st;
 1344|       |
 1345|       |
 1346|       |    entry = strtok_r(newkey, "*", &st);
 1347|       |    position = search_base;
 1348|       |    while (entry) {
 1349|       |        result = strcasestr(position, entry);
 1350|       |
 1351|       |        if (result == NULL) {
 1352|       |            free(newkey);
 1353|       |            return MAX_BAD;
 1354|       |        }
 1355|       |
 1356|       |        if (first == NULL)
 1357|       |            first = result;
 1358|       |
 1359|       |        position = result + strlen(entry);
 1360|       |        entry = strtok_r(NULL, "*", &st);
 1361|       |    }
 1362|       |    free(newkey);
 1363|       |    if (result)
 1364|       |        return (first - search_base);
 1365|       |#endif
 1366|       |
 1367|       |    /*
 1368|       |     * not found 
 1369|       |     */
 1370|    882|    return MAX_BAD;
  ------------------
  |  | 1275|    882|#define MAX_BAD 0xffffff
  ------------------
 1371|    937|}
parse.c:regex_nesting_too_deep:
 1292|    937|{
 1293|    937|    int             depth = 0;
 1294|       |
 1295|  22.8k|    for (; *key; key++) {
  ------------------
  |  Branch (1295:12): [True: 21.9k, False: 937]
  ------------------
 1296|  21.9k|        switch (*key) {
  ------------------
  |  Branch (1296:17): [True: 12, False: 21.9k]
  ------------------
 1297|      6|        case '\\':
  ------------------
  |  Branch (1297:9): [True: 6, False: 21.9k]
  ------------------
 1298|      6|            if (!key[1])
  ------------------
  |  Branch (1298:17): [True: 0, False: 6]
  ------------------
 1299|      0|                return 0;
 1300|      6|            key++;
 1301|      6|            break;
 1302|      6|        case '(':
  ------------------
  |  Branch (1302:9): [True: 6, False: 21.9k]
  ------------------
 1303|      6|            if (++depth > MAX_REGEX_NESTING_DEPTH)
  ------------------
  |  | 1283|      6|#define MAX_REGEX_NESTING_DEPTH 32
  ------------------
  |  Branch (1303:17): [True: 0, False: 6]
  ------------------
 1304|      0|                return 1;
 1305|      6|            break;
 1306|      6|        case ')':
  ------------------
  |  Branch (1306:9): [True: 0, False: 21.9k]
  ------------------
 1307|      0|            if (depth > 0)
  ------------------
  |  Branch (1307:17): [True: 0, False: 0]
  ------------------
 1308|      0|                depth--;
 1309|      0|            break;
 1310|  21.9k|        }
 1311|  21.9k|    }
 1312|    937|    return 0;
 1313|    937|}
parse.c:read_module_internal:
 4309|    168|{
 4310|    168|    struct module  *mp;
 4311|       |
 4312|    168|    netsnmp_init_mib_internals();
 4313|       |
 4314|    168|    for (mp = module_head; mp; mp = mp->next)
  ------------------
  |  Branch (4314:28): [True: 0, False: 168]
  ------------------
 4315|      0|        if (!label_compare(mp->name, name))
  ------------------
  |  | 1240|      0|#define	label_compare	strcmp
  ------------------
  |  Branch (4315:13): [True: 0, False: 0]
  ------------------
 4316|      0|            return read_from_file(mp, name);
 4317|       |
 4318|    168|    return MODULE_NOT_FOUND;
  ------------------
  |  |  513|    168|#define MODULE_NOT_FOUND	0
  ------------------
 4319|    168|}
parse.c:print_error:
  783|    148|{
  784|    148|    erroneousMibs++;
  785|    148|    if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
  ------------------
  |  |   48|    148|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
  |  Branch (785:9): [True: 148, False: 0]
  ------------------
  786|    148|                                NETSNMP_DS_LIB_MIB_ERRORS))
  ------------------
  |  |   59|    148|#define NETSNMP_DS_LIB_MIB_ERRORS          0
  ------------------
  787|    148|	return;
  788|      0|    DEBUGMSGTL(("parse-mibs", "\n"));
  ------------------
  |  |   66|      0|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  164|      0|#define __DBGMSGTL(x)    __DBGTRACE, debugmsgtoken x, debugmsg x
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define __DBGTRACE       __DBGMSGT(("trace","%s(): %s, %d:\n",\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define __DBGMSGT(x)     debugmsgtoken x,  debugmsg x
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  155|      0|				NETSNMP_FUNCTION,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 0]
  |  |  ------------------
  ------------------
  789|      0|    if (type == ENDOFFILE)
  ------------------
  |  |  163|      0|#define ENDOFFILE   0
  ------------------
  |  Branch (789:9): [True: 0, False: 0]
  ------------------
  790|      0|        snmp_log(LOG_ERR, "%s (EOF): At line %d in %s\n", str, mibLine,
  791|      0|                 File);
  792|      0|    else if (token && *token)
  ------------------
  |  Branch (792:14): [True: 0, False: 0]
  |  Branch (792:23): [True: 0, False: 0]
  ------------------
  793|      0|        snmp_log(LOG_ERR, "%s (%s): At line %d in %s\n", str, token,
  794|      0|                 mibLine, File);
  795|      0|    else
  796|      0|        snmp_log(LOG_ERR, "%s: At line %d in %s\n", str, mibLine, File);
  797|      0|}
parse.c:read_module_replacements:
 4189|    168|{
 4190|    168|    struct module_compatability *mcp;
 4191|       |
 4192|  3.71k|    for (mcp = module_map_head; mcp; mcp = mcp->next) {
  ------------------
  |  Branch (4192:33): [True: 3.55k, False: 158]
  ------------------
 4193|  3.55k|        if (!label_compare(mcp->old_module, name)) {
  ------------------
  |  | 1240|  3.55k|#define	label_compare	strcmp
  ------------------
  |  Branch (4193:13): [True: 10, False: 3.54k]
  ------------------
 4194|     10|            if (netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, 
  ------------------
  |  |   48|     10|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
  |  Branch (4194:17): [True: 0, False: 10]
  ------------------
 4195|     10|				   NETSNMP_DS_LIB_MIB_WARNINGS)) {
  ------------------
  |  |  114|     10|#define NETSNMP_DS_LIB_MIB_WARNINGS         0
  ------------------
 4196|      0|                snmp_log(LOG_WARNING,
 4197|      0|                         "Loading replacement module %s for %s (%s)\n",
 4198|      0|                         mcp->new_module, name, File);
 4199|      0|	    }
 4200|     10|            (void) netsnmp_read_module(mcp->new_module);
 4201|     10|            return 1;
 4202|     10|        }
 4203|  3.55k|    }
 4204|    158|    return 0;
 4205|    168|}
parse.c:print_module_not_found:
  801|    158|{
  802|    158|    if (first_err_module) {
  ------------------
  |  Branch (802:9): [True: 1, False: 157]
  ------------------
  803|      1|        snmp_log(LOG_ERR, "MIB search path: %s\n",
  804|      1|                           netsnmp_get_mib_directory());
  805|      1|        first_err_module = 0;
  806|      1|    }
  807|    158|    if (!last_err_module || strcmp(cp, last_err_module))
  ------------------
  |  Branch (807:9): [True: 1, False: 157]
  |  Branch (807:29): [True: 147, False: 10]
  ------------------
  808|    148|        print_error("Cannot find module", cp, CONTINUE);
  ------------------
  |  |  162|    148|#define CONTINUE    -1
  ------------------
  809|    158|    if (last_err_module)
  ------------------
  |  Branch (809:9): [True: 157, False: 1]
  ------------------
  810|    157|        free(last_err_module);
  811|    158|    last_err_module = strdup(cp);
  812|    158|}

snmp_set_detail:
  529|    327|{
  530|    327|    if (detail_string != NULL) {
  ------------------
  |  Branch (530:9): [True: 327, False: 0]
  ------------------
  531|    327|        strlcpy(snmp_detail, detail_string, sizeof(snmp_detail));
  532|    327|        snmp_detail_f = 1;
  533|    327|    }
  534|    327|}

snmp_get_do_debugging:
  551|    488|{
  552|    488|    return dodebug;
  553|    488|}

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:
 1103|      1|{
 1104|      1|    static int      newline = 1;	 /* MTCRITICAL_RESOURCE */
 1105|      1|    const char     *newline_ptr;
 1106|      1|    char            sbuf[40];
 1107|       |
 1108|      1|    if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, 
  ------------------
  |  |   48|      1|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
  |  Branch (1108:9): [True: 0, False: 1]
  ------------------
 1109|      1|                               NETSNMP_DS_LIB_LOG_TIMESTAMP) && newline) {
  ------------------
  |  |   64|      1|#define NETSNMP_DS_LIB_LOG_TIMESTAMP       5
  ------------------
  |  Branch (1109:65): [True: 0, False: 0]
  ------------------
 1110|      0|        snprintf_stamp(NULL, sbuf, sizeof(sbuf));
 1111|      1|    } else {
 1112|      1|        strcpy(sbuf, "");
 1113|      1|    }
 1114|       |    /*
 1115|       |     * Remember whether or not the current line ends with a newline for the
 1116|       |     * next call of log_handler_stdouterr().
 1117|       |     */
 1118|      1|    newline_ptr = strrchr(str, '\n');
 1119|      1|    newline = newline_ptr && newline_ptr[1] == 0;
  ------------------
  |  Branch (1119:15): [True: 1, False: 0]
  |  Branch (1119:30): [True: 1, False: 0]
  ------------------
 1120|       |
 1121|      1|    if (logh->imagic)
  ------------------
  |  Branch (1121:9): [True: 0, False: 1]
  ------------------
 1122|      0|       printf(         "%s%s", sbuf, str);
 1123|      1|    else
 1124|      1|       fprintf(stderr, "%s%s", sbuf, str);
 1125|       |
 1126|      1|    return 1;
 1127|      1|}
snmp_log_string:
 1294|      1|{
 1295|      1|#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
 1296|      1|    static int stderr_enabled = 0;
 1297|      1|    static netsnmp_log_handler lh = { 1, 0, 0, 0, "stderr",
 1298|      1|                                      log_handler_stdouterr, 0, NULL,  NULL,
 1299|      1|                                      NULL };
 1300|      1|#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
 1301|      1|    netsnmp_log_handler *logh;
 1302|       |
 1303|       |    /*
 1304|       |     * We've got to be able to log messages *somewhere*!
 1305|       |     * If you don't want stderr logging, then enable something else.
 1306|       |     */
 1307|      1|    if (0 == logh_enabled) {
  ------------------
  |  Branch (1307:9): [True: 1, False: 0]
  ------------------
 1308|      1|#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
 1309|      1|        if (!stderr_enabled) {
  ------------------
  |  Branch (1309:13): [True: 1, False: 0]
  ------------------
 1310|      1|            ++stderr_enabled;
 1311|      1|            netsnmp_set_line_buffering(stderr);
 1312|      1|        }
 1313|      1|        log_handler_stdouterr( &lh, priority, str );
 1314|      1|#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
 1315|       |
 1316|      1|        return;
 1317|      1|    }
 1318|      0|#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
 1319|      0|    else if (stderr_enabled) {
  ------------------
  |  Branch (1319:14): [True: 0, False: 0]
  ------------------
 1320|      0|        stderr_enabled = 0;
 1321|      0|        log_handler_stdouterr( &lh, LOG_INFO,
 1322|      0|                               "Log handling defined - disabling stderr\n" );
 1323|      0|    }
 1324|      0|#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
 1325|       |        
 1326|       |
 1327|       |    /*
 1328|       |     * Start at the given priority, and work "upwards"....
 1329|       |     */
 1330|      0|    if (priority < LOG_EMERG)
  ------------------
  |  Branch (1330:9): [True: 0, False: 0]
  ------------------
 1331|      0|        priority = LOG_EMERG;
 1332|      0|    else if (priority > LOG_DEBUG)
  ------------------
  |  Branch (1332:14): [True: 0, False: 0]
  ------------------
 1333|      0|        priority = LOG_DEBUG;
 1334|      0|    logh = logh_priorities[priority];
 1335|      0|    for ( ; logh; logh = logh->next ) {
  ------------------
  |  Branch (1335:13): [True: 0, False: 0]
  ------------------
 1336|       |        /*
 1337|       |         * ... but skipping any handlers with a "maximum priority"
 1338|       |         *     that we have already exceeded. And don't forget to
 1339|       |         *     ensure this logging is turned on (see snmp_disable_stderrlog
 1340|       |         *     and its cohorts).
 1341|       |         */
 1342|      0|        if (logh->enabled && priority >= logh->pri_max)
  ------------------
  |  Branch (1342:13): [True: 0, False: 0]
  |  Branch (1342:30): [True: 0, False: 0]
  ------------------
 1343|      0|            logh->handler( logh, priority, str );
 1344|      0|    }
 1345|      0|}
snmp_vlog:
 1383|      1|{
 1384|      1|    char           *buffer = NULL;
 1385|      1|    int             length;
 1386|       |
 1387|      1|    length = vasprintf(&buffer, format, ap);
 1388|      1|    if (length < 0) {
  ------------------
  |  Branch (1388:9): [True: 0, False: 1]
  ------------------
 1389|      0|        snmp_log_string(LOG_ERR, "Could not format log-string\n");
 1390|      0|        return -1;
 1391|      0|    }
 1392|       |
 1393|      1|    snmp_log_string(priority, buffer);
 1394|      1|    free(buffer);
 1395|      1|    return 0;
 1396|      1|}
snmp_log:
 1407|      1|{
 1408|      1|    va_list         ap;
 1409|      1|    int             ret;
 1410|      1|    va_start(ap, format);
 1411|      1|    ret = snmp_vlog(priority, format, ap);
 1412|       |    va_end(ap);
 1413|      1|    return (ret);
 1414|      1|}

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

netsnmp_getenv:
 1186|      1|{
 1187|      1|#if !defined (WIN32) && !defined (cygwin)
 1188|      1|  return (getenv(name));
 1189|       |#else
 1190|       |  char *temp = NULL;  
 1191|       |  HKEY hKey;
 1192|       |  unsigned char * key_value = NULL;
 1193|       |  DWORD key_value_size = 0;
 1194|       |  DWORD key_value_type = 0;
 1195|       |  DWORD getenv_worked = 0;
 1196|       |
 1197|       |  DEBUGMSGTL(("read_config", "netsnmp_getenv called with name: %s\n",name));
 1198|       |
 1199|       |  if (!(name))
 1200|       |    return NULL;
 1201|       |  
 1202|       |  /* Try environment variable first */ 
 1203|       |  temp = getenv(name);
 1204|       |  if (temp) {
 1205|       |    getenv_worked = 1;
 1206|       |    DEBUGMSGTL(("read_config", "netsnmp_getenv will return from ENV: %s\n",temp));
 1207|       |  }
 1208|       |  
 1209|       |  /* Next try HKCU */
 1210|       |  if (temp == NULL)
 1211|       |  {
 1212|       |    if (getenv("SNMP_IGNORE_WINDOWS_REGISTRY"))
 1213|       |      return NULL;
 1214|       |
 1215|       |    if (RegOpenKeyExA(
 1216|       |          HKEY_CURRENT_USER, 
 1217|       |          "SOFTWARE\\Net-SNMP", 
 1218|       |          0, 
 1219|       |          KEY_QUERY_VALUE, 
 1220|       |          &hKey) == ERROR_SUCCESS) {   
 1221|       |      
 1222|       |      if (RegQueryValueExA(
 1223|       |            hKey, 
 1224|       |            name, 
 1225|       |            NULL, 
 1226|       |            &key_value_type, 
 1227|       |            NULL,               /* Just get the size */
 1228|       |            &key_value_size) == ERROR_SUCCESS) {
 1229|       |
 1230|       |        SNMP_FREE(key_value);
 1231|       |
 1232|       |        /* Allocate memory needed +1 to allow RegQueryValueExA to NULL terminate the
 1233|       |         * string data in registry is missing one (which is unlikely).
 1234|       |         */
 1235|       |        key_value = malloc((sizeof(char) * key_value_size)+sizeof(char));
 1236|       |        
 1237|       |        if (RegQueryValueExA(
 1238|       |              hKey, 
 1239|       |              name, 
 1240|       |              NULL, 
 1241|       |              &key_value_type, 
 1242|       |              key_value, 
 1243|       |              &key_value_size) == ERROR_SUCCESS) {
 1244|       |        }
 1245|       |        temp = (char *) key_value;
 1246|       |      }
 1247|       |      RegCloseKey(hKey);
 1248|       |      if (temp)
 1249|       |        DEBUGMSGTL(("read_config", "netsnmp_getenv will return from HKCU: %s\n",temp));
 1250|       |    }
 1251|       |  }
 1252|       |
 1253|       |  /* Next try HKLM */
 1254|       |  if (temp == NULL)
 1255|       |  {
 1256|       |    if (RegOpenKeyExA(
 1257|       |          HKEY_LOCAL_MACHINE, 
 1258|       |          "SOFTWARE\\Net-SNMP", 
 1259|       |          0, 
 1260|       |          KEY_QUERY_VALUE, 
 1261|       |          &hKey) == ERROR_SUCCESS) {   
 1262|       |      
 1263|       |      if (RegQueryValueExA(
 1264|       |            hKey, 
 1265|       |            name, 
 1266|       |            NULL, 
 1267|       |            &key_value_type, 
 1268|       |            NULL,               /* Just get the size */
 1269|       |            &key_value_size) == ERROR_SUCCESS) {
 1270|       |
 1271|       |        SNMP_FREE(key_value);
 1272|       |
 1273|       |        /* Allocate memory needed +1 to allow RegQueryValueExA to NULL terminate the
 1274|       |         * string data in registry is missing one (which is unlikely).
 1275|       |         */
 1276|       |        key_value = malloc((sizeof(char) * key_value_size)+sizeof(char));
 1277|       |        
 1278|       |        if (RegQueryValueExA(
 1279|       |              hKey, 
 1280|       |              name, 
 1281|       |              NULL, 
 1282|       |              &key_value_type, 
 1283|       |              key_value, 
 1284|       |              &key_value_size) == ERROR_SUCCESS) {
 1285|       |        }
 1286|       |        temp = (char *) key_value;
 1287|       |
 1288|       |      }
 1289|       |      RegCloseKey(hKey);
 1290|       |      if (temp)
 1291|       |        DEBUGMSGTL(("read_config", "netsnmp_getenv will return from HKLM: %s\n",temp));
 1292|       |    }
 1293|       |  }
 1294|       |  
 1295|       |  if (temp && !getenv_worked) {
 1296|       |    setenv(name, temp, 1);
 1297|       |    SNMP_FREE(temp);
 1298|       |  }
 1299|       |
 1300|       |  DEBUGMSGTL(("read_config", "netsnmp_getenv returning: %s\n",getenv(name)));
 1301|       |
 1302|       |  return(getenv(name));
 1303|       |#endif
 1304|      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|    575|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   54|    575|    oid *root = malloc(MAX_OID_LEN * sizeof(oid));
  ------------------
  |  |  120|    575|#define MAX_OID_LEN	    128 /* max subid's in an oid */
  ------------------
   55|    575|    size_t rootlen = MAX_OID_LEN;
  ------------------
  |  |  120|    575|#define MAX_OID_LEN	    128 /* max subid's in an oid */
  ------------------
   56|    575|    char *input;
   57|       |
   58|    575|    input = strndup((const char *)data, size);
   59|    575|    if (root && input)
  ------------------
  |  Branch (59:9): [True: 575, False: 0]
  |  Branch (59:17): [True: 575, False: 0]
  ------------------
   60|    575|        snmp_parse_oid((const char *)input, root, &rootlen);
   61|    575|    free(root);
   62|    575|    free(input);
   63|    575|    return 0; 
   64|    575|}

