asn_parse_nlength:
  325|  94.5k|{
  326|  94.5k|    int len_len;
  327|       |
  328|  94.5k|    if (pkt_len < 1)
  ------------------
  |  Branch (328:9): [True: 0, False: 94.5k]
  ------------------
  329|      0|        return NULL;               /* always too short */
  330|       |
  331|  94.5k|    if (NULL == pkt || NULL == data_len)
  ------------------
  |  Branch (331:9): [True: 0, False: 94.5k]
  |  Branch (331:24): [True: 0, False: 94.5k]
  ------------------
  332|      0|        return NULL;
  333|       |
  334|  94.5k|    *data_len = 0;
  335|       |
  336|  94.5k|    if (*pkt & 0x80) {
  ------------------
  |  Branch (336:9): [True: 12.2k, False: 82.3k]
  ------------------
  337|       |        /*
  338|       |         * long length; first byte is length of length (after masking high bit)
  339|       |         */
  340|  12.2k|        len_len = (int) ((*pkt & ~0x80) + 1);
  341|  12.2k|        if (pkt_len < len_len)
  ------------------
  |  Branch (341:13): [True: 134, False: 12.0k]
  ------------------
  342|    134|            return NULL;           /* still too short for length and data */
  343|       |
  344|       |        /* now we know we have enough data to parse length */
  345|  12.0k|        if (NULL == asn_parse_length(pkt, data_len))
  ------------------
  |  Branch (345:13): [True: 369, False: 11.7k]
  ------------------
  346|    369|            return NULL;           /* propagate error from asn_parse_length */
  347|  82.3k|    } else {
  348|       |        /*
  349|       |         * short length; first byte is the length
  350|       |         */
  351|  82.3k|        len_len = 1;
  352|  82.3k|        *data_len = *pkt;
  353|  82.3k|    }
  354|       |
  355|  94.0k|    if ((*data_len + len_len) > pkt_len)
  ------------------
  |  Branch (355:9): [True: 1.06k, False: 93.0k]
  ------------------
  356|  1.06k|        return NULL;
  357|       |
  358|  93.0k|    return (pkt + len_len);
  359|  94.0k|}
asn_parse_int:
  559|  9.53k|{
  560|       |    /*
  561|       |     * ASN.1 integer ::= 0x02 asnlength byte {byte}*
  562|       |     */
  563|  9.53k|    static const char *errpre = "parse int";
  564|  9.53k|    register u_char *bufp = data;
  565|  9.53k|    u_long          asn_length;
  566|  9.53k|    int             i;
  567|  9.53k|    union {
  568|  9.53k|        long          l;
  569|  9.53k|        unsigned char b[sizeof(long)];
  570|  9.53k|    } value;
  571|       |
  572|  9.53k|    if (NULL == data || NULL == datalength || NULL == type || NULL == intp) {
  ------------------
  |  Branch (572:9): [True: 0, False: 9.53k]
  |  Branch (572:25): [True: 0, False: 9.53k]
  |  Branch (572:47): [True: 0, False: 9.53k]
  |  Branch (572:63): [True: 0, False: 9.53k]
  ------------------
  573|      0|        ERROR_MSG("parse int: NULL pointer");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  574|      0|        return NULL;
  575|      0|    }
  576|       |
  577|  9.53k|    if (intsize != sizeof(long)) {
  ------------------
  |  Branch (577:9): [True: 0, False: 9.53k]
  ------------------
  578|      0|        _asn_size_err(errpre, intsize, sizeof(long));
  579|      0|        return NULL;
  580|      0|    }
  581|       |
  582|       |    /** need at least 2 bytes to work with: type, length (which might be 0)  */
  583|  9.53k|    if (*datalength < 2) {
  ------------------
  |  Branch (583:9): [True: 78, False: 9.45k]
  ------------------
  584|     78|        _asn_short_err(errpre, *datalength, 2);
  585|     78|        return NULL;
  586|     78|    }
  587|       |
  588|  9.45k|    *type = *bufp++;
  589|  9.45k|    if (*type != ASN_INTEGER) {
  ------------------
  |  |   75|  9.45k|#define ASN_INTEGER	    0x02U
  ------------------
  |  Branch (589:9): [True: 32, False: 9.42k]
  ------------------
  590|     32|        _asn_type_err(errpre, *type);
  591|     32|        return NULL;
  592|     32|    }
  593|       |
  594|  9.42k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
  595|  9.42k|    if (NULL == bufp) {
  ------------------
  |  Branch (595:9): [True: 300, False: 9.12k]
  ------------------
  596|    300|        _asn_short_err(errpre, *datalength - 1, asn_length);
  597|    300|        return NULL;
  598|    300|    }
  599|       |
  600|  9.12k|    if ((size_t) asn_length > intsize || (int) asn_length == 0) {
  ------------------
  |  Branch (600:9): [True: 30, False: 9.09k]
  |  Branch (600:42): [True: 16, False: 9.08k]
  ------------------
  601|     46|        _asn_length_err(errpre, (size_t) asn_length, intsize);
  602|     46|        return NULL;
  603|     46|    }
  604|       |
  605|  9.08k|    *datalength -= (int) asn_length + (bufp - data);
  606|       |
  607|  9.08k|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|  9.08k|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  9.08k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 9.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  196|      0|        debugmsg("dumpx" token, "dumpx_%s:%*s", token, __DBGINDENT(), ""); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  |  |  197|      0|        __DBGMSGHEX(("dumpx_" token,buf,len)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|      0|#define __DBGMSGHEX(x)     debugmsg_hex x
  |  |  |  |  ------------------
  |  |  |  |  198|      0|        if (debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (198:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  199|      0|            debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (199:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  200|      0|            debugmsg("dumpx_" token,"\n"); \
  |  |  |  |  201|      0|        } else { \
  |  |  |  |  202|      0|            debugmsg("dumpx_" token,"  "); \
  |  |  |  |  203|      0|        } \
  |  |  |  |  204|      0|        debugmsg("dumpv" token, "dumpv_%s:%*s", token, __DBGINDENT(), "");
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (83:60): [Folded, False: 9.08k]
  |  |  ------------------
  ------------------
  608|       |
  609|  9.08k|    memset(&value.b, *bufp & 0x80 ? 0xff : 0, sizeof(value.b));
  ------------------
  |  Branch (609:22): [True: 1.81k, False: 7.26k]
  ------------------
  610|  9.08k|    if (NETSNMP_BIGENDIAN) {
  ------------------
  |  | 2425|  9.08k|#  define NETSNMP_BIGENDIAN 0
  |  |  ------------------
  |  |  |  Branch (2425:29): [Folded, False: 9.08k]
  |  |  ------------------
  ------------------
  611|      0|        for (i = sizeof(long) - asn_length; asn_length--; i++)
  ------------------
  |  Branch (611:45): [True: 0, False: 0]
  ------------------
  612|      0|            value.b[i] = *bufp++;
  613|  9.08k|    } else {
  614|  24.2k|        for (i = asn_length - 1; asn_length--; i--)
  ------------------
  |  Branch (614:34): [True: 15.1k, False: 9.08k]
  ------------------
  615|  15.1k|            value.b[i] = *bufp++;
  616|  9.08k|    }
  617|       |
  618|  9.08k|    CHECK_OVERFLOW_S(value.l, 1);
  ------------------
  |  |  214|  9.08k|#define CHECK_OVERFLOW_S(x,y) do {                                      \
  |  |  215|  9.08k|        if (x > INT32_MAX) {                                            \
  |  |  ------------------
  |  |  |  Branch (215:13): [True: 380, False: 8.70k]
  |  |  ------------------
  |  |  216|    380|            DEBUGMSG(("asn","truncating signed value %ld to 32 bits (%d)\n",(long)(x),y)); \
  |  |  ------------------
  |  |  |  |   61|    380|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|    380|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (144:29): [True: 0, False: 380]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (61:67): [Folded, False: 380]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  217|    380|            x &= 0xffffffff;                                            \
  |  |  218|  8.70k|        } else if (x < INT32_MIN) {                                     \
  |  |  ------------------
  |  |  |  Branch (218:20): [True: 440, False: 8.26k]
  |  |  ------------------
  |  |  219|    440|            DEBUGMSG(("asn","truncating signed value %ld to 32 bits (%d)\n",(long)(x),y)); \
  |  |  ------------------
  |  |  |  |   61|    440|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|    440|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (144:29): [True: 0, False: 440]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (61:67): [Folded, False: 440]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  220|    440|            x = 0 - (x & 0xffffffff);                                   \
  |  |  221|    440|        }                                                               \
  |  |  222|  9.08k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded, False: 9.08k]
  |  |  ------------------
  ------------------
  619|       |
  620|  9.08k|    DEBUGMSG(("dumpv_recv", "  Integer:\t%ld (0x%.2lX)\n", value.l, value.l));
  ------------------
  |  |   61|  9.08k|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|  9.08k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 9.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 9.08k]
  |  |  ------------------
  ------------------
  621|       |
  622|  9.08k|    *intp = value.l;
  623|  9.08k|    return bufp;
  624|  9.12k|}
asn_parse_unsigned_int:
  652|  3.74k|{
  653|       |    /*
  654|       |     * ASN.1 integer ::= 0x02 asnlength byte {byte}*
  655|       |     */
  656|  3.74k|    static const char *errpre = "parse uint";
  657|  3.74k|    register u_char *bufp = data;
  658|  3.74k|    u_long          asn_length;
  659|  3.74k|    register u_long value = 0;
  660|       |
  661|  3.74k|    if (NULL == data || NULL == datalength || NULL == type || NULL == intp) {
  ------------------
  |  Branch (661:9): [True: 0, False: 3.74k]
  |  Branch (661:25): [True: 0, False: 3.74k]
  |  Branch (661:47): [True: 0, False: 3.74k]
  |  Branch (661:63): [True: 0, False: 3.74k]
  ------------------
  662|      0|        ERROR_MSG("parse uint: NULL pointer");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  663|      0|        return NULL;
  664|      0|    }
  665|       |
  666|  3.74k|    if (intsize != sizeof(long)) {
  ------------------
  |  Branch (666:9): [True: 0, False: 3.74k]
  ------------------
  667|      0|        _asn_size_err(errpre, intsize, sizeof(long));
  668|      0|        return NULL;
  669|      0|    }
  670|       |
  671|       |    /** need at least 2 bytes to work with: type, length (which might be 0)  */
  672|  3.74k|    if (*datalength < 2) {
  ------------------
  |  Branch (672:9): [True: 2, False: 3.74k]
  ------------------
  673|      2|        _asn_short_err(errpre, *datalength, 2);
  674|      2|        return NULL;
  675|      2|    }
  676|       |
  677|  3.74k|    *type = *bufp++;
  678|  3.74k|    if (*type != ASN_COUNTER && *type != ASN_GAUGE && *type != ASN_TIMETICKS
  ------------------
  |  |   89|  7.48k|#define ASN_COUNTER	(ASN_APPLICATION | 1)
  |  |  ------------------
  |  |  |  |   91|  3.74k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
                  if (*type != ASN_COUNTER && *type != ASN_GAUGE && *type != ASN_TIMETICKS
  ------------------
  |  |   90|  6.25k|#define ASN_GAUGE	(ASN_APPLICATION | 2)
  |  |  ------------------
  |  |  |  |   91|  2.51k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
                  if (*type != ASN_COUNTER && *type != ASN_GAUGE && *type != ASN_TIMETICKS
  ------------------
  |  |   92|  5.42k|#define ASN_TIMETICKS   (ASN_APPLICATION | 3)
  |  |  ------------------
  |  |  |  |   91|  1.68k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (678:9): [True: 2.51k, False: 1.23k]
  |  Branch (678:33): [True: 1.68k, False: 824]
  |  Branch (678:55): [True: 939, False: 747]
  ------------------
  679|    939|            && *type != ASN_UINTEGER) {
  ------------------
  |  |  100|    939|#define ASN_UINTEGER    (ASN_APPLICATION | 7)   /* historic - don't use */
  |  |  ------------------
  |  |  |  |   91|    939|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (679:16): [True: 22, False: 917]
  ------------------
  680|     22|        _asn_type_err(errpre, *type);
  681|     22|        return NULL;
  682|     22|    }
  683|       |
  684|  3.72k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
  685|  3.72k|    if (NULL == bufp) {
  ------------------
  |  Branch (685:9): [True: 136, False: 3.58k]
  ------------------
  686|    136|        _asn_short_err(errpre, *datalength - 1, asn_length);
  687|    136|        return NULL;
  688|    136|    }
  689|       |
  690|  3.58k|    if ((asn_length > (intsize + 1)) || ((int) asn_length == 0) ||
  ------------------
  |  Branch (690:9): [True: 16, False: 3.56k]
  |  Branch (690:41): [True: 18, False: 3.55k]
  ------------------
  691|  3.55k|        ((asn_length == intsize + 1) && *bufp != 0x00)) {
  ------------------
  |  Branch (691:10): [True: 354, False: 3.19k]
  |  Branch (691:41): [True: 10, False: 344]
  ------------------
  692|     44|        _asn_length_err(errpre, (size_t) asn_length, intsize);
  693|     44|        return NULL;
  694|     44|    }
  695|  3.54k|    *datalength -= (int) asn_length + (bufp - data);
  696|       |
  697|  3.54k|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|  3.54k|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  3.54k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  196|      0|        debugmsg("dumpx" token, "dumpx_%s:%*s", token, __DBGINDENT(), ""); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  |  |  197|      0|        __DBGMSGHEX(("dumpx_" token,buf,len)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|      0|#define __DBGMSGHEX(x)     debugmsg_hex x
  |  |  |  |  ------------------
  |  |  |  |  198|      0|        if (debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (198:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  199|      0|            debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (199:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  200|      0|            debugmsg("dumpx_" token,"\n"); \
  |  |  |  |  201|      0|        } else { \
  |  |  |  |  202|      0|            debugmsg("dumpx_" token,"  "); \
  |  |  |  |  203|      0|        } \
  |  |  |  |  204|      0|        debugmsg("dumpv" token, "dumpv_%s:%*s", token, __DBGINDENT(), "");
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (83:60): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  698|       |
  699|  13.8k|    while (asn_length--)
  ------------------
  |  Branch (699:12): [True: 10.3k, False: 3.54k]
  ------------------
  700|  10.3k|        value = (value << 8) | *bufp++;
  701|       |
  702|  3.54k|    CHECK_OVERFLOW_U(value,2);
  ------------------
  |  |  224|  3.54k|#define CHECK_OVERFLOW_U(x,y) do {                                      \
  |  |  225|  3.54k|        if (x > UINT32_MAX) {                                           \
  |  |  ------------------
  |  |  |  Branch (225:13): [True: 942, False: 2.59k]
  |  |  ------------------
  |  |  226|    942|            x &= 0xffffffff;                                            \
  |  |  227|    942|            DEBUGMSG(("asn","truncating unsigned value to 32 bits (%d)\n",y)); \
  |  |  ------------------
  |  |  |  |   61|    942|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|    942|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (144:29): [True: 0, False: 942]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (61:67): [Folded, False: 942]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  228|    942|        }                                                               \
  |  |  229|  3.54k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (229:13): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  703|       |
  704|  3.54k|    DEBUGMSG(("dumpv_recv", "  UInteger:\t%ld (0x%.2lX)\n", value, value));
  ------------------
  |  |   61|  3.54k|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|  3.54k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  705|       |
  706|  3.54k|    *intp = value;
  707|  3.54k|    return bufp;
  708|  3.58k|}
asn_parse_string:
  912|  6.41k|{
  913|  6.41k|    static const char *errpre = "parse string";
  914|  6.41k|    u_char         *bufp = data;
  915|  6.41k|    u_long          asn_length;
  916|       |
  917|  6.41k|    if (NULL == data || NULL == datalength || NULL == type || NULL == str ||
  ------------------
  |  Branch (917:9): [True: 0, False: 6.41k]
  |  Branch (917:25): [True: 0, False: 6.41k]
  |  Branch (917:47): [True: 0, False: 6.41k]
  |  Branch (917:63): [True: 0, False: 6.41k]
  ------------------
  918|  6.41k|        NULL == strlength) {
  ------------------
  |  Branch (918:9): [True: 0, False: 6.41k]
  ------------------
  919|      0|        ERROR_MSG("parse string: NULL pointer");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  920|      0|        return NULL;
  921|      0|    }
  922|       |
  923|       |    /** need at least 2 bytes to work with: type, length (which might be 0)  */
  924|  6.41k|    if (*datalength < 2) {
  ------------------
  |  Branch (924:9): [True: 312, False: 6.10k]
  ------------------
  925|    312|        _asn_short_err(errpre, *datalength, 2);
  926|    312|        return NULL;
  927|    312|    }
  928|       |
  929|  6.10k|    *type = *bufp++;
  930|  6.10k|    if (*type != ASN_OCTET_STR && *type != ASN_IPADDRESS && *type != ASN_OPAQUE
  ------------------
  |  |   78|  12.2k|#define ASN_OCTET_STR	    0x04U
  ------------------
                  if (*type != ASN_OCTET_STR && *type != ASN_IPADDRESS && *type != ASN_OPAQUE
  ------------------
  |  |   88|  10.0k|#define ASN_IPADDRESS   (ASN_APPLICATION | 0)
  |  |  ------------------
  |  |  |  |   91|  3.96k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
                  if (*type != ASN_OCTET_STR && *type != ASN_IPADDRESS && *type != ASN_OPAQUE
  ------------------
  |  |   93|  9.46k|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   91|  3.35k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (930:9): [True: 3.96k, False: 2.13k]
  |  Branch (930:35): [True: 3.35k, False: 613]
  |  Branch (930:61): [True: 1.63k, False: 1.71k]
  ------------------
  931|  1.63k|            && *type != ASN_NSAP) {
  ------------------
  |  |   98|  1.63k|#define ASN_NSAP	(ASN_APPLICATION | 5)   /* historic - don't use */
  |  |  ------------------
  |  |  |  |   91|  1.63k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (931:16): [True: 409, False: 1.22k]
  ------------------
  932|    409|        _asn_type_err(errpre, *type);
  933|    409|        return NULL;
  934|    409|    }
  935|       |
  936|  5.69k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
  937|  5.69k|    if (NULL == bufp) {
  ------------------
  |  Branch (937:9): [True: 156, False: 5.54k]
  ------------------
  938|    156|        _asn_short_err(errpre, *datalength - 1, asn_length);
  939|    156|        return NULL;
  940|    156|    }
  941|       |
  942|  5.54k|    if (asn_length > *strlength) {
  ------------------
  |  Branch (942:9): [True: 36, False: 5.50k]
  ------------------
  943|     36|        _asn_length_err(errpre, (size_t) asn_length, *strlength);
  944|     36|        return NULL;
  945|     36|    }
  946|       |
  947|  5.50k|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|  5.50k|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  5.50k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 5.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  196|      0|        debugmsg("dumpx" token, "dumpx_%s:%*s", token, __DBGINDENT(), ""); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  |  |  197|      0|        __DBGMSGHEX(("dumpx_" token,buf,len)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|      0|#define __DBGMSGHEX(x)     debugmsg_hex x
  |  |  |  |  ------------------
  |  |  |  |  198|      0|        if (debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (198:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  199|      0|            debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (199:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  200|      0|            debugmsg("dumpx_" token,"\n"); \
  |  |  |  |  201|      0|        } else { \
  |  |  |  |  202|      0|            debugmsg("dumpx_" token,"  "); \
  |  |  |  |  203|      0|        } \
  |  |  |  |  204|      0|        debugmsg("dumpv" token, "dumpv_%s:%*s", token, __DBGINDENT(), "");
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (83:60): [Folded, False: 5.50k]
  |  |  ------------------
  ------------------
  948|       |
  949|  5.50k|    memmove(str, bufp, asn_length);
  950|  5.50k|    if (*strlength > asn_length)
  ------------------
  |  Branch (950:9): [True: 2.38k, False: 3.12k]
  ------------------
  951|  2.38k|        str[asn_length] = 0;
  952|  5.50k|    *strlength = asn_length;
  953|  5.50k|    *datalength -= asn_length + (bufp - data);
  954|       |
  955|  5.50k|    DEBUGIF("dumpv_recv") {
  ------------------
  |  |  145|  5.50k|#define DEBUGIF(x)         if (_DBG_IF_ && debug_is_token_registered(x) == SNMPERR_SUCCESS)
  |  |  ------------------
  |  |  |  |  144|  11.0k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 5.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGIF(x)         if (_DBG_IF_ && debug_is_token_registered(x) == SNMPERR_SUCCESS)
  |  |  ------------------
  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  ------------------
  |  |  |  Branch (145:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  956|      0|        u_char         *buf = (u_char *) malloc(1 + asn_length);
  957|      0|        size_t          l = (buf != NULL) ? (1 + asn_length) : 0, ol = 0;
  ------------------
  |  Branch (957:29): [True: 0, False: 0]
  ------------------
  958|       |
  959|      0|        if (sprint_realloc_asciistring
  ------------------
  |  Branch (959:13): [True: 0, False: 0]
  ------------------
  960|      0|            (&buf, &l, &ol, 1, str, asn_length)) {
  961|      0|            DEBUGMSG(("dumpv_recv", "  String:\t%s\n", buf));
  ------------------
  |  |   61|      0|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 0]
  |  |  ------------------
  ------------------
  962|      0|        } else {
  963|      0|            if (buf == NULL) {
  ------------------
  |  Branch (963:17): [True: 0, False: 0]
  ------------------
  964|      0|                DEBUGMSG(("dumpv_recv", "  String:\t[TRUNCATED]\n"));
  ------------------
  |  |   61|      0|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 0]
  |  |  ------------------
  ------------------
  965|      0|            } else {
  966|      0|                DEBUGMSG(("dumpv_recv", "  String:\t%s [TRUNCATED]\n",
  ------------------
  |  |   61|      0|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 0]
  |  |  ------------------
  ------------------
  967|      0|                          buf));
  968|      0|            }
  969|      0|        }
  970|      0|        if (buf != NULL) {
  ------------------
  |  Branch (970:13): [True: 0, False: 0]
  ------------------
  971|      0|            free(buf);
  972|      0|        }
  973|      0|    }
  974|       |
  975|  5.50k|    return bufp + asn_length;
  976|  5.54k|}
asn_parse_header:
 1073|  44.0k|{
 1074|  44.0k|    register u_char *bufp;
 1075|  44.0k|    u_long          asn_length = 0;
 1076|  44.0k|    const char      *errpre = "parse header";
 1077|       |
 1078|  44.0k|    if (!data || !datalength || !type) {
  ------------------
  |  Branch (1078:9): [True: 0, False: 44.0k]
  |  Branch (1078:18): [True: 0, False: 44.0k]
  |  Branch (1078:33): [True: 0, False: 44.0k]
  ------------------
 1079|      0|        ERROR_MSG("parse header: NULL pointer");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1080|      0|        return NULL;
 1081|      0|    }
 1082|       |
 1083|       |    /** need at least 2 bytes to work with: type, length (which might be 0) */
 1084|  44.0k|    if (*datalength < 2) {
  ------------------
  |  Branch (1084:9): [True: 392, False: 43.6k]
  ------------------
 1085|    392|        _asn_short_err(errpre, *datalength, 2);
 1086|    392|        return NULL;
 1087|    392|    }
 1088|       |
 1089|  43.6k|    bufp = data;
 1090|       |    /*
 1091|       |     * this only works on data types < 30, i.e. no extension octets 
 1092|       |     */
 1093|  43.6k|    if (IS_EXTENSION_ID(*bufp)) {
  ------------------
  |  |  103|  43.6k|#define IS_EXTENSION_ID(byte)	(((byte) & ASN_EXTENSION_ID) == ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   99|  43.6k|#define ASN_EXTENSION_ID    0x1FU
  |  |  ------------------
  |  |               #define IS_EXTENSION_ID(byte)	(((byte) & ASN_EXTENSION_ID) == ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   99|  43.6k|#define ASN_EXTENSION_ID    0x1FU
  |  |  ------------------
  |  |  |  Branch (103:31): [True: 18, False: 43.6k]
  |  |  ------------------
  ------------------
 1094|     18|        ERROR_MSG("can't process ID >= 30");
  ------------------
  |  |  188|     18|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1095|     18|        return NULL;
 1096|     18|    }
 1097|  43.6k|    *type = *bufp++;
 1098|       |
 1099|  43.6k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
 1100|  43.6k|    if (NULL == bufp) {
  ------------------
  |  Branch (1100:9): [True: 786, False: 42.8k]
  ------------------
 1101|    786|        _asn_short_err(errpre, *datalength - 1, asn_length);
 1102|    786|        return NULL;
 1103|    786|    }
 1104|       |
 1105|       |#ifdef DUMP_PRINT_HEADERS
 1106|       |    DEBUGDUMPSETUP("recv", data, (bufp - data));
 1107|       |    DEBUGMSG(("dumpv_recv", "  Header: 0x%.2X, len = %d (0x%X)\n", *data,
 1108|       |              asn_length, asn_length));
 1109|       |#else
 1110|       |    /*
 1111|       |     * DEBUGMSGHEXTLI(("recv",data,(bufp-data)));
 1112|       |     * DEBUGMSG(("dumpH_recv","\n"));
 1113|       |     */
 1114|  42.8k|#endif
 1115|       |
 1116|  42.8k|#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
 1117|       |
 1118|  42.8k|    if ((asn_length > 2) && (*type == ASN_OPAQUE) && (*bufp == ASN_OPAQUE_TAG1)) {
  ------------------
  |  |   93|  32.1k|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   91|  32.1k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
                  if ((asn_length > 2) && (*type == ASN_OPAQUE) && (*bufp == ASN_OPAQUE_TAG1)) {
  ------------------
  |  |  131|  4.40k|#define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   92|  4.40k|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   99|  4.40k|#define ASN_EXTENSION_ID    0x1FU
  |  |  ------------------
  ------------------
  |  Branch (1118:9): [True: 32.1k, False: 10.7k]
  |  Branch (1118:29): [True: 4.40k, False: 27.7k]
  |  Branch (1118:54): [True: 3.81k, False: 591]
  ------------------
 1119|       |
 1120|       |        /*
 1121|       |         * check if 64-but counter 
 1122|       |         */
 1123|  3.81k|        switch (*(bufp + 1)) {
 1124|    781|        case ASN_OPAQUE_COUNTER64:
  ------------------
  |  |  156|    781|#define ASN_OPAQUE_COUNTER64 (ASN_OPAQUE_TAG2 + ASN_APP_COUNTER64)
  |  |  ------------------
  |  |  |  |  136|    781|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_COUNTER64 (ASN_OPAQUE_TAG2 + ASN_APP_COUNTER64)
  |  |  ------------------
  |  |  |  |  146|    781|#define ASN_APP_COUNTER64 (ASN_APPLICATION | 6)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|    781|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1124:9): [True: 781, False: 3.03k]
  ------------------
 1125|  1.46k|        case ASN_OPAQUE_U64:
  ------------------
  |  |  192|  1.46k|#define ASN_OPAQUE_U64 (ASN_OPAQUE_TAG2 + ASN_APP_U64)
  |  |  ------------------
  |  |  |  |  136|  1.46k|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_U64 (ASN_OPAQUE_TAG2 + ASN_APP_U64)
  |  |  ------------------
  |  |  |  |  150|  1.46k|#define ASN_APP_U64 (ASN_APPLICATION | 11)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|  1.46k|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1125:9): [True: 681, False: 3.13k]
  ------------------
 1126|  1.98k|        case ASN_OPAQUE_FLOAT:
  ------------------
  |  |  165|  1.98k|#define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  136|  1.98k|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  147|  1.98k|#define ASN_APP_FLOAT (ASN_APPLICATION | 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|  1.98k|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1126:9): [True: 519, False: 3.29k]
  ------------------
 1127|  2.28k|        case ASN_OPAQUE_DOUBLE:
  ------------------
  |  |  174|  2.28k|#define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  136|  2.28k|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  148|  2.28k|#define ASN_APP_DOUBLE (ASN_APPLICATION | 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|  2.28k|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1127:9): [True: 306, False: 3.50k]
  ------------------
 1128|  3.41k|        case ASN_OPAQUE_I64:
  ------------------
  |  |  183|  3.41k|#define ASN_OPAQUE_I64 (ASN_OPAQUE_TAG2 + ASN_APP_I64)
  |  |  ------------------
  |  |  |  |  136|  3.41k|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_I64 (ASN_OPAQUE_TAG2 + ASN_APP_I64)
  |  |  ------------------
  |  |  |  |  149|  3.41k|#define ASN_APP_I64 (ASN_APPLICATION | 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|  3.41k|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1128:9): [True: 1.12k, False: 2.69k]
  ------------------
 1129|  3.41k|            *type = *(bufp + 1);
 1130|  3.41k|            break;
 1131|       |
 1132|    403|        default:
  ------------------
  |  Branch (1132:9): [True: 403, False: 3.41k]
  ------------------
 1133|       |            /*
 1134|       |             * just an Opaque 
 1135|       |             */
 1136|    403|            *datalength = (int) asn_length;
 1137|    403|            return bufp;
 1138|  3.81k|        }
 1139|       |        /*
 1140|       |         * value is encoded as special format 
 1141|       |         */
 1142|  3.41k|        *datalength = (int) asn_length;
 1143|  3.41k|        bufp = asn_parse_nlength(bufp+2, *datalength - 2, &asn_length);
 1144|  3.41k|        if (NULL == bufp) {
  ------------------
  |  Branch (1144:13): [True: 36, False: 3.37k]
  ------------------
 1145|     36|            _asn_short_err("parse opaque header", *datalength - 2, asn_length);
 1146|     36|            return NULL;
 1147|     36|        }
 1148|  3.41k|    }
 1149|  42.4k|#endif                          /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
 1150|       |
 1151|  42.4k|    *datalength = (int) asn_length;
 1152|       |
 1153|  42.4k|    return bufp;
 1154|  42.8k|}
asn_parse_sequence:
 1173|  25.7k|{                               /* error message prefix */
 1174|  25.7k|    data = asn_parse_header(data, datalength, type);
 1175|  25.7k|    if (data && (*type != expected_type)) {
  ------------------
  |  Branch (1175:9): [True: 24.5k, False: 1.19k]
  |  Branch (1175:17): [True: 1.67k, False: 22.8k]
  ------------------
 1176|  1.67k|        char            ebuf[128];
 1177|  1.67k|        snprintf(ebuf, sizeof(ebuf),
 1178|  1.67k|                 "%s header type %02X: s/b %02X", estr,
 1179|  1.67k|                (u_char) * type, (u_char) expected_type);
 1180|  1.67k|        ERROR_MSG(ebuf);
  ------------------
  |  |  188|  1.67k|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1181|  1.67k|        return NULL;
 1182|  1.67k|    }
 1183|  24.0k|    return data;
 1184|  25.7k|}
asn_parse_length:
 1295|  12.0k|{
 1296|  12.0k|    static const char *errpre = "parse length";
 1297|  12.0k|    char            ebuf[128];
 1298|  12.0k|    register u_char lengthbyte;
 1299|       |
 1300|  12.0k|    if (!data || !length) {
  ------------------
  |  Branch (1300:9): [True: 0, False: 12.0k]
  |  Branch (1300:18): [True: 0, False: 12.0k]
  ------------------
 1301|      0|        ERROR_MSG("parse length: NULL pointer");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1302|      0|        return NULL;
 1303|      0|    }
 1304|  12.0k|    lengthbyte = *data;
 1305|       |
 1306|  12.0k|    if (lengthbyte & ASN_LONG_LEN) {
  ------------------
  |  |   98|  12.0k|#define ASN_LONG_LEN	    0x80U
  ------------------
  |  Branch (1306:9): [True: 12.0k, False: 0]
  ------------------
 1307|  12.0k|        lengthbyte &= ~ASN_LONG_LEN;    /* turn MSb off */
  ------------------
  |  |   98|  12.0k|#define ASN_LONG_LEN	    0x80U
  ------------------
 1308|  12.0k|        if (lengthbyte == 0) {
  ------------------
  |  Branch (1308:13): [True: 114, False: 11.9k]
  ------------------
 1309|    114|            snprintf(ebuf, sizeof(ebuf),
 1310|    114|                     "%s: indefinite length not supported", errpre);
 1311|    114|            ERROR_MSG(ebuf);
  ------------------
  |  |  188|    114|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1312|    114|            return NULL;
 1313|    114|        }
 1314|  11.9k|        if (lengthbyte > sizeof(long)) {
  ------------------
  |  Branch (1314:13): [True: 132, False: 11.8k]
  ------------------
 1315|    132|            snprintf(ebuf, sizeof(ebuf),
 1316|    132|                    "%s: data length %d > %lu not supported", errpre,
 1317|    132|                    lengthbyte, (unsigned long)sizeof(long));
 1318|    132|            ERROR_MSG(ebuf);
  ------------------
  |  |  188|    132|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1319|    132|            return NULL;
 1320|    132|        }
 1321|  11.8k|        data++;
 1322|  11.8k|        *length = 0;            /* protect against short lengths */
 1323|  30.0k|        while (lengthbyte--) {
  ------------------
  |  Branch (1323:16): [True: 18.1k, False: 11.8k]
  ------------------
 1324|  18.1k|            *length <<= 8;
 1325|  18.1k|            *length |= *data++;
 1326|  18.1k|        }
 1327|  11.8k|        if ((long) *length < 0) {
  ------------------
  |  Branch (1327:13): [True: 123, False: 11.7k]
  ------------------
 1328|    123|            snprintf(ebuf, sizeof(ebuf),
 1329|    123|                     "%s: negative data length %ld\n", errpre,
 1330|    123|                     (long) *length);
 1331|    123|            ERROR_MSG(ebuf);
  ------------------
  |  |  188|    123|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1332|    123|            return NULL;
 1333|    123|        }
 1334|  11.7k|        return data;
 1335|  11.8k|    } else {                    /* short asnlength */
 1336|      0|        *length = (long) lengthbyte;
 1337|      0|        return data + 1;
 1338|      0|    }
 1339|  12.0k|}
asn_parse_objid:
 1437|  18.9k|{
 1438|  18.9k|    static const char *errpre = "parse objid";
 1439|       |    /*
 1440|       |     * ASN.1 objid ::= 0x06 asnlength subidentifier {subidentifier}*
 1441|       |     * subidentifier ::= {leadingbyte}* lastbyte
 1442|       |     * leadingbyte ::= 1 7bitvalue
 1443|       |     * lastbyte ::= 0 7bitvalue
 1444|       |     */
 1445|  18.9k|    register u_char *bufp = data;
 1446|  18.9k|    register oid   *oidp = objid + 1;
 1447|  18.9k|    register u_long subidentifier;
 1448|  18.9k|    register long   length;
 1449|  18.9k|    u_long          asn_length;
 1450|  18.9k|    size_t          original_length = *objidlength;
 1451|       |
 1452|  18.9k|    if (NULL == data || NULL == datalength || NULL == type || NULL == objid) {
  ------------------
  |  Branch (1452:9): [True: 0, False: 18.9k]
  |  Branch (1452:25): [True: 0, False: 18.9k]
  |  Branch (1452:47): [True: 0, False: 18.9k]
  |  Branch (1452:63): [True: 0, False: 18.9k]
  ------------------
 1453|      0|        ERROR_MSG("parse objid: NULL pointer");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1454|      0|        return NULL;
 1455|      0|    }
 1456|       |
 1457|       |    /** need at least 2 bytes to work with: type, length (which might be 0)  */
 1458|  18.9k|    if (*datalength < 2) {
  ------------------
  |  Branch (1458:9): [True: 19, False: 18.9k]
  ------------------
 1459|     19|        _asn_short_err(errpre, *datalength, 2);
 1460|     19|        return NULL;
 1461|     19|    }
 1462|       |
 1463|  18.9k|    *type = *bufp++;
 1464|  18.9k|    if (*type != ASN_OBJECT_ID) {
  ------------------
  |  |   81|  18.9k|#define ASN_OBJECT_ID	    0x06U
  ------------------
  |  Branch (1464:9): [True: 29, False: 18.8k]
  ------------------
 1465|     29|        _asn_type_err(errpre, *type);
 1466|     29|        return NULL;
 1467|     29|    }
 1468|  18.8k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
 1469|  18.8k|    if (NULL == bufp) {
  ------------------
  |  Branch (1469:9): [True: 149, False: 18.7k]
  ------------------
 1470|    149|        _asn_short_err(errpre, *datalength - 1, asn_length);
 1471|    149|        return NULL;
 1472|    149|    }
 1473|       |
 1474|  18.7k|    *datalength -= (int) asn_length + (bufp - data);
 1475|       |
 1476|  18.7k|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|  18.7k|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  18.7k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 18.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  196|      0|        debugmsg("dumpx" token, "dumpx_%s:%*s", token, __DBGINDENT(), ""); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  |  |  197|      0|        __DBGMSGHEX(("dumpx_" token,buf,len)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|      0|#define __DBGMSGHEX(x)     debugmsg_hex x
  |  |  |  |  ------------------
  |  |  |  |  198|      0|        if (debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (198:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  199|      0|            debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (199:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  200|      0|            debugmsg("dumpx_" token,"\n"); \
  |  |  |  |  201|      0|        } else { \
  |  |  |  |  202|      0|            debugmsg("dumpx_" token,"  "); \
  |  |  |  |  203|      0|        } \
  |  |  |  |  204|      0|        debugmsg("dumpv" token, "dumpv_%s:%*s", token, __DBGINDENT(), "");
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (83:60): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
 1477|       |
 1478|       |    /*
 1479|       |     * Handle invalid object identifier encodings of the form 06 00 robustly 
 1480|       |     */
 1481|  18.7k|    if (asn_length == 0)
  ------------------
  |  Branch (1481:9): [True: 15.6k, False: 3.06k]
  ------------------
 1482|  15.6k|        objid[0] = objid[1] = 0;
 1483|       |
 1484|  18.7k|    length = asn_length;
 1485|  18.7k|    (*objidlength)--;           /* account for expansion of first byte */
 1486|       |
 1487|  36.1k|    while (length > 0 && (*objidlength)-- > 0) {
  ------------------
  |  Branch (1487:12): [True: 17.4k, False: 18.6k]
  |  Branch (1487:26): [True: 17.4k, False: 22]
  ------------------
 1488|  17.4k|        subidentifier = 0;
 1489|  20.0k|        do {                    /* shift and add in low order 7 bits */
 1490|  20.0k|            if (subidentifier > (MAX_SUBID >> 7)) {
  ------------------
  |  |   18|  20.0k|#define MAX_SUBID   0xFFFFFFFFUL
  ------------------
  |  Branch (1490:17): [True: 24, False: 19.9k]
  ------------------
 1491|     24|                ERROR_MSG("subidentifier too large / overflow");
  ------------------
  |  |  188|     24|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1492|     24|                return NULL;
 1493|     24|            }
 1494|  19.9k|            subidentifier =
 1495|  19.9k|                (subidentifier << 7) + (*(u_char *) bufp & ~ASN_BIT8);
  ------------------
  |  |  100|  19.9k|#define ASN_BIT8	    0x80U
  ------------------
 1496|  19.9k|            length--;
 1497|  19.9k|        } while ((*(u_char *) bufp++ & ASN_BIT8) && (length > 0));        /* last byte has high bit clear */
  ------------------
  |  |  100|  19.9k|#define ASN_BIT8	    0x80U
  ------------------
  |  Branch (1497:18): [True: 2.59k, False: 17.4k]
  |  Branch (1497:53): [True: 2.56k, False: 25]
  ------------------
 1498|       |
 1499|  17.4k|	if (length == 0) {
  ------------------
  |  Branch (1499:6): [True: 3.01k, False: 14.4k]
  ------------------
 1500|  3.01k|            u_char *last_byte = bufp - 1;
 1501|  3.01k|            if (*last_byte & ASN_BIT8) {
  ------------------
  |  |  100|  3.01k|#define ASN_BIT8	    0x80U
  ------------------
  |  Branch (1501:17): [True: 25, False: 2.99k]
  ------------------
 1502|       |                /* last byte has high bit set -> wrong BER encoded OID */
 1503|     25|                ERROR_MSG("subidentifier syntax error");
  ------------------
  |  |  188|     25|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1504|     25|                return NULL;
 1505|     25|            }
 1506|  3.01k|        }
 1507|  17.4k|        if (subidentifier > MAX_SUBID) {
  ------------------
  |  |   18|  17.4k|#define MAX_SUBID   0xFFFFFFFFUL
  ------------------
  |  Branch (1507:13): [True: 0, False: 17.4k]
  ------------------
 1508|      0|            ERROR_MSG("subidentifier too large");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1509|      0|            return NULL;
 1510|      0|        }
 1511|  17.4k|        *oidp++ = (oid) subidentifier;
 1512|  17.4k|    }
 1513|       |
 1514|  18.6k|    if (length || oidp < objid + 1) {
  ------------------
  |  Branch (1514:9): [True: 22, False: 18.6k]
  |  Branch (1514:19): [True: 0, False: 18.6k]
  ------------------
 1515|     22|        ERROR_MSG("OID length exceeds buffer size");
  ------------------
  |  |  188|     22|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1516|     22|        *objidlength = original_length;
 1517|     22|        return NULL;
 1518|     22|    }
 1519|       |
 1520|       |    /*
 1521|       |     * The first two subidentifiers are encoded into the first component
 1522|       |     * with the value (X * 40) + Y, where:
 1523|       |     *  X is the value of the first subidentifier.
 1524|       |     *  Y is the value of the second subidentifier.
 1525|       |     */
 1526|  18.6k|    subidentifier = oidp - objid >= 2 ? objid[1] : 0;
  ------------------
  |  Branch (1526:21): [True: 2.99k, False: 15.6k]
  ------------------
 1527|  18.6k|    if (subidentifier == 0x2B) {
  ------------------
  |  Branch (1527:9): [True: 503, False: 18.1k]
  ------------------
 1528|    503|        objid[0] = 1;
 1529|    503|        objid[1] = 3;
 1530|  18.1k|    } else {
 1531|  18.1k|        if (subidentifier < 40) {
  ------------------
  |  Branch (1531:13): [True: 16.1k, False: 1.98k]
  ------------------
 1532|  16.1k|            objid[0] = 0;
 1533|  16.1k|            objid[1] = subidentifier;
 1534|  16.1k|        } else if (subidentifier < 80) {
  ------------------
  |  Branch (1534:20): [True: 1.03k, False: 950]
  ------------------
 1535|  1.03k|            objid[0] = 1;
 1536|  1.03k|            objid[1] = subidentifier - 40;
 1537|  1.03k|        } else {
 1538|    950|            objid[0] = 2;
 1539|    950|            objid[1] = subidentifier - 80;
 1540|    950|        }
 1541|  18.1k|    }
 1542|       |
 1543|  18.6k|    *objidlength = (int) (oidp - objid);
 1544|       |
 1545|  18.6k|    DEBUGMSG(("dumpv_recv", "  ObjID: "));
  ------------------
  |  |   61|  18.6k|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|  18.6k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 18.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 18.6k]
  |  |  ------------------
  ------------------
 1546|  18.6k|    DEBUGMSGOID(("dumpv_recv", objid, *objidlength));
  ------------------
  |  |   67|  18.6k|#define DEBUGMSGOID(x)     do {if (_DBG_IF_) {__DBGMSGOID(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  18.6k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 18.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGOID(x)     do {if (_DBG_IF_) {__DBGMSGOID(x);} }while(0)
  |  |  ------------------
  |  |  |  |  165|      0|#define __DBGMSGOID(x)     debugmsg_oid x
  |  |  ------------------
  |  |  |  Branch (67:71): [Folded, False: 18.6k]
  |  |  ------------------
  ------------------
 1547|  18.6k|    DEBUGMSG(("dumpv_recv", "\n"));
  ------------------
  |  |   61|  18.6k|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|  18.6k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 18.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 18.6k]
  |  |  ------------------
  ------------------
 1548|  18.6k|    return bufp;
 1549|  18.6k|}
asn_parse_bitstring:
 1819|  1.00k|{
 1820|       |    /*
 1821|       |     * bitstring ::= 0x03 asnlength unused {byte}*
 1822|       |     */
 1823|  1.00k|    static const char *errpre = "parse bitstring";
 1824|  1.00k|    register u_char *bufp = data;
 1825|  1.00k|    u_long          asn_length;
 1826|       |
 1827|  1.00k|    if (NULL == data || NULL == datalength || NULL == type ||
  ------------------
  |  Branch (1827:9): [True: 0, False: 1.00k]
  |  Branch (1827:25): [True: 0, False: 1.00k]
  |  Branch (1827:47): [True: 0, False: 1.00k]
  ------------------
 1828|  1.00k|        NULL == str || NULL == strlength) {
  ------------------
  |  Branch (1828:9): [True: 0, False: 1.00k]
  |  Branch (1828:24): [True: 0, False: 1.00k]
  ------------------
 1829|      0|        ERROR_MSG("parse bitstring: NULL pointer");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1830|      0|        return NULL;
 1831|      0|    }
 1832|       |
 1833|       |    /** need at least 2 bytes to work with: type, length (which might be 0)  */
 1834|  1.00k|    if (*datalength < 2) {
  ------------------
  |  Branch (1834:9): [True: 0, False: 1.00k]
  ------------------
 1835|      0|        _asn_short_err(errpre, *datalength, 2);
 1836|      0|        return NULL;
 1837|      0|    }
 1838|       |
 1839|  1.00k|    *type = *bufp++;
 1840|  1.00k|    if (*type != ASN_BIT_STR) {
  ------------------
  |  |   77|  1.00k|#define ASN_BIT_STR	    0x03U
  ------------------
  |  Branch (1840:9): [True: 0, False: 1.00k]
  ------------------
 1841|      0|        _asn_type_err(errpre, *type);
 1842|      0|        return NULL;
 1843|      0|    }
 1844|       |
 1845|  1.00k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
 1846|  1.00k|    if (NULL == bufp) {
  ------------------
  |  Branch (1846:9): [True: 0, False: 1.00k]
  ------------------
 1847|      0|        _asn_short_err(errpre, *datalength - 1, asn_length);
 1848|      0|        return NULL;
 1849|      0|    }
 1850|       |
 1851|  1.00k|    if ((size_t) asn_length > *strlength) {
  ------------------
  |  Branch (1851:9): [True: 0, False: 1.00k]
  ------------------
 1852|      0|        _asn_length_err(errpre, (size_t) asn_length, *strlength);
 1853|      0|        return NULL;
 1854|      0|    }
 1855|  1.00k|    if (_asn_bitstring_check(errpre, asn_length, *bufp))
  ------------------
  |  Branch (1855:9): [True: 7, False: 993]
  ------------------
 1856|      7|        return NULL;
 1857|       |
 1858|    993|    DEBUGDUMPSETUP("recv", data, bufp - data);
  ------------------
  |  |   83|    993|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    993|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 993]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  196|      0|        debugmsg("dumpx" token, "dumpx_%s:%*s", token, __DBGINDENT(), ""); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  |  |  197|      0|        __DBGMSGHEX(("dumpx_" token,buf,len)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|      0|#define __DBGMSGHEX(x)     debugmsg_hex x
  |  |  |  |  ------------------
  |  |  |  |  198|      0|        if (debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (198:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  199|      0|            debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (199:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  200|      0|            debugmsg("dumpx_" token,"\n"); \
  |  |  |  |  201|      0|        } else { \
  |  |  |  |  202|      0|            debugmsg("dumpx_" token,"  "); \
  |  |  |  |  203|      0|        } \
  |  |  |  |  204|      0|        debugmsg("dumpv" token, "dumpv_%s:%*s", token, __DBGINDENT(), "");
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (83:60): [Folded, False: 993]
  |  |  ------------------
  ------------------
 1859|    993|    DEBUGMSG(("dumpv_recv", "  Bitstring: "));
  ------------------
  |  |   61|    993|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|    993|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 993]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 993]
  |  |  ------------------
  ------------------
 1860|    993|    DEBUGMSGHEX(("dumpv_recv", data, asn_length));
  ------------------
  |  |   71|    993|#define DEBUGMSGHEX(x)     do {if (_DBG_IF_) {__DBGMSGHEX(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    993|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 993]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGHEX(x)     do {if (_DBG_IF_) {__DBGMSGHEX(x);} }while(0)
  |  |  ------------------
  |  |  |  |  169|      0|#define __DBGMSGHEX(x)     debugmsg_hex x
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 993]
  |  |  ------------------
  ------------------
 1861|    993|    DEBUGMSG(("dumpv_recv", "\n"));
  ------------------
  |  |   61|    993|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|    993|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 993]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 993]
  |  |  ------------------
  ------------------
 1862|       |
 1863|    993|    memmove(str, bufp, asn_length);
 1864|    993|    *strlength = (int) asn_length;
 1865|    993|    *datalength -= (int) asn_length + (bufp - data);
 1866|    993|    return bufp + asn_length;
 1867|  1.00k|}
asn_parse_unsigned_int64:
 1951|  2.60k|{
 1952|       |    /*
 1953|       |     * ASN.1 integer ::= 0x02 asnlength byte {byte}*
 1954|       |     */
 1955|  2.60k|    static const char *errpre = "parse uint64";
 1956|  2.60k|    const int       uint64sizelimit = (4 * 2) + 1;
 1957|  2.60k|    register u_char *bufp = data;
 1958|  2.60k|    u_char         *endp;
 1959|  2.60k|    u_long          asn_length;
 1960|  2.60k|    register u_long low = 0, high = 0;
 1961|       |
 1962|  2.60k|    if (countersize != sizeof(struct counter64)) {
  ------------------
  |  Branch (1962:9): [True: 0, False: 2.60k]
  ------------------
 1963|      0|        _asn_size_err(errpre, countersize, sizeof(struct counter64));
 1964|      0|        return NULL;
 1965|      0|    }
 1966|       |
 1967|  2.60k|    if (NULL == data || NULL == datalength || NULL == type || NULL == cp) {
  ------------------
  |  Branch (1967:9): [True: 0, False: 2.60k]
  |  Branch (1967:25): [True: 0, False: 2.60k]
  |  Branch (1967:47): [True: 0, False: 2.60k]
  |  Branch (1967:63): [True: 0, False: 2.60k]
  ------------------
 1968|      0|        ERROR_MSG("parse uint64: NULL pointer");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1969|      0|        return NULL;
 1970|      0|    }
 1971|       |
 1972|       |    /** need at least 2 bytes to work with: type, length (which might be 0)  */
 1973|  2.60k|    if (*datalength < 2) {
  ------------------
  |  Branch (1973:9): [True: 0, False: 2.60k]
  ------------------
 1974|      0|        _asn_short_err(errpre, *datalength, 2);
 1975|      0|        return NULL;
 1976|      0|    }
 1977|       |
 1978|  2.60k|    *type = *bufp++;
 1979|  2.60k|    if (*type != ASN_COUNTER64
  ------------------
  |  |   99|  5.20k|#define ASN_COUNTER64   (ASN_APPLICATION | 6)
  |  |  ------------------
  |  |  |  |   91|  2.60k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (1979:9): [True: 1.45k, False: 1.15k]
  ------------------
 1980|  1.45k|#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
 1981|  1.45k|            && *type != ASN_OPAQUE
  ------------------
  |  |   93|  1.45k|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   91|  1.45k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (1981:16): [True: 7, False: 1.44k]
  ------------------
 1982|  2.60k|#endif
 1983|  2.60k|            ) {
 1984|      7|        _asn_type_err(errpre, *type);
 1985|      7|        return NULL;
 1986|      7|    }
 1987|  2.59k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
 1988|  2.59k|    if (NULL == bufp) {
  ------------------
  |  Branch (1988:9): [True: 0, False: 2.59k]
  ------------------
 1989|      0|        _asn_short_err(errpre, *datalength - 1, asn_length);
 1990|      0|        return NULL;
 1991|      0|    }
 1992|  2.59k|    endp = bufp + asn_length;
 1993|       |
 1994|  2.59k|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|  2.59k|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.59k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.59k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  196|      0|        debugmsg("dumpx" token, "dumpx_%s:%*s", token, __DBGINDENT(), ""); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  |  |  197|      0|        __DBGMSGHEX(("dumpx_" token,buf,len)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|      0|#define __DBGMSGHEX(x)     debugmsg_hex x
  |  |  |  |  ------------------
  |  |  |  |  198|      0|        if (debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (198:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  199|      0|            debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (199:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  200|      0|            debugmsg("dumpx_" token,"\n"); \
  |  |  |  |  201|      0|        } else { \
  |  |  |  |  202|      0|            debugmsg("dumpx_" token,"  "); \
  |  |  |  |  203|      0|        } \
  |  |  |  |  204|      0|        debugmsg("dumpv" token, "dumpv_%s:%*s", token, __DBGINDENT(), "");
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (83:60): [Folded, False: 2.59k]
  |  |  ------------------
  ------------------
 1995|  2.59k|#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
 1996|       |    /** need at least 2 bytes: ASN_OPAQUE_TAG1 and ASN_OPAQUE_<type> */
 1997|  2.59k|    if ((*type == ASN_OPAQUE) && (asn_length < 2)) {
  ------------------
  |  |   93|  2.59k|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   91|  2.59k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (1997:9): [True: 1.44k, False: 1.15k]
  |  Branch (1997:34): [True: 0, False: 1.44k]
  ------------------
 1998|      0|        _asn_short_err(errpre, asn_length, 2);
 1999|      0|        return NULL;
 2000|      0|    }
 2001|       |
 2002|       |    /*
 2003|       |     * 64 bit counters as opaque 
 2004|       |     */
 2005|  2.59k|    if ((*type == ASN_OPAQUE) &&
  ------------------
  |  |   93|  2.59k|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   91|  2.59k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (2005:9): [True: 1.44k, False: 1.15k]
  ------------------
 2006|  1.44k|        (asn_length <= ASN_OPAQUE_COUNTER64_MX_BER_LEN) &&
  ------------------
  |  |  160|  1.44k|#define ASN_OPAQUE_COUNTER64_MX_BER_LEN 12
  ------------------
  |  Branch (2006:9): [True: 1.43k, False: 11]
  ------------------
 2007|  1.43k|        (*bufp == ASN_OPAQUE_TAG1) &&
  ------------------
  |  |  131|  1.43k|#define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   92|  1.43k|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   99|  1.43k|#define ASN_EXTENSION_ID    0x1FU
  |  |  ------------------
  ------------------
  |  Branch (2007:9): [True: 1.43k, False: 0]
  ------------------
 2008|  1.43k|        ((*(bufp + 1) == ASN_OPAQUE_COUNTER64) ||
  ------------------
  |  |  156|  1.43k|#define ASN_OPAQUE_COUNTER64 (ASN_OPAQUE_TAG2 + ASN_APP_COUNTER64)
  |  |  ------------------
  |  |  |  |  136|  1.43k|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_COUNTER64 (ASN_OPAQUE_TAG2 + ASN_APP_COUNTER64)
  |  |  ------------------
  |  |  |  |  146|  1.43k|#define ASN_APP_COUNTER64 (ASN_APPLICATION | 6)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|  1.43k|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2008:10): [True: 764, False: 668]
  ------------------
 2009|  1.43k|         (*(bufp + 1) == ASN_OPAQUE_U64))) {
  ------------------
  |  |  192|    668|#define ASN_OPAQUE_U64 (ASN_OPAQUE_TAG2 + ASN_APP_U64)
  |  |  ------------------
  |  |  |  |  136|    668|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_U64 (ASN_OPAQUE_TAG2 + ASN_APP_U64)
  |  |  ------------------
  |  |  |  |  150|    668|#define ASN_APP_U64 (ASN_APPLICATION | 11)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|    668|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2009:10): [True: 668, False: 0]
  ------------------
 2010|  1.43k|        size_t          outer_length = asn_length - 2;
 2011|       |
 2012|       |        /*
 2013|       |         * change type to Counter64 or U64 
 2014|       |         */
 2015|  1.43k|        *type = *(bufp + 1);
 2016|       |        /*
 2017|       |         * value is encoded as special format 
 2018|       |         */
 2019|  1.43k|        bufp = asn_parse_nlength(bufp + 2, outer_length, &asn_length);
 2020|  1.43k|        if (NULL == bufp) {
  ------------------
  |  Branch (2020:13): [True: 0, False: 1.43k]
  ------------------
 2021|      0|            _asn_short_err("parse opaque uint64", outer_length, asn_length);
 2022|      0|            return NULL;
 2023|      0|        }
 2024|  1.43k|    }
 2025|  2.59k|#endif                          /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
 2026|  2.59k|    if (((int) asn_length > uint64sizelimit) ||
  ------------------
  |  Branch (2026:9): [True: 15, False: 2.58k]
  ------------------
 2027|  2.58k|        (((int) asn_length == uint64sizelimit) && *bufp != 0x00)) {
  ------------------
  |  Branch (2027:10): [True: 290, False: 2.29k]
  |  Branch (2027:51): [True: 9, False: 281]
  ------------------
 2028|     24|        _asn_length_err(errpre, (size_t) asn_length, uint64sizelimit);
 2029|     24|        return NULL;
 2030|     24|    }
 2031|  2.57k|    *datalength -= endp - data;
 2032|  6.50k|    while (asn_length--) {
  ------------------
  |  Branch (2032:12): [True: 3.93k, False: 2.57k]
  ------------------
 2033|  3.93k|        high = ((0x00FFFFFF & high) << 8) | ((low & 0xFF000000U) >> 24);
 2034|  3.93k|        low = ((low & 0x00FFFFFF) << 8) | *bufp++;
 2035|  3.93k|    }
 2036|  2.57k|    bufp = endp;
 2037|       |
 2038|  2.57k|    CHECK_OVERFLOW_U(high,6);
  ------------------
  |  |  224|  2.57k|#define CHECK_OVERFLOW_U(x,y) do {                                      \
  |  |  225|  2.57k|        if (x > UINT32_MAX) {                                           \
  |  |  ------------------
  |  |  |  Branch (225:13): [True: 0, False: 2.57k]
  |  |  ------------------
  |  |  226|      0|            x &= 0xffffffff;                                            \
  |  |  227|      0|            DEBUGMSG(("asn","truncating unsigned value to 32 bits (%d)\n",y)); \
  |  |  ------------------
  |  |  |  |   61|      0|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (61:67): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  228|      0|        }                                                               \
  |  |  229|  2.57k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (229:13): [Folded, False: 2.57k]
  |  |  ------------------
  ------------------
 2039|  2.57k|    CHECK_OVERFLOW_U(low,6);
  ------------------
  |  |  224|  2.57k|#define CHECK_OVERFLOW_U(x,y) do {                                      \
  |  |  225|  2.57k|        if (x > UINT32_MAX) {                                           \
  |  |  ------------------
  |  |  |  Branch (225:13): [True: 0, False: 2.57k]
  |  |  ------------------
  |  |  226|      0|            x &= 0xffffffff;                                            \
  |  |  227|      0|            DEBUGMSG(("asn","truncating unsigned value to 32 bits (%d)\n",y)); \
  |  |  ------------------
  |  |  |  |   61|      0|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (61:67): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  228|      0|        }                                                               \
  |  |  229|  2.57k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (229:13): [Folded, False: 2.57k]
  |  |  ------------------
  ------------------
 2040|       |
 2041|  2.57k|    cp->low = low;
 2042|  2.57k|    cp->high = high;
 2043|       |
 2044|  2.57k|    DEBUGIF("dumpv_recv") {
  ------------------
  |  |  145|  2.57k|#define DEBUGIF(x)         if (_DBG_IF_ && debug_is_token_registered(x) == SNMPERR_SUCCESS)
  |  |  ------------------
  |  |  |  |  144|  5.14k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.57k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGIF(x)         if (_DBG_IF_ && debug_is_token_registered(x) == SNMPERR_SUCCESS)
  |  |  ------------------
  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  ------------------
  |  |  |  Branch (145:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2045|      0|        char            i64buf[I64CHARSZ + 1];
 2046|      0|        printU64(i64buf, cp);
 2047|      0|        DEBUGMSG(("dumpv_recv", "Counter64: %s\n", i64buf));
  ------------------
  |  |   61|      0|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2048|      0|    }
 2049|       |
 2050|  2.57k|    return bufp;
 2051|  2.59k|}
asn_parse_signed_int64:
 2228|  1.13k|{
 2229|  1.13k|    static const char *errpre = "parse int64";
 2230|  1.13k|    const int       int64sizelimit = (4 * 2) + 1;
 2231|  1.13k|    char            ebuf[128];
 2232|  1.13k|    register u_char *bufp = data;
 2233|  1.13k|    u_char         *endp;
 2234|  1.13k|    u_long          asn_length;
 2235|  1.13k|    register u_int  low = 0, high = 0;
 2236|       |
 2237|  1.13k|    if (countersize != sizeof(struct counter64)) {
  ------------------
  |  Branch (2237:9): [True: 0, False: 1.13k]
  ------------------
 2238|      0|        _asn_size_err(errpre, countersize, sizeof(struct counter64));
 2239|      0|        return NULL;
 2240|      0|    }
 2241|       |
 2242|  1.13k|    if (NULL == data || NULL == datalength || NULL == type || NULL == cp) {
  ------------------
  |  Branch (2242:9): [True: 0, False: 1.13k]
  |  Branch (2242:25): [True: 0, False: 1.13k]
  |  Branch (2242:47): [True: 0, False: 1.13k]
  |  Branch (2242:63): [True: 0, False: 1.13k]
  ------------------
 2243|      0|        ERROR_MSG("parse int64: NULL pointer");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 2244|      0|        return NULL;
 2245|      0|    }
 2246|       |
 2247|       |    /** need at least 2 bytes to work with: type, length (which might be 0) */
 2248|  1.13k|    if (*datalength < 2) {
  ------------------
  |  Branch (2248:9): [True: 0, False: 1.13k]
  ------------------
 2249|      0|        _asn_short_err(errpre, *datalength, 2);
 2250|      0|        return NULL;
 2251|      0|    }
 2252|       |
 2253|  1.13k|    *type = *bufp++;
 2254|  1.13k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
 2255|  1.13k|    if (NULL == bufp) {
  ------------------
  |  Branch (2255:9): [True: 0, False: 1.13k]
  ------------------
 2256|      0|        _asn_short_err(errpre, *datalength - 1, asn_length);
 2257|      0|        return NULL;
 2258|      0|    }
 2259|  1.13k|    endp = bufp + asn_length;
 2260|       |
 2261|       |    /** need at least 2 bytes: ASN_OPAQUE_TAG1 and ASN_OPAQUE_I64 */
 2262|  1.13k|    if (asn_length < 2) {
  ------------------
  |  Branch (2262:9): [True: 12, False: 1.12k]
  ------------------
 2263|     12|        _asn_short_err(errpre, asn_length, 2);
 2264|     12|        return NULL;
 2265|     12|    }
 2266|       |
 2267|  1.12k|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|  1.12k|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  1.12k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  196|      0|        debugmsg("dumpx" token, "dumpx_%s:%*s", token, __DBGINDENT(), ""); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  |  |  197|      0|        __DBGMSGHEX(("dumpx_" token,buf,len)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|      0|#define __DBGMSGHEX(x)     debugmsg_hex x
  |  |  |  |  ------------------
  |  |  |  |  198|      0|        if (debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (198:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  199|      0|            debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (199:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  200|      0|            debugmsg("dumpx_" token,"\n"); \
  |  |  |  |  201|      0|        } else { \
  |  |  |  |  202|      0|            debugmsg("dumpx_" token,"  "); \
  |  |  |  |  203|      0|        } \
  |  |  |  |  204|      0|        debugmsg("dumpv" token, "dumpv_%s:%*s", token, __DBGINDENT(), "");
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (83:60): [Folded, False: 1.12k]
  |  |  ------------------
  ------------------
 2268|  1.12k|    if ((*type == ASN_OPAQUE) &&
  ------------------
  |  |   93|  1.12k|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   91|  1.12k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (2268:9): [True: 1.11k, False: 12]
  ------------------
 2269|  1.11k|        (asn_length <= ASN_OPAQUE_COUNTER64_MX_BER_LEN) &&
  ------------------
  |  |  160|  1.11k|#define ASN_OPAQUE_COUNTER64_MX_BER_LEN 12
  ------------------
  |  Branch (2269:9): [True: 1.09k, False: 16]
  ------------------
 2270|  1.09k|        (*bufp == ASN_OPAQUE_TAG1) && (*(bufp + 1) == ASN_OPAQUE_I64)) {
  ------------------
  |  |  131|  1.09k|#define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   92|  1.09k|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   99|  1.09k|#define ASN_EXTENSION_ID    0x1FU
  |  |  ------------------
  ------------------
                      (*bufp == ASN_OPAQUE_TAG1) && (*(bufp + 1) == ASN_OPAQUE_I64)) {
  ------------------
  |  |  183|  1.09k|#define ASN_OPAQUE_I64 (ASN_OPAQUE_TAG2 + ASN_APP_I64)
  |  |  ------------------
  |  |  |  |  136|  1.09k|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_I64 (ASN_OPAQUE_TAG2 + ASN_APP_I64)
  |  |  ------------------
  |  |  |  |  149|  1.09k|#define ASN_APP_I64 (ASN_APPLICATION | 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|  1.09k|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2270:9): [True: 1.09k, False: 0]
  |  Branch (2270:39): [True: 1.09k, False: 0]
  ------------------
 2271|  1.09k|        size_t          outer_length = asn_length - 2;
 2272|       |
 2273|       |        /*
 2274|       |         * change type to Int64 
 2275|       |         */
 2276|  1.09k|        *type = *(bufp + 1);
 2277|       |        /*
 2278|       |         * value is encoded as special format 
 2279|       |         */
 2280|  1.09k|        bufp = asn_parse_nlength(bufp + 2, outer_length, &asn_length);
 2281|  1.09k|        if (NULL == bufp) {
  ------------------
  |  Branch (2281:13): [True: 0, False: 1.09k]
  ------------------
 2282|      0|            _asn_short_err("parse opaque int64", outer_length, asn_length);
 2283|      0|            return NULL;
 2284|      0|        }
 2285|  1.09k|    }
 2286|       |    /*
 2287|       |     * this should always have been true until snmp gets int64 PDU types 
 2288|       |     */
 2289|     28|    else {
 2290|     28|        snprintf(ebuf, sizeof(ebuf),
 2291|     28|                "%s: wrong type: %d, len %d, buf bytes (%02X,%02X)",
 2292|     28|                errpre, *type, (int) asn_length, *bufp, *(bufp + 1));
 2293|     28|        ERROR_MSG(ebuf);
  ------------------
  |  |  188|     28|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 2294|     28|        return NULL;
 2295|     28|    }
 2296|  1.09k|    if (((int) asn_length > int64sizelimit) ||
  ------------------
  |  Branch (2296:9): [True: 0, False: 1.09k]
  ------------------
 2297|  1.09k|        (((int) asn_length == int64sizelimit) && *bufp != 0x00)) {
  ------------------
  |  Branch (2297:10): [True: 206, False: 890]
  |  Branch (2297:50): [True: 1, False: 205]
  ------------------
 2298|      1|        _asn_length_err(errpre, (size_t) asn_length, int64sizelimit);
 2299|      1|        return NULL;
 2300|      1|    }
 2301|  1.09k|    *datalength -= endp - data;
 2302|  1.09k|    if ((asn_length > 0) && (*bufp & 0x80)) {
  ------------------
  |  Branch (2302:9): [True: 765, False: 330]
  |  Branch (2302:29): [True: 250, False: 515]
  ------------------
 2303|    250|        low = 0xFFFFFFFFU;   /* first byte bit 1 means start the data with 1s */
 2304|    250|        high = 0xFFFFFFFFU;
 2305|    250|    }
 2306|       |
 2307|  3.94k|    for ( ; asn_length; asn_length--) {
  ------------------
  |  Branch (2307:13): [True: 2.84k, False: 1.09k]
  ------------------
 2308|  2.84k|        high = ((0x00FFFFFF & high) << 8) | ((low & 0xFF000000U) >> 24);
 2309|  2.84k|        low = ((low & 0x00FFFFFF) << 8) | *bufp++;
 2310|  2.84k|    }
 2311|  1.09k|    bufp = endp;
 2312|       |
 2313|  1.09k|    CHECK_OVERFLOW_U(high,8);
  ------------------
  |  |  224|  1.09k|#define CHECK_OVERFLOW_U(x,y) do {                                      \
  |  |  225|  1.09k|        if (x > UINT32_MAX) {                                           \
  |  |  ------------------
  |  |  |  Branch (225:13): [True: 0, False: 1.09k]
  |  |  ------------------
  |  |  226|      0|            x &= 0xffffffff;                                            \
  |  |  227|      0|            DEBUGMSG(("asn","truncating unsigned value to 32 bits (%d)\n",y)); \
  |  |  ------------------
  |  |  |  |   61|      0|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (61:67): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  228|      0|        }                                                               \
  |  |  229|  1.09k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (229:13): [Folded, False: 1.09k]
  |  |  ------------------
  ------------------
 2314|  1.09k|    CHECK_OVERFLOW_U(low,8);
  ------------------
  |  |  224|  1.09k|#define CHECK_OVERFLOW_U(x,y) do {                                      \
  |  |  225|  1.09k|        if (x > UINT32_MAX) {                                           \
  |  |  ------------------
  |  |  |  Branch (225:13): [True: 0, False: 1.09k]
  |  |  ------------------
  |  |  226|      0|            x &= 0xffffffff;                                            \
  |  |  227|      0|            DEBUGMSG(("asn","truncating unsigned value to 32 bits (%d)\n",y)); \
  |  |  ------------------
  |  |  |  |   61|      0|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (61:67): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  228|      0|        }                                                               \
  |  |  229|  1.09k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (229:13): [Folded, False: 1.09k]
  |  |  ------------------
  ------------------
 2315|       |
 2316|  1.09k|    cp->low = low;
 2317|  1.09k|    cp->high = high;
 2318|       |
 2319|  1.09k|    DEBUGIF("dumpv_recv") {
  ------------------
  |  |  145|  1.09k|#define DEBUGIF(x)         if (_DBG_IF_ && debug_is_token_registered(x) == SNMPERR_SUCCESS)
  |  |  ------------------
  |  |  |  |  144|  2.19k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGIF(x)         if (_DBG_IF_ && debug_is_token_registered(x) == SNMPERR_SUCCESS)
  |  |  ------------------
  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  ------------------
  |  |  |  Branch (145:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2320|      0|        char            i64buf[I64CHARSZ + 1];
 2321|      0|        printI64(i64buf, cp);
 2322|      0|        DEBUGMSG(("dumpv_recv", "Integer64: %s\n", i64buf));
  ------------------
  |  |   61|      0|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2323|      0|    }
 2324|       |
 2325|  1.09k|    return bufp;
 2326|  1.09k|}
asn_parse_float:
 2449|    935|{
 2450|    935|    static const char *errpre = "parse float";
 2451|    935|    register u_char *bufp = data;
 2452|    935|    u_long          asn_length;
 2453|    935|    union {
 2454|    935|        float           floatVal;
 2455|    935|        long            longVal;
 2456|    935|        u_char          c[sizeof(float)];
 2457|    935|    } fu;
 2458|       |
 2459|    935|    if (floatsize != sizeof(float)) {
  ------------------
  |  Branch (2459:9): [True: 0, False: 935]
  ------------------
 2460|      0|        _asn_size_err("parse float", floatsize, sizeof(float));
 2461|      0|        return NULL;
 2462|      0|    }
 2463|       |
 2464|    935|    if (NULL == data || NULL == datalength || NULL == type || NULL == floatp) {
  ------------------
  |  Branch (2464:9): [True: 0, False: 935]
  |  Branch (2464:25): [True: 0, False: 935]
  |  Branch (2464:47): [True: 0, False: 935]
  |  Branch (2464:63): [True: 0, False: 935]
  ------------------
 2465|      0|        ERROR_MSG("parse float: NULL pointer");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 2466|      0|        return NULL;
 2467|      0|    }
 2468|       |
 2469|       |    /** need at least 2 bytes to work with: type, length (which might be 0)  */
 2470|    935|    if (*datalength < 2) {
  ------------------
  |  Branch (2470:9): [True: 0, False: 935]
  ------------------
 2471|      0|        _asn_short_err(errpre, *datalength, 2);
 2472|      0|        return NULL;
 2473|      0|    }
 2474|       |
 2475|    935|    *type = *bufp++;
 2476|    935|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
 2477|    935|    if (NULL == bufp) {
  ------------------
  |  Branch (2477:9): [True: 0, False: 935]
  ------------------
 2478|      0|        _asn_short_err(errpre, *datalength - 1, asn_length);
 2479|      0|        return NULL;
 2480|      0|    }
 2481|       |
 2482|    935|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|    935|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    935|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 935]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  196|      0|        debugmsg("dumpx" token, "dumpx_%s:%*s", token, __DBGINDENT(), ""); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  |  |  197|      0|        __DBGMSGHEX(("dumpx_" token,buf,len)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|      0|#define __DBGMSGHEX(x)     debugmsg_hex x
  |  |  |  |  ------------------
  |  |  |  |  198|      0|        if (debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (198:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  199|      0|            debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (199:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  200|      0|            debugmsg("dumpx_" token,"\n"); \
  |  |  |  |  201|      0|        } else { \
  |  |  |  |  202|      0|            debugmsg("dumpx_" token,"  "); \
  |  |  |  |  203|      0|        } \
  |  |  |  |  204|      0|        debugmsg("dumpv" token, "dumpv_%s:%*s", token, __DBGINDENT(), "");
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (83:60): [Folded, False: 935]
  |  |  ------------------
  ------------------
 2483|       |    /*
 2484|       |     * the float is encoded as an opaque 
 2485|       |     */
 2486|    935|    if ((*type == ASN_OPAQUE) &&
  ------------------
  |  |   93|    935|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   91|    935|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (2486:9): [True: 510, False: 425]
  ------------------
 2487|    510|        (asn_length == ASN_OPAQUE_FLOAT_BER_LEN) &&
  ------------------
  |  |  169|    510|#define ASN_OPAQUE_FLOAT_BER_LEN 7
  ------------------
  |  Branch (2487:9): [True: 498, False: 12]
  ------------------
 2488|    498|        (*bufp == ASN_OPAQUE_TAG1) && (*(bufp + 1) == ASN_OPAQUE_FLOAT)) {
  ------------------
  |  |  131|    498|#define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   92|    498|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   99|    498|#define ASN_EXTENSION_ID    0x1FU
  |  |  ------------------
  ------------------
                      (*bufp == ASN_OPAQUE_TAG1) && (*(bufp + 1) == ASN_OPAQUE_FLOAT)) {
  ------------------
  |  |  165|    498|#define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  136|    498|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  147|    498|#define ASN_APP_FLOAT (ASN_APPLICATION | 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|    498|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2488:9): [True: 498, False: 0]
  |  Branch (2488:39): [True: 498, False: 0]
  ------------------
 2489|    498|        size_t          outer_length = asn_length - 2;
 2490|       |
 2491|       |        /*
 2492|       |         * value is encoded as special format 
 2493|       |         */
 2494|    498|        bufp = asn_parse_nlength(bufp + 2, outer_length, &asn_length);
 2495|    498|        if (NULL == bufp) {
  ------------------
  |  Branch (2495:13): [True: 0, False: 498]
  ------------------
 2496|      0|            _asn_short_err("parse opaque float", outer_length, asn_length);
 2497|      0|            return NULL;
 2498|      0|        }
 2499|       |        /*
 2500|       |         * change type to Float 
 2501|       |         */
 2502|    498|        *type = ASN_OPAQUE_FLOAT;
  ------------------
  |  |  165|    498|#define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  136|    498|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  147|    498|#define ASN_APP_FLOAT (ASN_APPLICATION | 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|    498|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2503|    498|    }
 2504|       |
 2505|    935|    if (*type != ASN_OPAQUE_FLOAT) {
  ------------------
  |  |  165|    935|#define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  136|    935|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  147|    935|#define ASN_APP_FLOAT (ASN_APPLICATION | 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|    935|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2505:9): [True: 12, False: 923]
  ------------------
 2506|     12|        _asn_type_err(errpre, *type);
 2507|     12|        return NULL;
 2508|     12|    }
 2509|       |
 2510|    923|    if (asn_length != sizeof(float)) {
  ------------------
  |  Branch (2510:9): [True: 23, False: 900]
  ------------------
 2511|     23|        _asn_size_err("parse seq float", asn_length, sizeof(float));
 2512|     23|        return NULL;
 2513|     23|    }
 2514|       |
 2515|    900|    *datalength -= (int) asn_length + (bufp - data);
 2516|    900|    memcpy(&fu.c[0], bufp, asn_length);
 2517|    900|    bufp += asn_length;
 2518|       |
 2519|       |    /*
 2520|       |     * correct for endian differences 
 2521|       |     */
 2522|    900|    fu.longVal = ntohl(fu.longVal);
 2523|       |
 2524|    900|    *floatp = fu.floatVal;
 2525|       |
 2526|    900|    DEBUGMSG(("dumpv_recv", "Opaque float: %f\n", *floatp));
  ------------------
  |  |   61|    900|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|    900|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 900]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 900]
  |  |  ------------------
  ------------------
 2527|    900|    return bufp;
 2528|    923|}
asn_parse_double:
 2633|    808|{
 2634|    808|    static const char *errpre = "parse double";
 2635|    808|    register u_char *bufp = data;
 2636|    808|    u_long          asn_length;
 2637|    808|    long            tmp;
 2638|    808|    union {
 2639|    808|        double          doubleVal;
 2640|    808|        int             intVal[2];
 2641|    808|        u_char          c[sizeof(double)];
 2642|    808|    } fu;
 2643|       |
 2644|       |
 2645|    808|    if (doublesize != sizeof(double)) {
  ------------------
  |  Branch (2645:9): [True: 0, False: 808]
  ------------------
 2646|      0|        _asn_size_err("parse double", doublesize, sizeof(double));
 2647|      0|        return NULL;
 2648|      0|    }
 2649|       |
 2650|    808|    if (NULL == data || NULL == datalength || NULL == type || NULL == doublep) {
  ------------------
  |  Branch (2650:9): [True: 0, False: 808]
  |  Branch (2650:25): [True: 0, False: 808]
  |  Branch (2650:47): [True: 0, False: 808]
  |  Branch (2650:63): [True: 0, False: 808]
  ------------------
 2651|      0|        ERROR_MSG("parse double: NULL pointer");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 2652|      0|        return NULL;
 2653|      0|    }
 2654|       |
 2655|       |    /** need at least 2 bytes to work with: type, length (which might be 0)  */
 2656|    808|    if (*datalength < 2) {
  ------------------
  |  Branch (2656:9): [True: 0, False: 808]
  ------------------
 2657|      0|        _asn_short_err(errpre, *datalength, 2);
 2658|      0|        return NULL;
 2659|      0|    }
 2660|       |
 2661|    808|    *type = *bufp++;
 2662|    808|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
 2663|    808|    if (NULL == bufp) {
  ------------------
  |  Branch (2663:9): [True: 0, False: 808]
  ------------------
 2664|      0|        _asn_short_err(errpre, *datalength - 1, asn_length);
 2665|      0|        return NULL;
 2666|      0|    }
 2667|       |
 2668|    808|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|    808|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    808|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 808]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  196|      0|        debugmsg("dumpx" token, "dumpx_%s:%*s", token, __DBGINDENT(), ""); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  |  |  197|      0|        __DBGMSGHEX(("dumpx_" token,buf,len)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|      0|#define __DBGMSGHEX(x)     debugmsg_hex x
  |  |  |  |  ------------------
  |  |  |  |  198|      0|        if (debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (198:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  199|      0|            debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (199:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  200|      0|            debugmsg("dumpx_" token,"\n"); \
  |  |  |  |  201|      0|        } else { \
  |  |  |  |  202|      0|            debugmsg("dumpx_" token,"  "); \
  |  |  |  |  203|      0|        } \
  |  |  |  |  204|      0|        debugmsg("dumpv" token, "dumpv_%s:%*s", token, __DBGINDENT(), "");
  |  |  |  |  ------------------
  |  |  |  |  |  |  171|      0|#define __DBGINDENT()      debug_indent_get()
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (83:60): [Folded, False: 808]
  |  |  ------------------
  ------------------
 2669|       |    /*
 2670|       |     * the double is encoded as an opaque 
 2671|       |     */
 2672|       |    /** need at least 2 bytes: ASN_OPAQUE_TAG1 and ASN_OPAQUE_DOUBLE */
 2673|    808|    if ((*type == ASN_OPAQUE) && (asn_length < 2)) {
  ------------------
  |  |   93|    808|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   91|    808|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (2673:9): [True: 298, False: 510]
  |  Branch (2673:34): [True: 0, False: 298]
  ------------------
 2674|      0|        _asn_short_err(errpre, asn_length, 2);
 2675|      0|        return NULL;
 2676|      0|    }
 2677|    808|    if ((*type == ASN_OPAQUE) &&
  ------------------
  |  |   93|    808|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   91|    808|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (2677:9): [True: 298, False: 510]
  ------------------
 2678|    298|        (asn_length == ASN_OPAQUE_DOUBLE_BER_LEN) &&
  ------------------
  |  |  178|    298|#define ASN_OPAQUE_DOUBLE_BER_LEN 11
  ------------------
  |  Branch (2678:9): [True: 280, False: 18]
  ------------------
 2679|    280|        (*bufp == ASN_OPAQUE_TAG1) && (*(bufp + 1) == ASN_OPAQUE_DOUBLE)) {
  ------------------
  |  |  131|    280|#define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   92|    280|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   99|    280|#define ASN_EXTENSION_ID    0x1FU
  |  |  ------------------
  ------------------
                      (*bufp == ASN_OPAQUE_TAG1) && (*(bufp + 1) == ASN_OPAQUE_DOUBLE)) {
  ------------------
  |  |  174|    280|#define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  136|    280|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  148|    280|#define ASN_APP_DOUBLE (ASN_APPLICATION | 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|    280|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2679:9): [True: 280, False: 0]
  |  Branch (2679:39): [True: 280, False: 0]
  ------------------
 2680|    280|        size_t          outer_length = asn_length - 2;
 2681|       |
 2682|       |        /*
 2683|       |         * value is encoded as special format 
 2684|       |         */
 2685|    280|        bufp = asn_parse_nlength(bufp + 2, outer_length, &asn_length);
 2686|    280|        if (NULL == bufp) {
  ------------------
  |  Branch (2686:13): [True: 0, False: 280]
  ------------------
 2687|      0|            _asn_short_err("parse opaque double", outer_length, asn_length);
 2688|      0|            return NULL;
 2689|      0|        }
 2690|       |
 2691|       |        /*
 2692|       |         * change type to Double 
 2693|       |         */
 2694|    280|        *type = ASN_OPAQUE_DOUBLE;
  ------------------
  |  |  174|    280|#define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  136|    280|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  148|    280|#define ASN_APP_DOUBLE (ASN_APPLICATION | 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|    280|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2695|    280|    }
 2696|       |
 2697|    808|    if (*type != ASN_OPAQUE_DOUBLE) {
  ------------------
  |  |  174|    808|#define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  136|    808|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  148|    808|#define ASN_APP_DOUBLE (ASN_APPLICATION | 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|    808|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2697:9): [True: 18, False: 790]
  ------------------
 2698|     18|        _asn_type_err(errpre, *type);
 2699|     18|        return NULL;
 2700|     18|    }
 2701|       |
 2702|    790|    if (asn_length != sizeof(double)) {
  ------------------
  |  Branch (2702:9): [True: 29, False: 761]
  ------------------
 2703|     29|        _asn_size_err("parse seq double", asn_length, sizeof(double));
 2704|     29|        return NULL;
 2705|     29|    }
 2706|    761|    *datalength -= (int) asn_length + (bufp - data);
 2707|    761|    memcpy(&fu.c[0], bufp, asn_length);
 2708|    761|    bufp += asn_length;
 2709|       |
 2710|       |    /*
 2711|       |     * correct for endian differences 
 2712|       |     */
 2713|       |
 2714|    761|    tmp = ntohl(fu.intVal[0]);
 2715|    761|    fu.intVal[0] = ntohl(fu.intVal[1]);
 2716|    761|    fu.intVal[1] = tmp;
 2717|       |
 2718|    761|    *doublep = fu.doubleVal;
 2719|    761|    DEBUGMSG(("dumpv_recv", "  Opaque Double:\t%f\n", *doublep));
  ------------------
  |  |   61|    761|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|    761|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 761]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 761]
  |  |  ------------------
  ------------------
 2720|       |
 2721|    761|    return bufp;
 2722|    790|}
asn1.c:_asn_size_err:
  242|     52|{
  243|     52|    char            ebuf[128];
  244|       |
  245|     52|    snprintf(ebuf, sizeof(ebuf),
  246|     52|            "%s size %lu: s/b %lu", str,
  247|     52|	    (unsigned long)wrongsize, (unsigned long)rightsize);
  248|     52|    ERROR_MSG(ebuf);
  ------------------
  |  |  188|     52|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  249|     52|}
asn1.c:_asn_short_err:
  299|  2.37k|{
  300|  2.37k|    char            ebuf[128];
  301|       |
  302|  2.37k|    snprintf(ebuf, sizeof(ebuf), "%s length %lu too short: need %lu", str,
  303|  2.37k|	    (unsigned long)wrongsize, (unsigned long)rightsize);
  304|  2.37k|    ERROR_MSG(ebuf);
  ------------------
  |  |  188|  2.37k|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  305|  2.37k|}
asn1.c:_asn_type_err:
  261|    529|{
  262|    529|    char            ebuf[128];
  263|       |
  264|    529|    snprintf(ebuf, sizeof(ebuf), "%s type %d", str, wrongtype);
  265|    529|    ebuf[ sizeof(ebuf)-1 ] = 0;
  266|    529|    ERROR_MSG(ebuf);
  ------------------
  |  |  188|    529|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  267|    529|}
asn1.c:_asn_length_err:
  280|    151|{
  281|    151|    char            ebuf[128];
  282|       |
  283|    151|    snprintf(ebuf, sizeof(ebuf),
  284|    151|            "%s length %lu too large: exceeds %lu", str,
  285|    151|	    (unsigned long)wrongsize, (unsigned long)rightsize);
  286|    151|    ERROR_MSG(ebuf);
  ------------------
  |  |  188|    151|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  287|    151|}
asn1.c:_asn_bitstring_check:
  515|  1.00k|{
  516|  1.00k|    char            ebuf[128];
  517|       |
  518|  1.00k|    if (asn_length < 1) {
  ------------------
  |  Branch (518:9): [True: 7, False: 993]
  ------------------
  519|      7|        snprintf(ebuf, sizeof(ebuf),
  520|      7|                "%s: length %d too small", str, (int) asn_length);
  521|      7|        ERROR_MSG(ebuf);
  ------------------
  |  |  188|      7|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  522|      7|        return 1;
  523|      7|    }
  524|       |    /*
  525|       |     * if (datum > 7){
  526|       |     * sprintf(ebuf,"%s: datum %d >7: too large", str, (int)(datum));
  527|       |     * ERROR_MSG(ebuf);
  528|       |     * return 1;
  529|       |     * }
  530|       |     */
  531|    993|    return 0;
  532|  1.00k|}

netsnmp_ds_get_boolean:
  242|  5.59k|{
  243|  5.59k|    if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS || 
  ------------------
  |  |   38|  11.1k|#define NETSNMP_DS_MAX_IDS 3
  ------------------
  |  Branch (243:9): [True: 0, False: 5.59k]
  |  Branch (243:24): [True: 0, False: 5.59k]
  ------------------
  244|  5.59k|	which   < 0 || which   >= NETSNMP_DS_MAX_SUBIDS) {
  ------------------
  |  |   39|  5.59k|#define NETSNMP_DS_MAX_SUBIDS 64        /* needs to be a multiple of 8 */
  ------------------
  |  Branch (244:2): [True: 0, False: 5.59k]
  |  Branch (244:17): [True: 0, False: 5.59k]
  ------------------
  245|      0|        return SNMPERR_GENERR;
  ------------------
  |  |  185|      0|#define SNMPERR_GENERR			(-1)
  ------------------
  246|      0|    }
  247|       |
  248|  5.59k|    return (netsnmp_ds_booleans[storeid][which/8] & (1 << (which % 8))) ? 1:0;
  ------------------
  |  Branch (248:12): [True: 0, False: 5.59k]
  ------------------
  249|  5.59k|}

snmp_parse_var_op:
  161|  17.2k|{
  162|  17.2k|    u_char          var_op_type;
  163|  17.2k|    size_t          var_op_len = *listlength;
  164|  17.2k|    u_char         *var_op_start = data;
  165|       |
  166|  17.2k|    data = asn_parse_sequence(data, &var_op_len, &var_op_type,
  167|  17.2k|                              (ASN_SEQUENCE | ASN_CONSTRUCTOR), "var_op");
  ------------------
  |  |   84|  17.2k|#define ASN_SEQUENCE	    0x10U
  ------------------
                                            (ASN_SEQUENCE | ASN_CONSTRUCTOR), "var_op");
  ------------------
  |  |   96|  17.2k|#define ASN_CONSTRUCTOR	    0x20U
  ------------------
  168|  17.2k|    if (data == NULL) {
  ------------------
  |  Branch (168:9): [True: 308, False: 16.9k]
  ------------------
  169|       |        /*
  170|       |         * msg detail is set 
  171|       |         */
  172|    308|        return NULL;
  173|    308|    }
  174|  16.9k|    DEBUGDUMPHEADER("recv", "Name");
  ------------------
  |  |   79|  16.9k|	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  16.9k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 16.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  178|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  179|      0|        debugmsg("dumph_" token,x); \
  |  |  |  |  180|      0|        if (debug_is_token_registered("dumpx" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  181|      0|            debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  182|      0|            (debug_is_token_registered("dumpx_" token) != SNMPERR_SUCCESS &&  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (182:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  183|      0|             debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (183:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  184|      0|            debugmsg("dumph_" token,"\n"); \
  |  |  |  |  185|      0|        } else { \
  |  |  |  |  186|      0|            debugmsg("dumph_" token,"  "); \
  |  |  |  |  187|      0|        } \
  |  |  |  |  188|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (79:55): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  175|  16.9k|    data =
  176|  16.9k|        asn_parse_objid(data, &var_op_len, &var_op_type, var_name,
  177|  16.9k|                        var_name_len);
  178|  16.9k|    DEBUGINDENTLESS();
  ------------------
  |  |   75|  16.9k|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|  16.9k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 16.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  179|  16.9k|    if (data == NULL) {
  ------------------
  |  Branch (179:9): [True: 48, False: 16.9k]
  ------------------
  180|     48|        ERROR_MSG("No OID for variable");
  ------------------
  |  |  188|     48|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  181|     48|        return NULL;
  182|     48|    }
  183|  16.9k|    if (var_op_type !=
  ------------------
  |  Branch (183:9): [True: 0, False: 16.9k]
  ------------------
  184|  16.9k|        (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID))
  ------------------
  |  |   90|  16.9k|#define ASN_UNIVERSAL	    0x00U
  ------------------
                      (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID))
  ------------------
  |  |   95|  16.9k|#define ASN_PRIMITIVE	    0x00U
  ------------------
                      (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID))
  ------------------
  |  |   81|  16.9k|#define ASN_OBJECT_ID	    0x06U
  ------------------
  185|      0|        return NULL;
  186|  16.9k|    *var_val = data;            /* save pointer to this object */
  187|       |    /*
  188|       |     * find out what type of object this is 
  189|       |     */
  190|  16.9k|    data = asn_parse_header(data, &var_op_len, var_val_type);
  191|  16.9k|    if (data == NULL) {
  ------------------
  |  Branch (191:9): [True: 20, False: 16.8k]
  ------------------
  192|     20|        ERROR_MSG("No header for value");
  ------------------
  |  |  188|     20|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  193|     20|        return NULL;
  194|     20|    }
  195|       |    /*
  196|       |     * XXX no check for type! 
  197|       |     */
  198|  16.8k|    *var_val_len = var_op_len;
  199|  16.8k|    data += var_op_len;
  200|  16.8k|    *listlength -= (int) (data - var_op_start);
  201|  16.8k|    return data;
  202|  16.9k|}

snmp_get_next_transid:
  498|  2.70k|{
  499|  2.70k|    long            retVal;
  500|  2.70k|    snmp_res_lock(MT_LIBRARY_ID, MT_LIB_TRANSID);
  ------------------
  |  |   79|  2.70k|#define snmp_res_lock(x,y) do {} while (0)
  |  |  ------------------
  |  |  |  Branch (79:41): [Folded, False: 2.70k]
  |  |  ------------------
  ------------------
  501|  2.70k|    retVal = 1 + Transid;       /*MTCRITICAL_RESOURCE */
  502|  2.70k|    if (!retVal)
  ------------------
  |  Branch (502:9): [True: 0, False: 2.70k]
  ------------------
  503|      0|        retVal = 2;
  504|  2.70k|    Transid = retVal;
  505|  2.70k|    if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_16BIT_IDS))
  ------------------
  |  |   48|  2.70k|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
                  if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_16BIT_IDS))
  ------------------
  |  |   91|  2.70k|#define NETSNMP_DS_LIB_16BIT_IDS           31   /* restrict requestIDs, etc to 16-bit values */
  ------------------
  |  Branch (505:9): [True: 0, False: 2.70k]
  ------------------
  506|      0|        retVal &= 0x7fff;	/* mask to 15 bits */
  507|  2.70k|    else
  508|  2.70k|        retVal &= 0x7fffffff;	/* mask to 31 bits */
  509|       |
  510|  2.70k|    if (!retVal) {
  ------------------
  |  Branch (510:9): [True: 0, False: 2.70k]
  ------------------
  511|      0|        Transid = retVal = 2;
  512|      0|    }
  513|  2.70k|    snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_TRANSID);
  ------------------
  |  |   80|  2.70k|#define snmp_res_unlock(x,y) do {} while (0)
  |  |  ------------------
  |  |  |  Branch (80:43): [Folded, False: 2.70k]
  |  |  ------------------
  ------------------
  514|  2.70k|    return retVal;
  515|  2.70k|}
snmp_set_detail:
  529|  6.63k|{
  530|  6.63k|    if (detail_string != NULL) {
  ------------------
  |  Branch (530:9): [True: 6.63k, False: 0]
  ------------------
  531|  6.63k|        strlcpy(snmp_detail, detail_string, sizeof(snmp_detail));
  532|  6.63k|        snmp_detail_f = 1;
  533|  6.63k|    }
  534|  6.63k|}
snmp_api_errstring:
  544|    699|{
  545|    699|    const char     *msg = "";
  546|    699|    static char     msg_buf[SPRINT_MAX_LEN];
  547|       |
  548|    699|    if (snmp_errnumber >= SNMPERR_MAX && snmp_errnumber <= SNMPERR_GENERR) {
  ------------------
  |  |  255|  1.39k|#define SNMPERR_MAX			(-69)
  ------------------
                  if (snmp_errnumber >= SNMPERR_MAX && snmp_errnumber <= SNMPERR_GENERR) {
  ------------------
  |  |  185|    699|#define SNMPERR_GENERR			(-1)
  ------------------
  |  Branch (548:9): [True: 699, False: 0]
  |  Branch (548:42): [True: 0, False: 699]
  ------------------
  549|      0|        msg = api_errors[-snmp_errnumber];
  550|    699|    } else if (snmp_errnumber != SNMPERR_SUCCESS) {
  ------------------
  |  |  184|    699|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  ------------------
  |  Branch (550:16): [True: 0, False: 699]
  ------------------
  551|      0|        msg = NULL;
  552|      0|    }
  553|    699|    if (!msg) {
  ------------------
  |  Branch (553:9): [True: 0, False: 699]
  ------------------
  554|      0|	snprintf(msg_buf, sizeof(msg_buf), "Unknown error: %d", snmp_errnumber);
  555|      0|        msg_buf[sizeof(msg_buf)-1] = '\0';
  556|    699|    } else if (snmp_detail_f) {
  ------------------
  |  Branch (556:16): [True: 699, False: 0]
  ------------------
  557|    699|        snprintf(msg_buf, sizeof(msg_buf), "%s (%s)", msg, snmp_detail);
  558|    699|        msg_buf[sizeof(msg_buf)-1] = '\0';
  559|    699|        snmp_detail_f = 0;
  560|    699|    } else {
  561|      0|        strlcpy(msg_buf, msg, sizeof(msg_buf));
  562|      0|    }
  563|       |
  564|    699|    return (msg_buf);
  565|    699|}
snmpv3_parse:
 3896|  2.70k|{
 3897|  2.70k|    u_char          type, msg_flags;
 3898|  2.70k|    long            ver, msg_sec_model;
 3899|  2.70k|    size_t          max_size_response;
 3900|  2.70k|    u_char          tmp_buf[SNMP_MAX_MSG_SIZE];
 3901|  2.70k|    size_t          tmp_buf_len;
 3902|  2.70k|    u_char          pdu_buf[SNMP_MAX_MSG_SIZE];
 3903|  2.70k|    u_char         *mallocbuf = NULL;
 3904|  2.70k|    size_t          pdu_buf_len = SNMP_MAX_MSG_SIZE;
  ------------------
  |  |  109|  2.70k|#define SNMP_MAX_MSG_SIZE          1472 /* ethernet MTU minus IP/UDP header */
  ------------------
 3905|  2.70k|    u_char         *sec_params;
 3906|  2.70k|    u_char         *msg_data;
 3907|  2.70k|    u_char         *cp;
 3908|  2.70k|    size_t          asn_len, msg_len;
 3909|  2.70k|    int             ret, ret_val;
 3910|  2.70k|    struct snmp_secmod_def *sptr;
 3911|       |
 3912|       |
 3913|  2.70k|    msg_data = data;
 3914|  2.70k|    msg_len = *length;
 3915|       |
 3916|       |
 3917|       |    /*
 3918|       |     * message is an ASN.1 SEQUENCE  
 3919|       |     */
 3920|  2.70k|    DEBUGDUMPSECTION("recv", "SNMPv3 Message");
  ------------------
  |  |   81|  2.70k|	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.70k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  191|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  192|      0|        debugmsg("dumph_" token,"%s\n",x);\
  |  |  |  |  193|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (81:56): [Folded, False: 2.70k]
  |  |  ------------------
  ------------------
 3921|  2.70k|    data = asn_parse_sequence(data, length, &type,
 3922|  2.70k|                              (ASN_SEQUENCE | ASN_CONSTRUCTOR), "message");
  ------------------
  |  |   84|  2.70k|#define ASN_SEQUENCE	    0x10U
  ------------------
                                            (ASN_SEQUENCE | ASN_CONSTRUCTOR), "message");
  ------------------
  |  |   96|  2.70k|#define ASN_CONSTRUCTOR	    0x20U
  ------------------
 3923|  2.70k|    if (data == NULL) {
  ------------------
  |  Branch (3923:9): [True: 293, False: 2.41k]
  ------------------
 3924|       |        /*
 3925|       |         * error msg detail is set 
 3926|       |         */
 3927|    293|        snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|    293|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 3928|    293|        DEBUGINDENTLESS();
  ------------------
  |  |   75|    293|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|    293|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 293]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 293]
  |  |  ------------------
  ------------------
 3929|    293|        return SNMPERR_ASN_PARSE_ERR;
  ------------------
  |  |  213|    293|#define SNMPERR_ASN_PARSE_ERR           (-29)
  ------------------
 3930|    293|    }
 3931|       |
 3932|       |    /*
 3933|       |     * parse msgVersion  
 3934|       |     */
 3935|  2.41k|    DEBUGDUMPHEADER("recv", "SNMP Version Number");
  ------------------
  |  |   79|  2.41k|	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.41k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  178|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  179|      0|        debugmsg("dumph_" token,x); \
  |  |  |  |  180|      0|        if (debug_is_token_registered("dumpx" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  181|      0|            debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  182|      0|            (debug_is_token_registered("dumpx_" token) != SNMPERR_SUCCESS &&  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (182:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  183|      0|             debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (183:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  184|      0|            debugmsg("dumph_" token,"\n"); \
  |  |  |  |  185|      0|        } else { \
  |  |  |  |  186|      0|            debugmsg("dumph_" token,"  "); \
  |  |  |  |  187|      0|        } \
  |  |  |  |  188|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (79:55): [Folded, False: 2.41k]
  |  |  ------------------
  ------------------
 3936|  2.41k|    data = asn_parse_int(data, length, &type, &ver, sizeof(ver));
 3937|  2.41k|    DEBUGINDENTLESS();
  ------------------
  |  |   75|  2.41k|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.41k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 2.41k]
  |  |  ------------------
  ------------------
 3938|  2.41k|    if (data == NULL) {
  ------------------
  |  Branch (3938:9): [True: 172, False: 2.23k]
  ------------------
 3939|    172|        ERROR_MSG("bad parse of version");
  ------------------
  |  |  188|    172|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 3940|    172|        snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|    172|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 3941|    172|        DEBUGINDENTLESS();
  ------------------
  |  |   75|    172|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|    172|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 172]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 172]
  |  |  ------------------
  ------------------
 3942|    172|        return SNMPERR_ASN_PARSE_ERR;
  ------------------
  |  |  213|    172|#define SNMPERR_ASN_PARSE_ERR           (-29)
  ------------------
 3943|    172|    }
 3944|  2.23k|    pdu->version = ver;
 3945|       |
 3946|       |    /*
 3947|       |     * parse msgGlobalData sequence  
 3948|       |     */
 3949|  2.23k|    cp = data;
 3950|  2.23k|    asn_len = *length;
 3951|  2.23k|    DEBUGDUMPSECTION("recv", "msgGlobalData");
  ------------------
  |  |   81|  2.23k|	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.23k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  191|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  192|      0|        debugmsg("dumph_" token,"%s\n",x);\
  |  |  |  |  193|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (81:56): [Folded, False: 2.23k]
  |  |  ------------------
  ------------------
 3952|  2.23k|    data = asn_parse_sequence(data, &asn_len, &type,
 3953|  2.23k|                              (ASN_SEQUENCE | ASN_CONSTRUCTOR),
  ------------------
  |  |   84|  2.23k|#define ASN_SEQUENCE	    0x10U
  ------------------
                                            (ASN_SEQUENCE | ASN_CONSTRUCTOR),
  ------------------
  |  |   96|  2.23k|#define ASN_CONSTRUCTOR	    0x20U
  ------------------
 3954|  2.23k|                              "msgGlobalData");
 3955|  2.23k|    if (data == NULL) {
  ------------------
  |  Branch (3955:9): [True: 1.86k, False: 379]
  ------------------
 3956|       |        /*
 3957|       |         * error msg detail is set 
 3958|       |         */
 3959|  1.86k|        snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|  1.86k|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 3960|  1.86k|        DEBUGINDENTADD(-4);
  ------------------
  |  |   73|  1.86k|#define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  1.86k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  172|      0|#define __DBGINDENTADD(x)  debug_indent_add(x)
  |  |  ------------------
  |  |  |  Branch (73:74): [Folded, False: 1.86k]
  |  |  ------------------
  ------------------
 3961|  1.86k|        return SNMPERR_ASN_PARSE_ERR;
  ------------------
  |  |  213|  1.86k|#define SNMPERR_ASN_PARSE_ERR           (-29)
  ------------------
 3962|  1.86k|    }
 3963|    379|    *length -= data - cp;       /* subtract off the length of the header */
 3964|       |
 3965|       |    /*
 3966|       |     * msgID 
 3967|       |     */
 3968|    379|    DEBUGDUMPHEADER("recv", "msgID");
  ------------------
  |  |   79|    379|	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    379|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 379]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  178|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  179|      0|        debugmsg("dumph_" token,x); \
  |  |  |  |  180|      0|        if (debug_is_token_registered("dumpx" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  181|      0|            debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  182|      0|            (debug_is_token_registered("dumpx_" token) != SNMPERR_SUCCESS &&  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (182:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  183|      0|             debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (183:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  184|      0|            debugmsg("dumph_" token,"\n"); \
  |  |  |  |  185|      0|        } else { \
  |  |  |  |  186|      0|            debugmsg("dumph_" token,"  "); \
  |  |  |  |  187|      0|        } \
  |  |  |  |  188|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (79:55): [Folded, False: 379]
  |  |  ------------------
  ------------------
 3969|    379|    data =
 3970|    379|        asn_parse_int(data, length, &type, &pdu->msgid,
 3971|    379|                      sizeof(pdu->msgid));
 3972|    379|    DEBUGINDENTLESS();
  ------------------
  |  |   75|    379|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|    379|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 379]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 379]
  |  |  ------------------
  ------------------
 3973|    379|    if (data == NULL || type != ASN_INTEGER) {
  ------------------
  |  |   75|    363|#define ASN_INTEGER	    0x02U
  ------------------
  |  Branch (3973:9): [True: 16, False: 363]
  |  Branch (3973:25): [True: 0, False: 363]
  ------------------
 3974|     16|        ERROR_MSG("error parsing msgID");
  ------------------
  |  |  188|     16|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 3975|     16|        DEBUGINDENTADD(-4);
  ------------------
  |  |   73|     16|#define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|     16|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  172|      0|#define __DBGINDENTADD(x)  debug_indent_add(x)
  |  |  ------------------
  |  |  |  Branch (73:74): [Folded, False: 16]
  |  |  ------------------
  ------------------
 3976|     16|        snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|     16|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 3977|     16|        return SNMPERR_ASN_PARSE_ERR;
  ------------------
  |  |  213|     16|#define SNMPERR_ASN_PARSE_ERR           (-29)
  ------------------
 3978|     16|    }
 3979|       |
 3980|       |    /*
 3981|       |     * Check the msgID we received is a legal value.  If not, then increment
 3982|       |     * snmpInASNParseErrs and return the appropriate error (see RFC 2572,
 3983|       |     * para. 7.2, section 2 -- note that a bad msgID means that the received
 3984|       |     * message is NOT a serialization of an SNMPv3Message, since the msgID
 3985|       |     * field is out of bounds).  
 3986|       |     */
 3987|       |
 3988|    363|    if (pdu->msgid < 0 || pdu->msgid > SNMP_MAX_PACKET_LEN) {
  ------------------
  |  |   49|    315|#define SNMP_MAX_PACKET_LEN (0x7fffffff)
  ------------------
  |  Branch (3988:9): [True: 48, False: 315]
  |  Branch (3988:27): [True: 3, False: 312]
  ------------------
 3989|     51|        snmp_log(LOG_ERR, "Received bad msgID (%ld %s %s).\n", pdu->msgid,
 3990|     51|                 (pdu->msgid < 0) ? "<" : ">",
  ------------------
  |  Branch (3990:18): [True: 48, False: 3]
  ------------------
 3991|     51|                 (pdu->msgid < 0) ? "0" : "2^31 - 1");
  ------------------
  |  Branch (3991:18): [True: 48, False: 3]
  ------------------
 3992|     51|        snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|     51|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 3993|     51|        DEBUGINDENTADD(-4);
  ------------------
  |  |   73|     51|#define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|     51|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 51]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  172|      0|#define __DBGINDENTADD(x)  debug_indent_add(x)
  |  |  ------------------
  |  |  |  Branch (73:74): [Folded, False: 51]
  |  |  ------------------
  ------------------
 3994|     51|        return SNMPERR_ASN_PARSE_ERR;
  ------------------
  |  |  213|     51|#define SNMPERR_ASN_PARSE_ERR           (-29)
  ------------------
 3995|     51|    }
 3996|       |
 3997|       |    /*
 3998|       |     * msgMaxSize 
 3999|       |     */
 4000|    312|    DEBUGDUMPHEADER("recv:msgMaxSize", "msgMaxSize");
  ------------------
  |  |   79|    312|	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    312|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 312]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  178|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  179|      0|        debugmsg("dumph_" token,x); \
  |  |  |  |  180|      0|        if (debug_is_token_registered("dumpx" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  181|      0|            debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  182|      0|            (debug_is_token_registered("dumpx_" token) != SNMPERR_SUCCESS &&  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (182:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  183|      0|             debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (183:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  184|      0|            debugmsg("dumph_" token,"\n"); \
  |  |  |  |  185|      0|        } else { \
  |  |  |  |  186|      0|            debugmsg("dumph_" token,"  "); \
  |  |  |  |  187|      0|        } \
  |  |  |  |  188|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (79:55): [Folded, False: 312]
  |  |  ------------------
  ------------------
 4001|    312|    data = asn_parse_int(data, length, &type, &pdu->msgMaxSize,
 4002|    312|                         sizeof(pdu->msgMaxSize));
 4003|    312|    DEBUGINDENTLESS();
  ------------------
  |  |   75|    312|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|    312|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 312]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 312]
  |  |  ------------------
  ------------------
 4004|    312|    if (data == NULL || type != ASN_INTEGER) {
  ------------------
  |  |   75|    251|#define ASN_INTEGER	    0x02U
  ------------------
  |  Branch (4004:9): [True: 61, False: 251]
  |  Branch (4004:25): [True: 0, False: 251]
  ------------------
 4005|     61|        ERROR_MSG("error parsing msgMaxSize");
  ------------------
  |  |  188|     61|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 4006|     61|        snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|     61|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 4007|     61|        DEBUGINDENTADD(-4);
  ------------------
  |  |   73|     61|#define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|     61|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 61]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  172|      0|#define __DBGINDENTADD(x)  debug_indent_add(x)
  |  |  ------------------
  |  |  |  Branch (73:74): [Folded, False: 61]
  |  |  ------------------
  ------------------
 4008|     61|        return SNMPERR_ASN_PARSE_ERR;
  ------------------
  |  |  213|     61|#define SNMPERR_ASN_PARSE_ERR           (-29)
  ------------------
 4009|     61|    }
 4010|       |
 4011|       |    /*
 4012|       |     * Check the msgMaxSize we received is a legal value.  If not, then
 4013|       |     * increment snmpInASNParseErrs and return the appropriate error (see RFC
 4014|       |     * 2572, para. 7.2, section 2 -- note that a bad msgMaxSize means that the
 4015|       |     * received message is NOT a serialization of an SNMPv3Message, since the
 4016|       |     * msgMaxSize field is out of bounds).
 4017|       |     */
 4018|       |
 4019|    251|    if (pdu->msgMaxSize < SNMP_MIN_MAX_LEN) {
  ------------------
  |  |   48|    251|#define SNMP_MIN_MAX_LEN    484 /* minimum maximum message size */
  ------------------
  |  Branch (4019:9): [True: 57, False: 194]
  ------------------
 4020|     57|        snmp_log(LOG_ERR, "Received bad msgMaxSize (%lu < 484).\n",
 4021|     57|                 pdu->msgMaxSize);
 4022|     57|        snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|     57|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 4023|     57|        DEBUGINDENTADD(-4);
  ------------------
  |  |   73|     57|#define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|     57|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 57]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  172|      0|#define __DBGINDENTADD(x)  debug_indent_add(x)
  |  |  ------------------
  |  |  |  Branch (73:74): [Folded, False: 57]
  |  |  ------------------
  ------------------
 4024|     57|        return SNMPERR_ASN_PARSE_ERR;
  ------------------
  |  |  213|     57|#define SNMPERR_ASN_PARSE_ERR           (-29)
  ------------------
 4025|    194|    } else if (pdu->msgMaxSize > SNMP_MAX_PACKET_LEN) {
  ------------------
  |  |   49|    194|#define SNMP_MAX_PACKET_LEN (0x7fffffff)
  ------------------
  |  Branch (4025:16): [True: 4, False: 190]
  ------------------
 4026|      4|        snmp_log(LOG_ERR, "Received bad msgMaxSize (%lu > 2^31 - 1).\n",
 4027|      4|                 pdu->msgMaxSize);
 4028|      4|        snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|      4|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 4029|      4|        DEBUGINDENTADD(-4);
  ------------------
  |  |   73|      4|#define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      4|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  172|      0|#define __DBGINDENTADD(x)  debug_indent_add(x)
  |  |  ------------------
  |  |  |  Branch (73:74): [Folded, False: 4]
  |  |  ------------------
  ------------------
 4030|      4|        return SNMPERR_ASN_PARSE_ERR;
  ------------------
  |  |  213|      4|#define SNMPERR_ASN_PARSE_ERR           (-29)
  ------------------
 4031|    190|    } else {
 4032|    190|        DEBUGMSGTL(("snmpv3_parse:msgMaxSize", "msgMaxSize %lu received\n",
  ------------------
  |  |   66|    190|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    190|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 190]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #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: 190]
  |  |  ------------------
  ------------------
 4033|    190|                    pdu->msgMaxSize));
 4034|       |        /** don't increase max msg size if we've already got one */
 4035|    190|        if (sess->sndMsgMaxSize < pdu->msgMaxSize) {
  ------------------
  |  Branch (4035:13): [True: 190, False: 0]
  ------------------
 4036|    190|            DEBUGMSGTL(("snmpv3_parse:msgMaxSize",
  ------------------
  |  |   66|    190|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    190|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 190]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #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: 190]
  |  |  ------------------
  ------------------
 4037|    190|                        "msgMaxSize %" NETSNMP_PRIz "d greater than session max %ld; reducing\n",
 4038|    190|                        sess->sndMsgMaxSize, pdu->msgMaxSize));
 4039|    190|            pdu->msgMaxSize = sess->sndMsgMaxSize;
 4040|    190|        }
 4041|    190|    }
 4042|       |
 4043|       |    /*
 4044|       |     * msgFlags 
 4045|       |     */
 4046|    190|    tmp_buf_len = SNMP_MAX_MSG_SIZE;
  ------------------
  |  |  109|    190|#define SNMP_MAX_MSG_SIZE          1472 /* ethernet MTU minus IP/UDP header */
  ------------------
 4047|    190|    DEBUGDUMPHEADER("recv", "msgFlags");
  ------------------
  |  |   79|    190|	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    190|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 190]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  178|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  179|      0|        debugmsg("dumph_" token,x); \
  |  |  |  |  180|      0|        if (debug_is_token_registered("dumpx" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  181|      0|            debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  182|      0|            (debug_is_token_registered("dumpx_" token) != SNMPERR_SUCCESS &&  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (182:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  183|      0|             debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (183:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  184|      0|            debugmsg("dumph_" token,"\n"); \
  |  |  |  |  185|      0|        } else { \
  |  |  |  |  186|      0|            debugmsg("dumph_" token,"  "); \
  |  |  |  |  187|      0|        } \
  |  |  |  |  188|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (79:55): [Folded, False: 190]
  |  |  ------------------
  ------------------
 4048|    190|    data = asn_parse_string(data, length, &type, tmp_buf, &tmp_buf_len);
 4049|    190|    DEBUGINDENTLESS();
  ------------------
  |  |   75|    190|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|    190|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 190]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 190]
  |  |  ------------------
  ------------------
 4050|    190|    if (data == NULL || type != ASN_OCTET_STR || tmp_buf_len != 1) {
  ------------------
  |  |   78|    318|#define ASN_OCTET_STR	    0x04U
  ------------------
  |  Branch (4050:9): [True: 62, False: 128]
  |  Branch (4050:25): [True: 4, False: 124]
  |  Branch (4050:50): [True: 11, False: 113]
  ------------------
 4051|     77|        ERROR_MSG("error parsing msgFlags");
  ------------------
  |  |  188|     77|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 4052|     77|        snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|     77|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 4053|     77|        DEBUGINDENTADD(-4);
  ------------------
  |  |   73|     77|#define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|     77|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 77]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  172|      0|#define __DBGINDENTADD(x)  debug_indent_add(x)
  |  |  ------------------
  |  |  |  Branch (73:74): [Folded, False: 77]
  |  |  ------------------
  ------------------
 4054|     77|        return SNMPERR_ASN_PARSE_ERR;
  ------------------
  |  |  213|     77|#define SNMPERR_ASN_PARSE_ERR           (-29)
  ------------------
 4055|     77|    }
 4056|    113|    msg_flags = *tmp_buf;
 4057|    113|    if (msg_flags & SNMP_MSG_FLAG_RPRT_BIT)
  ------------------
  |  |  305|    113|#define SNMP_MSG_FLAG_RPRT_BIT          0x04
  ------------------
  |  Branch (4057:9): [True: 42, False: 71]
  ------------------
 4058|     42|        pdu->flags |= SNMP_MSG_FLAG_RPRT_BIT;
  ------------------
  |  |  305|     42|#define SNMP_MSG_FLAG_RPRT_BIT          0x04
  ------------------
 4059|     71|    else
 4060|     71|        pdu->flags &= (~SNMP_MSG_FLAG_RPRT_BIT);
  ------------------
  |  |  305|     71|#define SNMP_MSG_FLAG_RPRT_BIT          0x04
  ------------------
 4061|       |
 4062|       |    /*
 4063|       |     * msgSecurityModel 
 4064|       |     */
 4065|    113|    DEBUGDUMPHEADER("recv", "msgSecurityModel");
  ------------------
  |  |   79|    113|	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    113|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 113]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  178|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  179|      0|        debugmsg("dumph_" token,x); \
  |  |  |  |  180|      0|        if (debug_is_token_registered("dumpx" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  181|      0|            debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  182|      0|            (debug_is_token_registered("dumpx_" token) != SNMPERR_SUCCESS &&  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (182:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  183|      0|             debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (183:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  184|      0|            debugmsg("dumph_" token,"\n"); \
  |  |  |  |  185|      0|        } else { \
  |  |  |  |  186|      0|            debugmsg("dumph_" token,"  "); \
  |  |  |  |  187|      0|        } \
  |  |  |  |  188|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (79:55): [Folded, False: 113]
  |  |  ------------------
  ------------------
 4066|    113|    data = asn_parse_int(data, length, &type, &msg_sec_model,
 4067|    113|                         sizeof(msg_sec_model));
 4068|    113|    DEBUGINDENTADD(-4);         /* return from global data indent */
  ------------------
  |  |   73|    113|#define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    113|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 113]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  172|      0|#define __DBGINDENTADD(x)  debug_indent_add(x)
  |  |  ------------------
  |  |  |  Branch (73:74): [Folded, False: 113]
  |  |  ------------------
  ------------------
 4069|    113|    if (data == NULL || type != ASN_INTEGER ||
  ------------------
  |  |   75|    222|#define ASN_INTEGER	    0x02U
  ------------------
  |  Branch (4069:9): [True: 4, False: 109]
  |  Branch (4069:25): [True: 0, False: 109]
  ------------------
 4070|    109|        msg_sec_model < 1 || msg_sec_model > 0x7fffffff) {
  ------------------
  |  Branch (4070:9): [True: 48, False: 61]
  |  Branch (4070:30): [True: 3, False: 58]
  ------------------
 4071|     55|        ERROR_MSG("error parsing msgSecurityModel");
  ------------------
  |  |  188|     55|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 4072|     55|        snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|     55|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 4073|     55|        DEBUGINDENTLESS();
  ------------------
  |  |   75|     55|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|     55|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 55]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 55]
  |  |  ------------------
  ------------------
 4074|     55|        return SNMPERR_ASN_PARSE_ERR;
  ------------------
  |  |  213|     55|#define SNMPERR_ASN_PARSE_ERR           (-29)
  ------------------
 4075|     55|    }
 4076|     58|    sptr = find_sec_mod(msg_sec_model);
 4077|     58|    if (!sptr) {
  ------------------
  |  Branch (4077:9): [True: 58, False: 0]
  ------------------
 4078|     58|        snmp_log(LOG_WARNING, "unknown security model: %ld\n",
 4079|     58|                 msg_sec_model);
 4080|     58|        snmp_increment_statistic(STAT_SNMPUNKNOWNSECURITYMODELS);
  ------------------
  |  |  611|     58|#define   STAT_SNMPUNKNOWNSECURITYMODELS     0
  ------------------
 4081|     58|        DEBUGINDENTLESS();
  ------------------
  |  |   75|     58|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|     58|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 58]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 58]
  |  |  ------------------
  ------------------
 4082|     58|        return SNMPERR_UNKNOWN_SEC_MODEL;
  ------------------
  |  |  214|     58|#define SNMPERR_UNKNOWN_SEC_MODEL 	(-30)
  ------------------
 4083|     58|    }
 4084|      0|    pdu->securityModel = msg_sec_model;
 4085|       |
 4086|      0|    if (msg_flags & SNMP_MSG_FLAG_PRIV_BIT &&
  ------------------
  |  |  304|      0|#define SNMP_MSG_FLAG_PRIV_BIT          0x02
  ------------------
  |  Branch (4086:9): [True: 0, False: 0]
  ------------------
 4087|      0|        !(msg_flags & SNMP_MSG_FLAG_AUTH_BIT)) {
  ------------------
  |  |  303|      0|#define SNMP_MSG_FLAG_AUTH_BIT          0x01
  ------------------
  |  Branch (4087:9): [True: 0, False: 0]
  ------------------
 4088|      0|        ERROR_MSG("invalid message, illegal msgFlags");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 4089|      0|        snmp_increment_statistic(STAT_SNMPINVALIDMSGS);
  ------------------
  |  |  612|      0|#define   STAT_SNMPINVALIDMSGS               1
  ------------------
 4090|      0|        DEBUGINDENTLESS();
  ------------------
  |  |   75|      0|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4091|      0|        return SNMPERR_INVALID_MSG;
  ------------------
  |  |  215|      0|#define SNMPERR_INVALID_MSG             (-31)
  ------------------
 4092|      0|    }
 4093|      0|    pdu->securityLevel = ((msg_flags & SNMP_MSG_FLAG_AUTH_BIT)
  ------------------
  |  |  303|      0|#define SNMP_MSG_FLAG_AUTH_BIT          0x01
  ------------------
  |  Branch (4093:27): [True: 0, False: 0]
  ------------------
 4094|      0|                          ? ((msg_flags & SNMP_MSG_FLAG_PRIV_BIT)
  ------------------
  |  |  304|      0|#define SNMP_MSG_FLAG_PRIV_BIT          0x02
  ------------------
  |  Branch (4094:30): [True: 0, False: 0]
  ------------------
 4095|      0|                             ? SNMP_SEC_LEVEL_AUTHPRIV
  ------------------
  |  |  301|      0|#define SNMP_SEC_LEVEL_AUTHPRIV		3
  ------------------
 4096|      0|                             : SNMP_SEC_LEVEL_AUTHNOPRIV)
  ------------------
  |  |  300|      0|#define SNMP_SEC_LEVEL_AUTHNOPRIV	2
  ------------------
 4097|      0|                          : SNMP_SEC_LEVEL_NOAUTH);
  ------------------
  |  |  299|      0|#define SNMP_SEC_LEVEL_NOAUTH		1
  ------------------
 4098|       |    /*
 4099|       |     * end of msgGlobalData 
 4100|       |     */
 4101|       |
 4102|       |    /*
 4103|       |     * securtityParameters OCTET STRING begins after msgGlobalData 
 4104|       |     */
 4105|      0|    sec_params = data;
 4106|      0|    SNMP_FREE(pdu->contextEngineID);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 4107|      0|    pdu->contextEngineID = calloc(1, SNMP_MAX_ENG_SIZE);
  ------------------
  |  |  111|      0|#define SNMP_MAX_ENG_SIZE          32
  ------------------
 4108|      0|    pdu->contextEngineIDLen = SNMP_MAX_ENG_SIZE;
  ------------------
  |  |  111|      0|#define SNMP_MAX_ENG_SIZE          32
  ------------------
 4109|       |
 4110|       |    /*
 4111|       |     * Note: there is no length limit on the msgAuthoritativeEngineID field,
 4112|       |     * although we would EXPECT it to be limited to 32 (the SnmpEngineID TC
 4113|       |     * limit).  We'll use double that here to be on the safe side.  
 4114|       |     */
 4115|       |
 4116|      0|    SNMP_FREE(pdu->securityEngineID);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 4117|      0|    pdu->securityEngineID = calloc(1, SNMP_MAX_ENG_SIZE * 2);
  ------------------
  |  |  111|      0|#define SNMP_MAX_ENG_SIZE          32
  ------------------
 4118|      0|    pdu->securityEngineIDLen = SNMP_MAX_ENG_SIZE * 2;
  ------------------
  |  |  111|      0|#define SNMP_MAX_ENG_SIZE          32
  ------------------
 4119|      0|    SNMP_FREE(pdu->securityName);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 4120|      0|    pdu->securityName = calloc(1, SNMP_MAX_SEC_NAME_SIZE);
  ------------------
  |  |  112|      0|#define SNMP_MAX_SEC_NAME_SIZE     256
  ------------------
 4121|      0|    pdu->securityNameLen = SNMP_MAX_SEC_NAME_SIZE;
  ------------------
  |  |  112|      0|#define SNMP_MAX_SEC_NAME_SIZE     256
  ------------------
 4122|       |
 4123|      0|    if ((pdu->securityName == NULL) ||
  ------------------
  |  Branch (4123:9): [True: 0, False: 0]
  ------------------
 4124|      0|        (pdu->securityEngineID == NULL) ||
  ------------------
  |  Branch (4124:9): [True: 0, False: 0]
  ------------------
 4125|      0|        (pdu->contextEngineID == NULL)) {
  ------------------
  |  Branch (4125:9): [True: 0, False: 0]
  ------------------
 4126|      0|        return SNMPERR_MALLOC;
  ------------------
  |  |  246|      0|#define SNMPERR_MALLOC			(-62)
  ------------------
 4127|      0|    }
 4128|       |
 4129|      0|    if (pdu_buf_len < msg_len
  ------------------
  |  Branch (4129:9): [True: 0, False: 0]
  ------------------
 4130|      0|        && pdu->securityLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
  ------------------
  |  |  301|      0|#define SNMP_SEC_LEVEL_AUTHPRIV		3
  ------------------
  |  Branch (4130:12): [True: 0, False: 0]
  ------------------
 4131|       |        /*
 4132|       |         * space needed is larger than we have in the default buffer 
 4133|       |         */
 4134|      0|        mallocbuf = calloc(1, msg_len);
 4135|      0|        if (mallocbuf == NULL)
  ------------------
  |  Branch (4135:13): [True: 0, False: 0]
  ------------------
 4136|      0|            return SNMPERR_MALLOC;
  ------------------
  |  |  246|      0|#define SNMPERR_MALLOC			(-62)
  ------------------
 4137|      0|        pdu_buf_len = msg_len;
 4138|      0|        cp = mallocbuf;
 4139|      0|    } else {
 4140|      0|        memset(pdu_buf, 0, pdu_buf_len);
 4141|      0|        cp = pdu_buf;
 4142|      0|    }
 4143|       |
 4144|      0|    DEBUGDUMPSECTION("recv", "SM msgSecurityParameters");
  ------------------
  |  |   81|      0|	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  191|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  192|      0|        debugmsg("dumph_" token,"%s\n",x);\
  |  |  |  |  193|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (81:56): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4145|      0|    if (sptr->decode) {
  ------------------
  |  Branch (4145:9): [True: 0, False: 0]
  ------------------
 4146|      0|        struct snmp_secmod_incoming_params parms;
 4147|      0|        parms.msgProcModel = pdu->msgParseModel;
 4148|      0|        parms.maxMsgSize = pdu->msgMaxSize;
 4149|      0|        parms.secParams = sec_params;
 4150|      0|        parms.secModel = msg_sec_model;
 4151|      0|        parms.secLevel = pdu->securityLevel;
 4152|      0|        parms.wholeMsg = msg_data;
 4153|      0|        parms.wholeMsgLen = msg_len;
 4154|      0|        parms.secEngineID = pdu->securityEngineID;
 4155|      0|        parms.secEngineIDLen = &pdu->securityEngineIDLen;
 4156|      0|        parms.secName = pdu->securityName;
 4157|      0|        parms.secNameLen = &pdu->securityNameLen;
 4158|      0|        parms.scopedPdu = &cp;
 4159|      0|        parms.scopedPduLen = &pdu_buf_len;
 4160|      0|        parms.maxSizeResponse = &max_size_response;
 4161|      0|        parms.secStateRef = &pdu->securityStateRef;
 4162|      0|        parms.sess = sess;
 4163|      0|        parms.pdu = pdu;
 4164|      0|        parms.msg_flags = msg_flags;
 4165|      0|        ret_val = (*sptr->decode) (&parms);
 4166|      0|    } else {
 4167|      0|        SNMP_FREE(mallocbuf);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 4168|      0|        DEBUGINDENTLESS();
  ------------------
  |  |   75|      0|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4169|      0|        snmp_log(LOG_WARNING, "security service %ld can't decode packets\n",
 4170|      0|                 msg_sec_model);
 4171|      0|        return (-1);
 4172|      0|    }
 4173|       |
 4174|      0|    if (ret_val != SNMPERR_SUCCESS) {
  ------------------
  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  ------------------
  |  Branch (4174:9): [True: 0, False: 0]
  ------------------
 4175|      0|        DEBUGDUMPSECTION("recv", "ScopedPDU");
  ------------------
  |  |   81|      0|	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  191|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  192|      0|        debugmsg("dumph_" token,"%s\n",x);\
  |  |  |  |  193|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (81:56): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4176|       |        /*
 4177|       |         * Parse as much as possible -- though I don't see the point? [jbpn].  
 4178|       |         */
 4179|      0|        if (cp) {
  ------------------
  |  Branch (4179:13): [True: 0, False: 0]
  ------------------
 4180|      0|            cp = snmpv3_scopedPDU_parse(pdu, cp, &pdu_buf_len);
 4181|      0|        }
 4182|      0|        if (cp) {
  ------------------
  |  Branch (4182:13): [True: 0, False: 0]
  ------------------
 4183|      0|            DEBUGPRINTPDUTYPE("recv", *cp);
  ------------------
  |  |  431|      0|    DEBUGDUMPSECTION(token, snmp_pdu_type(type))
  |  |  ------------------
  |  |  |  |   81|      0|	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  191|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|        debugmsg("dumph_" token,"%s\n",x);\
  |  |  |  |  |  |  193|      0|        __DBGINDENTMORE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:56): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4184|      0|            snmp_pdu_parse(pdu, cp, &pdu_buf_len);
 4185|      0|            DEBUGINDENTADD(-8);
  ------------------
  |  |   73|      0|#define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  172|      0|#define __DBGINDENTADD(x)  debug_indent_add(x)
  |  |  ------------------
  |  |  |  Branch (73:74): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4186|      0|        } else {
 4187|      0|            DEBUGINDENTADD(-4);
  ------------------
  |  |   73|      0|#define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  172|      0|#define __DBGINDENTADD(x)  debug_indent_add(x)
  |  |  ------------------
  |  |  |  Branch (73:74): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4188|      0|        }
 4189|       |
 4190|      0|        SNMP_FREE(mallocbuf);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 4191|      0|        return ret_val;
 4192|      0|    }
 4193|       |
 4194|       |    /*
 4195|       |     * parse plaintext ScopedPDU sequence 
 4196|       |     */
 4197|      0|    *length = pdu_buf_len;
 4198|      0|    DEBUGDUMPSECTION("recv", "ScopedPDU");
  ------------------
  |  |   81|      0|	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  191|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  192|      0|        debugmsg("dumph_" token,"%s\n",x);\
  |  |  |  |  193|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (81:56): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4199|      0|    data = snmpv3_scopedPDU_parse(pdu, cp, length);
 4200|      0|    if (data == NULL) {
  ------------------
  |  Branch (4200:9): [True: 0, False: 0]
  ------------------
 4201|      0|        snmp_log(LOG_WARNING, "security service %ld error parsing ScopedPDU\n",
 4202|      0|                 msg_sec_model);
 4203|      0|        ERROR_MSG("error parsing PDU");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 4204|      0|        snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|      0|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 4205|      0|        DEBUGINDENTADD(-4);
  ------------------
  |  |   73|      0|#define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  172|      0|#define __DBGINDENTADD(x)  debug_indent_add(x)
  |  |  ------------------
  |  |  |  Branch (73:74): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4206|      0|        SNMP_FREE(mallocbuf);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 4207|      0|        return SNMPERR_ASN_PARSE_ERR;
  ------------------
  |  |  213|      0|#define SNMPERR_ASN_PARSE_ERR           (-29)
  ------------------
 4208|      0|    }
 4209|       |
 4210|       |    /*
 4211|       |     * parse the PDU.  
 4212|       |     */
 4213|      0|    if (after_header != NULL) {
  ------------------
  |  Branch (4213:9): [True: 0, False: 0]
  ------------------
 4214|      0|        *after_header = data;
 4215|      0|        tmp_buf_len = *length;
 4216|      0|    }
 4217|       |
 4218|      0|    DEBUGPRINTPDUTYPE("recv", *data);
  ------------------
  |  |  431|      0|    DEBUGDUMPSECTION(token, snmp_pdu_type(type))
  |  |  ------------------
  |  |  |  |   81|      0|	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  191|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|        debugmsg("dumph_" token,"%s\n",x);\
  |  |  |  |  |  |  193|      0|        __DBGINDENTMORE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:56): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4219|      0|    ret = snmp_pdu_parse(pdu, data, length);
 4220|      0|    DEBUGINDENTADD(-8);
  ------------------
  |  |   73|      0|#define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  172|      0|#define __DBGINDENTADD(x)  debug_indent_add(x)
  |  |  ------------------
  |  |  |  Branch (73:74): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4221|       |
 4222|      0|    if (after_header != NULL) {
  ------------------
  |  Branch (4222:9): [True: 0, False: 0]
  ------------------
 4223|      0|        *length = tmp_buf_len;
 4224|      0|    }
 4225|       |
 4226|      0|    if (ret != SNMPERR_SUCCESS) {
  ------------------
  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  ------------------
  |  Branch (4226:9): [True: 0, False: 0]
  ------------------
 4227|      0|        snmp_log(LOG_WARNING, "security service %ld error parsing ScopedPDU\n",
 4228|      0|                 msg_sec_model);
 4229|      0|        ERROR_MSG("error parsing PDU");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 4230|      0|        snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|      0|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 4231|      0|        SNMP_FREE(mallocbuf);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 4232|      0|        return SNMPERR_ASN_PARSE_ERR;
  ------------------
  |  |  213|      0|#define SNMPERR_ASN_PARSE_ERR           (-29)
  ------------------
 4233|      0|    }
 4234|       |
 4235|      0|    SNMP_FREE(mallocbuf);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 4236|      0|    return SNMPERR_SUCCESS;
  ------------------
  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  ------------------
 4237|      0|}                               /* end snmpv3_parse() */
snmp_parse:
 4776|  2.70k|{
 4777|  2.70k|    int             rc;
 4778|       |
 4779|  2.70k|    rc = _snmp_parse(slp, pss, pdu, data, length);
 4780|  2.70k|    if (rc) {
  ------------------
  |  Branch (4780:9): [True: 2.56k, False: 142]
  ------------------
 4781|  2.56k|        if (!pss->s_snmp_errno) {
  ------------------
  |  Branch (4781:13): [True: 2.47k, False: 90]
  ------------------
 4782|  2.47k|            pss->s_snmp_errno = SNMPERR_BAD_PARSE;
  ------------------
  |  |  197|  2.47k|#define SNMPERR_BAD_PARSE		(-13)
  ------------------
 4783|  2.47k|        }
 4784|  2.56k|        SET_SNMP_ERROR(pss->s_snmp_errno);
  ------------------
  |  |   43|  2.56k|#define SET_SNMP_ERROR(x) snmp_errno=(x)
  ------------------
 4785|  2.56k|    }
 4786|       |
 4787|  2.70k|    return rc;
 4788|  2.70k|}
snmp_pdu_parse:
 4792|  1.41k|{
 4793|  1.41k|    u_char          type;
 4794|  1.41k|    u_char          msg_type;
 4795|  1.41k|    u_char         *var_val;
 4796|  1.41k|    size_t          len;
 4797|  1.41k|    size_t          four;
 4798|  1.41k|    netsnmp_variable_list *vp = NULL, *vplast = NULL;
 4799|  1.41k|    oid             objid[MAX_OID_LEN];
 4800|  1.41k|    u_char         *p;
 4801|       |
 4802|       |    /*
 4803|       |     * Get the PDU type 
 4804|       |     */
 4805|  1.41k|    data = asn_parse_header(data, length, &msg_type);
 4806|  1.41k|    if (data == NULL)
  ------------------
  |  Branch (4806:9): [True: 19, False: 1.39k]
  ------------------
 4807|     19|        return -1;
 4808|  1.39k|    DEBUGMSGTL(("dumpv_recv","    Command %s\n", snmp_pdu_type(msg_type)));
  ------------------
  |  |   66|  1.39k|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  1.39k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #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.39k]
  |  |  ------------------
  ------------------
 4809|  1.39k|    pdu->command = msg_type;
 4810|  1.39k|    pdu->flags &= (~UCD_MSG_FLAG_RESPONSE_PDU);
  ------------------
  |  |  311|  1.39k|#define UCD_MSG_FLAG_RESPONSE_PDU            0x100
  ------------------
 4811|       |
 4812|       |    /*
 4813|       |     * get the fields in the PDU preceding the variable-bindings sequence
 4814|       |     */
 4815|  1.39k|    switch (pdu->command) {
 4816|  1.09k|    case SNMP_MSG_TRAP:
  ------------------
  |  |  135|  1.09k|#define SNMP_MSG_TRAP       (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x4) /* a4=164 */
  |  |  ------------------
  |  |  |  |   92|  1.09k|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_MSG_TRAP       (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x4) /* a4=164 */
  |  |  ------------------
  |  |  |  |   96|  1.09k|#define ASN_CONSTRUCTOR	    0x20U
  |  |  ------------------
  ------------------
  |  Branch (4816:5): [True: 1.09k, False: 307]
  ------------------
 4817|       |        /*
 4818|       |         * enterprise 
 4819|       |         */
 4820|  1.09k|        pdu->enterprise_length = MAX_OID_LEN;
  ------------------
  |  |  120|  1.09k|#define MAX_OID_LEN	    128 /* max subid's in an oid */
  ------------------
 4821|  1.09k|        data = asn_parse_objid(data, length, &type, objid,
 4822|  1.09k|                               &pdu->enterprise_length);
 4823|  1.09k|        if (data == NULL)
  ------------------
  |  Branch (4823:13): [True: 219, False: 871]
  ------------------
 4824|    219|            return -1;
 4825|    871|        SNMP_FREE(pdu->enterprise);
  ------------------
  |  |   62|    871|#define SNMP_FREE(s)    do { if (s) { free(s); s=NULL; } } while(0)
  |  |  ------------------
  |  |  |  Branch (62:34): [True: 0, False: 871]
  |  |  |  Branch (62:66): [Folded, False: 871]
  |  |  ------------------
  ------------------
 4826|    871|        pdu->enterprise = netsnmp_memdup(objid,
 4827|    871|                                         pdu->enterprise_length * sizeof(oid));
 4828|    871|        if (pdu->enterprise == NULL) {
  ------------------
  |  Branch (4828:13): [True: 0, False: 871]
  ------------------
 4829|      0|            return -1;
 4830|      0|        }
 4831|       |
 4832|       |        /*
 4833|       |         * agent-addr 
 4834|       |         */
 4835|    871|        four = 4;
 4836|    871|        data = asn_parse_string(data, length, &type,
 4837|    871|                                (u_char *) pdu->agent_addr, &four);
 4838|    871|        if (data == NULL)
  ------------------
  |  Branch (4838:13): [True: 118, False: 753]
  ------------------
 4839|    118|            return -1;
 4840|       |
 4841|       |        /*
 4842|       |         * generic trap 
 4843|       |         */
 4844|    753|        data = asn_parse_int(data, length, &type, (long *) &pdu->trap_type,
 4845|    753|                             sizeof(pdu->trap_type));
 4846|    753|        if (data == NULL)
  ------------------
  |  Branch (4846:13): [True: 7, False: 746]
  ------------------
 4847|      7|            return -1;
 4848|       |        /*
 4849|       |         * specific trap 
 4850|       |         */
 4851|    746|        data =
 4852|    746|            asn_parse_int(data, length, &type,
 4853|    746|                          (long *) &pdu->specific_type,
 4854|    746|                          sizeof(pdu->specific_type));
 4855|    746|        if (data == NULL)
  ------------------
  |  Branch (4855:13): [True: 4, False: 742]
  ------------------
 4856|      4|            return -1;
 4857|       |
 4858|       |        /*
 4859|       |         * timestamp  
 4860|       |         */
 4861|    742|        data = asn_parse_unsigned_int(data, length, &type, &pdu->time,
 4862|    742|                                      sizeof(pdu->time));
 4863|    742|        if (data == NULL)
  ------------------
  |  Branch (4863:13): [True: 186, False: 556]
  ------------------
 4864|    186|            return -1;
 4865|       |
 4866|    556|        break;
 4867|       |
 4868|    556|    case SNMP_MSG_RESPONSE:
  ------------------
  |  |  127|     35|#define SNMP_MSG_RESPONSE   (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2) /* a2=162 */
  |  |  ------------------
  |  |  |  |   92|     35|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_MSG_RESPONSE   (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2) /* a2=162 */
  |  |  ------------------
  |  |  |  |   96|     35|#define ASN_CONSTRUCTOR	    0x20U
  |  |  ------------------
  ------------------
  |  Branch (4868:5): [True: 35, False: 1.36k]
  ------------------
 4869|     64|    case SNMP_MSG_REPORT:
  ------------------
  |  |  147|     64|#define SNMP_MSG_REPORT     (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x8) /* a8=168 */
  |  |  ------------------
  |  |  |  |   92|     64|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_MSG_REPORT     (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x8) /* a8=168 */
  |  |  ------------------
  |  |  |  |   96|     64|#define ASN_CONSTRUCTOR	    0x20U
  |  |  ------------------
  ------------------
  |  Branch (4869:5): [True: 29, False: 1.36k]
  ------------------
 4870|     64|        pdu->flags |= UCD_MSG_FLAG_RESPONSE_PDU;
  ------------------
  |  |  311|     64|#define UCD_MSG_FLAG_RESPONSE_PDU            0x100
  ------------------
 4871|     64|        NETSNMP_FALLTHROUGH;
  ------------------
  |  | 2443|     64|#    define NETSNMP_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 4872|       |
 4873|     93|    case SNMP_MSG_TRAP2:
  ------------------
  |  |  142|     93|#define SNMP_MSG_TRAP2      (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x7) /* a7=167 */
  |  |  ------------------
  |  |  |  |   92|     93|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_MSG_TRAP2      (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x7) /* a7=167 */
  |  |  ------------------
  |  |  |  |   96|     93|#define ASN_CONSTRUCTOR	    0x20U
  |  |  ------------------
  ------------------
  |  Branch (4873:5): [True: 29, False: 1.36k]
  ------------------
 4874|    111|    case SNMP_MSG_INFORM:
  ------------------
  |  |  141|    111|#define SNMP_MSG_INFORM     (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6) /* a6=166 */
  |  |  ------------------
  |  |  |  |   92|    111|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_MSG_INFORM     (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6) /* a6=166 */
  |  |  ------------------
  |  |  |  |   96|    111|#define ASN_CONSTRUCTOR	    0x20U
  |  |  ------------------
  ------------------
  |  Branch (4874:5): [True: 18, False: 1.37k]
  ------------------
 4875|    111|#ifndef NETSNMP_NOTIFY_ONLY
 4876|    142|    case SNMP_MSG_GET:
  ------------------
  |  |  125|    142|#define SNMP_MSG_GET        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0) /* a0=160 */
  |  |  ------------------
  |  |  |  |   92|    142|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_MSG_GET        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0) /* a0=160 */
  |  |  ------------------
  |  |  |  |   96|    142|#define ASN_CONSTRUCTOR	    0x20U
  |  |  ------------------
  ------------------
  |  Branch (4876:5): [True: 31, False: 1.36k]
  ------------------
 4877|    178|    case SNMP_MSG_GETNEXT:
  ------------------
  |  |  126|    178|#define SNMP_MSG_GETNEXT    (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1) /* a1=161 */
  |  |  ------------------
  |  |  |  |   92|    178|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_MSG_GETNEXT    (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1) /* a1=161 */
  |  |  ------------------
  |  |  |  |   96|    178|#define ASN_CONSTRUCTOR	    0x20U
  |  |  ------------------
  ------------------
  |  Branch (4877:5): [True: 36, False: 1.36k]
  ------------------
 4878|    231|    case SNMP_MSG_GETBULK:
  ------------------
  |  |  140|    231|#define SNMP_MSG_GETBULK    (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x5) /* a5=165 */
  |  |  ------------------
  |  |  |  |   92|    231|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_MSG_GETBULK    (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x5) /* a5=165 */
  |  |  ------------------
  |  |  |  |   96|    231|#define ASN_CONSTRUCTOR	    0x20U
  |  |  ------------------
  ------------------
  |  Branch (4878:5): [True: 53, False: 1.34k]
  ------------------
 4879|    231|#endif /* ! NETSNMP_NOTIFY_ONLY */
 4880|    231|#ifndef NETSNMP_NO_WRITE_SUPPORT
 4881|    300|    case SNMP_MSG_SET:
  ------------------
  |  |  129|    300|#define SNMP_MSG_SET        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x3) /* a3=163 */
  |  |  ------------------
  |  |  |  |   92|    300|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_MSG_SET        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x3) /* a3=163 */
  |  |  ------------------
  |  |  |  |   96|    300|#define ASN_CONSTRUCTOR	    0x20U
  |  |  ------------------
  ------------------
  |  Branch (4881:5): [True: 69, False: 1.32k]
  ------------------
 4882|    300|#endif /* !NETSNMP_NO_WRITE_SUPPORT */
 4883|       |        /*
 4884|       |         * PDU is not an SNMPv1 TRAP 
 4885|       |         */
 4886|       |
 4887|       |        /*
 4888|       |         * request id 
 4889|       |         */
 4890|    300|        DEBUGDUMPHEADER("recv", "request_id");
  ------------------
  |  |   79|    300|	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    300|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 300]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  178|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  179|      0|        debugmsg("dumph_" token,x); \
  |  |  |  |  180|      0|        if (debug_is_token_registered("dumpx" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  181|      0|            debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  182|      0|            (debug_is_token_registered("dumpx_" token) != SNMPERR_SUCCESS &&  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (182:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  183|      0|             debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (183:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  184|      0|            debugmsg("dumph_" token,"\n"); \
  |  |  |  |  185|      0|        } else { \
  |  |  |  |  186|      0|            debugmsg("dumph_" token,"  "); \
  |  |  |  |  187|      0|        } \
  |  |  |  |  188|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (79:55): [Folded, False: 300]
  |  |  ------------------
  ------------------
 4891|    300|        data = asn_parse_int(data, length, &type, &pdu->reqid,
 4892|    300|                             sizeof(pdu->reqid));
 4893|    300|        DEBUGINDENTLESS();
  ------------------
  |  |   75|    300|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|    300|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 300]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 300]
  |  |  ------------------
  ------------------
 4894|    300|        if (data == NULL) {
  ------------------
  |  Branch (4894:13): [True: 11, False: 289]
  ------------------
 4895|     11|            return -1;
 4896|     11|        }
 4897|       |
 4898|       |        /*
 4899|       |         * error status (getbulk non-repeaters) 
 4900|       |         */
 4901|    289|        DEBUGDUMPHEADER("recv", "error status");
  ------------------
  |  |   79|    289|	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    289|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 289]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  178|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  179|      0|        debugmsg("dumph_" token,x); \
  |  |  |  |  180|      0|        if (debug_is_token_registered("dumpx" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  181|      0|            debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  182|      0|            (debug_is_token_registered("dumpx_" token) != SNMPERR_SUCCESS &&  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (182:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  183|      0|             debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (183:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  184|      0|            debugmsg("dumph_" token,"\n"); \
  |  |  |  |  185|      0|        } else { \
  |  |  |  |  186|      0|            debugmsg("dumph_" token,"  "); \
  |  |  |  |  187|      0|        } \
  |  |  |  |  188|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (79:55): [Folded, False: 289]
  |  |  ------------------
  ------------------
 4902|    289|        data = asn_parse_int(data, length, &type, &pdu->errstat,
 4903|    289|                             sizeof(pdu->errstat));
 4904|    289|        DEBUGINDENTLESS();
  ------------------
  |  |   75|    289|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|    289|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 289]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 289]
  |  |  ------------------
  ------------------
 4905|    289|        if (data == NULL) {
  ------------------
  |  Branch (4905:13): [True: 3, False: 286]
  ------------------
 4906|      3|            return -1;
 4907|      3|        }
 4908|       |
 4909|       |        /*
 4910|       |         * error index (getbulk max-repetitions) 
 4911|       |         */
 4912|    286|        DEBUGDUMPHEADER("recv", "error index");
  ------------------
  |  |   79|    286|	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    286|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 286]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  178|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  179|      0|        debugmsg("dumph_" token,x); \
  |  |  |  |  180|      0|        if (debug_is_token_registered("dumpx" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  181|      0|            debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  182|      0|            (debug_is_token_registered("dumpx_" token) != SNMPERR_SUCCESS &&  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (182:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  183|      0|             debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (183:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  184|      0|            debugmsg("dumph_" token,"\n"); \
  |  |  |  |  185|      0|        } else { \
  |  |  |  |  186|      0|            debugmsg("dumph_" token,"  "); \
  |  |  |  |  187|      0|        } \
  |  |  |  |  188|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (79:55): [Folded, False: 286]
  |  |  ------------------
  ------------------
 4913|    286|        data = asn_parse_int(data, length, &type, &pdu->errindex,
 4914|    286|                             sizeof(pdu->errindex));
 4915|    286|        DEBUGINDENTLESS();
  ------------------
  |  |   75|    286|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|    286|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 286]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 286]
  |  |  ------------------
  ------------------
 4916|    286|        if (data == NULL) {
  ------------------
  |  Branch (4916:13): [True: 1, False: 285]
  ------------------
 4917|      1|            return -1;
 4918|      1|        }
 4919|    285|	break;
 4920|       |
 4921|    285|    default:
  ------------------
  |  Branch (4921:5): [True: 7, False: 1.39k]
  ------------------
 4922|      7|        snmp_log(LOG_ERR, "Bad PDU type received: 0x%.2x\n", pdu->command);
 4923|      7|        snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|      7|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 4924|      7|        return -1;
 4925|  1.39k|    }
 4926|       |
 4927|       |    /*
 4928|       |     * get header for variable-bindings sequence 
 4929|       |     */
 4930|    841|    DEBUGDUMPSECTION("recv", "VarBindList");
  ------------------
  |  |   81|    841|	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    841|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 841]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  191|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  192|      0|        debugmsg("dumph_" token,"%s\n",x);\
  |  |  |  |  193|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (81:56): [Folded, False: 841]
  |  |  ------------------
  ------------------
 4931|    841|    data = asn_parse_sequence(data, length, &type,
 4932|    841|                              (ASN_SEQUENCE | ASN_CONSTRUCTOR),
  ------------------
  |  |   84|    841|#define ASN_SEQUENCE	    0x10U
  ------------------
                                            (ASN_SEQUENCE | ASN_CONSTRUCTOR),
  ------------------
  |  |   96|    841|#define ASN_CONSTRUCTOR	    0x20U
  ------------------
 4933|    841|                              "varbinds");
 4934|    841|    if (data == NULL)
  ------------------
  |  Branch (4934:9): [True: 117, False: 724]
  ------------------
 4935|    117|        goto fail;
 4936|       |
 4937|    724|    snmp_free_varbind(pdu->variables);
 4938|    724|    pdu->variables = NULL;
 4939|       |
 4940|       |    /*
 4941|       |     * get each varBind sequence 
 4942|       |     */
 4943|  17.4k|    while ((int) *length > 0) {
  ------------------
  |  Branch (4943:12): [True: 17.2k, False: 142]
  ------------------
 4944|  17.2k|        vp = SNMP_MALLOC_TYPEDEF(netsnmp_variable_list);
  ------------------
  |  |   73|  17.2k|#define SNMP_MALLOC_TYPEDEF(td)  (td *) calloc(1, sizeof(td))
  ------------------
 4945|  17.2k|        if (NULL == vp)
  ------------------
  |  Branch (4945:13): [True: 0, False: 17.2k]
  ------------------
 4946|      0|            goto fail;
 4947|       |
 4948|  17.2k|        vp->name_length = MAX_OID_LEN;
  ------------------
  |  |  120|  17.2k|#define MAX_OID_LEN	    128 /* max subid's in an oid */
  ------------------
 4949|  17.2k|        DEBUGDUMPSECTION("recv", "VarBind");
  ------------------
  |  |   81|  17.2k|	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  17.2k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 17.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  191|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  192|      0|        debugmsg("dumph_" token,"%s\n",x);\
  |  |  |  |  193|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (81:56): [Folded, False: 17.2k]
  |  |  ------------------
  ------------------
 4950|  17.2k|        data = snmp_parse_var_op(data, objid, &vp->name_length, &vp->type,
 4951|  17.2k|                                 &vp->val_len, &var_val, length);
 4952|  17.2k|        if (data == NULL)
  ------------------
  |  Branch (4952:13): [True: 376, False: 16.8k]
  ------------------
 4953|    376|            goto fail;
 4954|  16.8k|        if (snmp_set_var_objid(vp, objid, vp->name_length))
  ------------------
  |  Branch (4954:13): [True: 0, False: 16.8k]
  ------------------
 4955|      0|            goto fail;
 4956|       |
 4957|  16.8k|        len = SNMP_MAX_PACKET_LEN;
  ------------------
  |  |   49|  16.8k|#define SNMP_MAX_PACKET_LEN (0x7fffffff)
  ------------------
 4958|  16.8k|        DEBUGDUMPHEADER("recv", "Value");
  ------------------
  |  |   79|  16.8k|	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  16.8k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 16.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  178|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  179|      0|        debugmsg("dumph_" token,x); \
  |  |  |  |  180|      0|        if (debug_is_token_registered("dumpx" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  181|      0|            debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  182|      0|            (debug_is_token_registered("dumpx_" token) != SNMPERR_SUCCESS &&  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (182:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  183|      0|             debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (183:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  184|      0|            debugmsg("dumph_" token,"\n"); \
  |  |  |  |  185|      0|        } else { \
  |  |  |  |  186|      0|            debugmsg("dumph_" token,"  "); \
  |  |  |  |  187|      0|        } \
  |  |  |  |  188|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (79:55): [Folded, False: 16.8k]
  |  |  ------------------
  ------------------
 4959|  16.8k|        switch ((short) vp->type) {
 4960|  1.53k|        case ASN_INTEGER:
  ------------------
  |  |   75|  1.53k|#define ASN_INTEGER	    0x02U
  ------------------
  |  Branch (4960:9): [True: 1.53k, False: 15.3k]
  ------------------
 4961|  1.53k|            vp->val.integer = (long *) vp->buf;
 4962|  1.53k|            vp->val_len = sizeof(long);
 4963|  1.53k|            p = asn_parse_int(var_val, &len, &vp->type,
 4964|  1.53k|                          (long *) vp->val.integer,
 4965|  1.53k|                          sizeof(*vp->val.integer));
 4966|  1.53k|            if (!p)
  ------------------
  |  Branch (4966:17): [True: 5, False: 1.53k]
  ------------------
 4967|      5|                goto fail;
 4968|  1.53k|            break;
 4969|  1.53k|        case ASN_COUNTER:
  ------------------
  |  |   89|  1.13k|#define ASN_COUNTER	(ASN_APPLICATION | 1)
  |  |  ------------------
  |  |  |  |   91|  1.13k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (4969:9): [True: 1.13k, False: 15.7k]
  ------------------
 4970|  1.81k|        case ASN_GAUGE:
  ------------------
  |  |   90|  1.81k|#define ASN_GAUGE	(ASN_APPLICATION | 2)
  |  |  ------------------
  |  |  |  |   91|  1.81k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (4970:9): [True: 677, False: 16.2k]
  ------------------
 4971|  2.35k|        case ASN_TIMETICKS:
  ------------------
  |  |   92|  2.35k|#define ASN_TIMETICKS   (ASN_APPLICATION | 3)
  |  |  ------------------
  |  |  |  |   91|  2.35k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (4971:9): [True: 541, False: 16.3k]
  ------------------
 4972|  3.00k|        case ASN_UINTEGER:
  ------------------
  |  |  100|  3.00k|#define ASN_UINTEGER    (ASN_APPLICATION | 7)   /* historic - don't use */
  |  |  ------------------
  |  |  |  |   91|  3.00k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (4972:9): [True: 651, False: 16.2k]
  ------------------
 4973|  3.00k|            vp->val.integer = (long *) vp->buf;
 4974|  3.00k|            vp->val_len = sizeof(u_long);
 4975|  3.00k|            p = asn_parse_unsigned_int(var_val, &len, &vp->type,
 4976|  3.00k|                                   (u_long *) vp->val.integer,
 4977|  3.00k|                                   vp->val_len);
 4978|  3.00k|            if (!p)
  ------------------
  |  Branch (4978:17): [True: 18, False: 2.98k]
  ------------------
 4979|     18|                goto fail;
 4980|  2.98k|            break;
 4981|  2.98k|#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
 4982|  2.98k|        case ASN_OPAQUE_COUNTER64:
  ------------------
  |  |  156|    773|#define ASN_OPAQUE_COUNTER64 (ASN_OPAQUE_TAG2 + ASN_APP_COUNTER64)
  |  |  ------------------
  |  |  |  |  136|    773|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_COUNTER64 (ASN_OPAQUE_TAG2 + ASN_APP_COUNTER64)
  |  |  ------------------
  |  |  |  |  146|    773|#define ASN_APP_COUNTER64 (ASN_APPLICATION | 6)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|    773|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4982:9): [True: 773, False: 16.1k]
  ------------------
 4983|  1.45k|        case ASN_OPAQUE_U64:
  ------------------
  |  |  192|  1.45k|#define ASN_OPAQUE_U64 (ASN_OPAQUE_TAG2 + ASN_APP_U64)
  |  |  ------------------
  |  |  |  |  136|  1.45k|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_U64 (ASN_OPAQUE_TAG2 + ASN_APP_U64)
  |  |  ------------------
  |  |  |  |  150|  1.45k|#define ASN_APP_U64 (ASN_APPLICATION | 11)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|  1.45k|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4983:9): [True: 677, False: 16.2k]
  ------------------
 4984|  1.45k|#endif                          /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
 4985|  2.60k|        case ASN_COUNTER64:
  ------------------
  |  |   99|  2.60k|#define ASN_COUNTER64   (ASN_APPLICATION | 6)
  |  |  ------------------
  |  |  |  |   91|  2.60k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (4985:9): [True: 1.15k, False: 15.7k]
  ------------------
 4986|  2.60k|            vp->val.counter64 = (struct counter64 *) vp->buf;
 4987|  2.60k|            vp->val_len = sizeof(struct counter64);
 4988|  2.60k|            p = asn_parse_unsigned_int64(var_val, &len, &vp->type,
 4989|  2.60k|                                     (struct counter64 *) vp->val.
 4990|  2.60k|                                     counter64, vp->val_len);
 4991|  2.60k|            if (!p)
  ------------------
  |  Branch (4991:17): [True: 31, False: 2.57k]
  ------------------
 4992|     31|                goto fail;
 4993|  2.57k|            break;
 4994|  2.57k|#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
 4995|  2.57k|        case ASN_OPAQUE_FLOAT:
  ------------------
  |  |  165|    935|#define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  136|    935|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  147|    935|#define ASN_APP_FLOAT (ASN_APPLICATION | 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|    935|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4995:9): [True: 935, False: 15.9k]
  ------------------
 4996|    935|            vp->val.floatVal = (float *) vp->buf;
 4997|    935|            vp->val_len = sizeof(float);
 4998|    935|            p = asn_parse_float(var_val, &len, &vp->type,
 4999|    935|                            vp->val.floatVal, vp->val_len);
 5000|    935|            if (!p)
  ------------------
  |  Branch (5000:17): [True: 35, False: 900]
  ------------------
 5001|     35|                goto fail;
 5002|    900|            break;
 5003|    900|        case ASN_OPAQUE_DOUBLE:
  ------------------
  |  |  174|    808|#define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  136|    808|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  148|    808|#define ASN_APP_DOUBLE (ASN_APPLICATION | 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|    808|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5003:9): [True: 808, False: 16.0k]
  ------------------
 5004|    808|            vp->val.doubleVal = (double *) vp->buf;
 5005|    808|            vp->val_len = sizeof(double);
 5006|    808|            p = asn_parse_double(var_val, &len, &vp->type,
 5007|    808|                             vp->val.doubleVal, vp->val_len);
 5008|    808|            if (!p)
  ------------------
  |  Branch (5008:17): [True: 47, False: 761]
  ------------------
 5009|     47|                goto fail;
 5010|    761|            break;
 5011|  1.13k|        case ASN_OPAQUE_I64:
  ------------------
  |  |  183|  1.13k|#define ASN_OPAQUE_I64 (ASN_OPAQUE_TAG2 + ASN_APP_I64)
  |  |  ------------------
  |  |  |  |  136|  1.13k|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_I64 (ASN_OPAQUE_TAG2 + ASN_APP_I64)
  |  |  ------------------
  |  |  |  |  149|  1.13k|#define ASN_APP_I64 (ASN_APPLICATION | 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|  1.13k|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5011:9): [True: 1.13k, False: 15.7k]
  ------------------
 5012|  1.13k|            vp->val.counter64 = (struct counter64 *) vp->buf;
 5013|  1.13k|            vp->val_len = sizeof(struct counter64);
 5014|  1.13k|            p = asn_parse_signed_int64(var_val, &len, &vp->type,
 5015|  1.13k|                                   (struct counter64 *) vp->val.counter64,
 5016|  1.13k|                                   sizeof(*vp->val.counter64));
 5017|       |
 5018|  1.13k|            if (!p)
  ------------------
  |  Branch (5018:17): [True: 41, False: 1.09k]
  ------------------
 5019|     41|                goto fail;
 5020|  1.09k|            break;
 5021|  1.09k|#endif                          /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
 5022|  1.09k|        case ASN_IPADDRESS:
  ------------------
  |  |   88|    260|#define ASN_IPADDRESS   (ASN_APPLICATION | 0)
  |  |  ------------------
  |  |  |  |   91|    260|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (5022:9): [True: 260, False: 16.6k]
  ------------------
 5023|    260|            if (vp->val_len != 4)
  ------------------
  |  Branch (5023:17): [True: 12, False: 248]
  ------------------
 5024|     12|                goto fail;
 5025|    248|            NETSNMP_FALLTHROUGH;
  ------------------
  |  | 2443|    248|#    define NETSNMP_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 5026|  1.14k|        case ASN_OCTET_STR:
  ------------------
  |  |   78|  1.14k|#define ASN_OCTET_STR	    0x04U
  ------------------
  |  Branch (5026:9): [True: 893, False: 15.9k]
  ------------------
 5027|  2.45k|        case ASN_OPAQUE:
  ------------------
  |  |   93|  2.45k|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   91|  2.45k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (5027:9): [True: 1.31k, False: 15.5k]
  ------------------
 5028|  3.11k|        case ASN_NSAP:
  ------------------
  |  |   98|  3.11k|#define ASN_NSAP	(ASN_APPLICATION | 5)   /* historic - don't use */
  |  |  ------------------
  |  |  |  |   91|  3.11k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (5028:9): [True: 660, False: 16.2k]
  ------------------
 5029|  3.11k|            if (vp->val_len < sizeof(vp->buf)) {
  ------------------
  |  Branch (5029:17): [True: 2.72k, False: 392]
  ------------------
 5030|  2.72k|                vp->val.string = (u_char *) vp->buf;
 5031|  2.72k|            } else {
 5032|    392|                vp->val.string = (u_char *) malloc(vp->val_len);
 5033|    392|            }
 5034|  3.11k|            if (vp->val.string == NULL) {
  ------------------
  |  Branch (5034:17): [True: 0, False: 3.11k]
  ------------------
 5035|      0|                goto fail;
 5036|      0|            }
 5037|  3.11k|            p = asn_parse_string(var_val, &len, &vp->type, vp->val.string,
 5038|  3.11k|                             &vp->val_len);
 5039|  3.11k|            if (!p)
  ------------------
  |  Branch (5039:17): [True: 0, False: 3.11k]
  ------------------
 5040|      0|                goto fail;
 5041|  3.11k|            break;
 5042|  3.11k|        case ASN_OBJECT_ID:
  ------------------
  |  |   81|    885|#define ASN_OBJECT_ID	    0x06U
  ------------------
  |  Branch (5042:9): [True: 885, False: 16.0k]
  ------------------
 5043|    885|            vp->val_len = MAX_OID_LEN;
  ------------------
  |  |  120|    885|#define MAX_OID_LEN	    128 /* max subid's in an oid */
  ------------------
 5044|    885|            p = asn_parse_objid(var_val, &len, &vp->type, objid, &vp->val_len);
 5045|    885|            if (!p)
  ------------------
  |  Branch (5045:17): [True: 1, False: 884]
  ------------------
 5046|      1|                goto fail;
 5047|    884|            vp->val_len *= sizeof(oid);
 5048|    884|            vp->val.objid = netsnmp_memdup(objid, vp->val_len);
 5049|    884|            if (vp->val.objid == NULL)
  ------------------
  |  Branch (5049:17): [True: 0, False: 884]
  ------------------
 5050|      0|                goto fail;
 5051|    884|            break;
 5052|    884|        case SNMP_NOSUCHOBJECT:
  ------------------
  |  |  201|    345|#define SNMP_NOSUCHOBJECT    (ASN_CONTEXT | ASN_PRIMITIVE | 0x0) /* 80=128 */
  |  |  ------------------
  |  |  |  |   92|    345|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_NOSUCHOBJECT    (ASN_CONTEXT | ASN_PRIMITIVE | 0x0) /* 80=128 */
  |  |  ------------------
  |  |  |  |   95|    345|#define ASN_PRIMITIVE	    0x00U
  |  |  ------------------
  ------------------
  |  Branch (5052:9): [True: 345, False: 16.5k]
  ------------------
 5053|  1.02k|        case SNMP_NOSUCHINSTANCE:
  ------------------
  |  |  202|  1.02k|#define SNMP_NOSUCHINSTANCE  (ASN_CONTEXT | ASN_PRIMITIVE | 0x1) /* 81=129 */
  |  |  ------------------
  |  |  |  |   92|  1.02k|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_NOSUCHINSTANCE  (ASN_CONTEXT | ASN_PRIMITIVE | 0x1) /* 81=129 */
  |  |  ------------------
  |  |  |  |   95|  1.02k|#define ASN_PRIMITIVE	    0x00U
  |  |  ------------------
  ------------------
  |  Branch (5053:9): [True: 678, False: 16.2k]
  ------------------
 5054|  1.41k|        case SNMP_ENDOFMIBVIEW:
  ------------------
  |  |  203|  1.41k|#define SNMP_ENDOFMIBVIEW    (ASN_CONTEXT | ASN_PRIMITIVE | 0x2) /* 82=130 */
  |  |  ------------------
  |  |  |  |   92|  1.41k|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_ENDOFMIBVIEW    (ASN_CONTEXT | ASN_PRIMITIVE | 0x2) /* 82=130 */
  |  |  ------------------
  |  |  |  |   95|  1.41k|#define ASN_PRIMITIVE	    0x00U
  |  |  ------------------
  ------------------
  |  Branch (5054:9): [True: 388, False: 16.5k]
  ------------------
 5055|  1.84k|        case ASN_NULL:
  ------------------
  |  |   79|  1.84k|#define ASN_NULL	    0x05U
  ------------------
  |  Branch (5055:9): [True: 431, False: 16.4k]
  ------------------
 5056|  1.84k|            break;
 5057|  1.00k|        case ASN_BIT_STR:
  ------------------
  |  |   77|  1.00k|#define ASN_BIT_STR	    0x03U
  ------------------
  |  Branch (5057:9): [True: 1.00k, False: 15.8k]
  ------------------
 5058|  1.00k|            vp->val.bitstring = (u_char *) malloc(vp->val_len);
 5059|  1.00k|            if (vp->val.bitstring == NULL) {
  ------------------
  |  Branch (5059:17): [True: 0, False: 1.00k]
  ------------------
 5060|      0|                goto fail;
 5061|      0|            }
 5062|  1.00k|            p = asn_parse_bitstring(var_val, &len, &vp->type,
 5063|  1.00k|                                vp->val.bitstring, &vp->val_len);
 5064|  1.00k|            if (!p)
  ------------------
  |  Branch (5064:17): [True: 7, False: 993]
  ------------------
 5065|      7|                goto fail;
 5066|    993|            break;
 5067|    993|        default:
  ------------------
  |  Branch (5067:9): [True: 9, False: 16.8k]
  ------------------
 5068|      9|            snmp_log(LOG_ERR, "bad type returned (%x)\n", vp->type);
 5069|      9|            goto fail;
 5070|      0|            break;
 5071|  16.8k|        }
 5072|  16.6k|        DEBUGINDENTADD(-4);
  ------------------
  |  |   73|  16.6k|#define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  16.6k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 16.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  172|      0|#define __DBGINDENTADD(x)  debug_indent_add(x)
  |  |  ------------------
  |  |  |  Branch (73:74): [Folded, False: 16.6k]
  |  |  ------------------
  ------------------
 5073|       |
 5074|  16.6k|        if (NULL == vplast) {
  ------------------
  |  Branch (5074:13): [True: 576, False: 16.1k]
  ------------------
 5075|    576|            pdu->variables = vp;
 5076|  16.1k|        } else {
 5077|  16.1k|            vplast->next_variable = vp;
 5078|  16.1k|        }
 5079|  16.6k|        vplast = vp;
 5080|  16.6k|        vp = NULL;
 5081|  16.6k|    }
 5082|    142|    return 0;
 5083|       |
 5084|    699|  fail:
 5085|    699|    {
 5086|    699|        const char *errstr = snmp_api_errstring(SNMPERR_SUCCESS);
  ------------------
  |  |  184|    699|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  ------------------
 5087|    699|        DEBUGMSGTL(("recv", "error while parsing VarBindList:%s\n", errstr));
  ------------------
  |  |   66|    699|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    699|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 699]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #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: 699]
  |  |  ------------------
  ------------------
 5088|    699|    }
 5089|       |    /** if we were parsing a var, remove it from the pdu and free it */
 5090|    699|    if (vp)
  ------------------
  |  Branch (5090:9): [True: 582, False: 117]
  ------------------
 5091|    582|        snmp_free_var(vp);
 5092|       |
 5093|    699|    return -1;
 5094|    724|}
snmp_free_var_internals:
 5710|  17.2k|{
 5711|  17.2k|    if (!var)
  ------------------
  |  Branch (5711:9): [True: 0, False: 17.2k]
  ------------------
 5712|      0|        return;
 5713|       |
 5714|  17.2k|    if (var->name != var->name_loc)
  ------------------
  |  Branch (5714:9): [True: 376, False: 16.8k]
  ------------------
 5715|    376|        SNMP_FREE(var->name);
  ------------------
  |  |   62|    376|#define SNMP_FREE(s)    do { if (s) { free(s); s=NULL; } } while(0)
  |  |  ------------------
  |  |  |  Branch (62:34): [True: 0, False: 376]
  |  |  |  Branch (62:66): [Folded, False: 376]
  |  |  ------------------
  ------------------
 5716|  17.2k|    if (var->val.string != var->buf)
  ------------------
  |  Branch (5716:9): [True: 4.51k, False: 12.7k]
  ------------------
 5717|  4.51k|        SNMP_FREE(var->val.string);
  ------------------
  |  |   62|  4.51k|#define SNMP_FREE(s)    do { if (s) { free(s); s=NULL; } } while(0)
  |  |  ------------------
  |  |  |  Branch (62:34): [True: 2.27k, False: 2.24k]
  |  |  |  Branch (62:66): [Folded, False: 4.51k]
  |  |  ------------------
  ------------------
 5718|  17.2k|    if (var->data) {
  ------------------
  |  Branch (5718:9): [True: 0, False: 17.2k]
  ------------------
 5719|      0|        if (var->dataFreeHook) {
  ------------------
  |  Branch (5719:13): [True: 0, False: 0]
  ------------------
 5720|      0|            var->dataFreeHook(var->data);
 5721|      0|            var->data = NULL;
 5722|      0|        } else {
 5723|       |            SNMP_FREE(var->data);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 5724|      0|        }
 5725|      0|    }
 5726|  17.2k|}
snmp_free_var:
 5730|  17.2k|{
 5731|  17.2k|    snmp_free_var_internals(var);
 5732|  17.2k|    free(var);
 5733|  17.2k|}
snmp_free_varbind:
 5737|  6.13k|{
 5738|  6.13k|    netsnmp_variable_list *ptr;
 5739|  22.8k|    while (var) {
  ------------------
  |  Branch (5739:12): [True: 16.6k, False: 6.13k]
  ------------------
 5740|  16.6k|        ptr = var->next_variable;
 5741|  16.6k|        snmp_free_var(var);
 5742|  16.6k|        var = ptr;
 5743|  16.6k|    }
 5744|  6.13k|}
snmp_free_pdu:
 5751|  5.40k|{
 5752|  5.40k|    struct snmp_secmod_def *sptr;
 5753|       |
 5754|  5.40k|    if (!pdu)
  ------------------
  |  Branch (5754:9): [True: 0, False: 5.40k]
  ------------------
 5755|      0|        return;
 5756|       |
 5757|  5.40k|    free_securityStateRef(pdu);
 5758|       |
 5759|  5.40k|    sptr = find_sec_mod(pdu->securityModel);
 5760|  5.40k|    if (sptr && sptr->pdu_free)
  ------------------
  |  Branch (5760:9): [True: 0, False: 5.40k]
  |  Branch (5760:17): [True: 0, False: 0]
  ------------------
 5761|      0|        (*sptr->pdu_free)(pdu);
 5762|       |
 5763|  5.40k|    snmp_free_varbind(pdu->variables);
 5764|  5.40k|    free(pdu->enterprise);
 5765|  5.40k|    free(pdu->community);
 5766|  5.40k|    free(pdu->contextEngineID);
 5767|  5.40k|    free(pdu->securityEngineID);
 5768|  5.40k|    free(pdu->contextName);
 5769|  5.40k|    free(pdu->securityName);
 5770|  5.40k|    free(pdu->transport_data);
 5771|  5.40k|    free(pdu);
 5772|  5.40k|}
snmp_increment_statistic:
 8415|  3.98k|{
 8416|  3.98k|    if (which >= 0 && which < NETSNMP_STAT_MAX_STATS) {
  ------------------
  |  |  710|  3.98k|#define  NETSNMP_STAT_MAX_STATS              (STAT_TLSTM_STATS_END+1)
  |  |  ------------------
  |  |  |  |  706|  3.98k|#define  STAT_TLSTM_STATS_END          STAT_TLSTM_SNMPTLSTMSESSIONINVALIDCACHES
  |  |  |  |  ------------------
  |  |  |  |  |  |  703|  3.98k|#define  STAT_TLSTM_SNMPTLSTMSESSIONINVALIDCACHES              56
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8416:9): [True: 3.98k, False: 0]
  |  Branch (8416:23): [True: 3.98k, False: 0]
  ------------------
 8417|  3.98k|        statistics[which]++;
 8418|  3.98k|        return statistics[which];
 8419|  3.98k|    }
 8420|      0|    return 0;
 8421|  3.98k|}
snmp_api.c:free_securityStateRef:
 4241|  5.40k|{
 4242|  5.40k|    struct snmp_secmod_def *sptr;
 4243|       |
 4244|  5.40k|    if (!pdu->securityStateRef)
  ------------------
  |  Branch (4244:9): [True: 5.40k, False: 0]
  ------------------
 4245|  5.40k|        return;
 4246|       |
 4247|      0|    sptr = find_sec_mod(pdu->securityModel);
 4248|      0|    if (sptr) {
  ------------------
  |  Branch (4248:9): [True: 0, False: 0]
  ------------------
 4249|      0|        if (sptr->pdu_free_state_ref) {
  ------------------
  |  Branch (4249:13): [True: 0, False: 0]
  ------------------
 4250|      0|            (*sptr->pdu_free_state_ref) (pdu->securityStateRef);
 4251|      0|        } else {
 4252|      0|            snmp_log(LOG_ERR,
 4253|      0|                     "Security Model %d can't free state references\n",
 4254|      0|                     pdu->securityModel);
 4255|      0|	}
 4256|      0|    } else {
 4257|      0|	snmp_log(LOG_ERR,
 4258|      0|		 "Can't find security model to free ptr: %d\n",
 4259|      0|		 pdu->securityModel);
 4260|      0|    }
 4261|       |    pdu->securityStateRef = NULL;
 4262|      0|}
snmp_api.c:_snmp_parse:
 4470|  2.70k|{
 4471|  2.70k|#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
 4472|  2.70k|    u_char          community[COMMUNITY_MAX_LEN];
 4473|  2.70k|    size_t          community_length = COMMUNITY_MAX_LEN;
  ------------------
  |  |   41|  2.70k|#define COMMUNITY_MAX_LEN	256
  ------------------
 4474|  2.70k|#endif
 4475|  2.70k|    int             result = -1;
 4476|       |
 4477|  2.70k|    static const oid snmpEngineIDoid[]   = { 1,3,6,1,6,3,10,2,1,1,0};
 4478|  2.70k|    static size_t   snmpEngineIDoid_len = 11;
 4479|       |
 4480|  2.70k|    static char     ourEngineID[SNMP_SEC_PARAM_BUF_SIZE];
 4481|  2.70k|    static size_t   ourEngineID_len = sizeof(ourEngineID);
 4482|       |
 4483|  2.70k|    netsnmp_pdu    *pdu2 = NULL;
 4484|       |
 4485|  2.70k|    session->s_snmp_errno = 0;
 4486|  2.70k|    session->s_errno = 0;
 4487|       |
 4488|       |    /*
 4489|       |     * Ensure all incoming PDUs have a unique means of identification 
 4490|       |     * (This is not restricted to AgentX handling,
 4491|       |     * though that is where the need becomes visible)   
 4492|       |     */
 4493|  2.70k|    pdu->transid = snmp_get_next_transid();
 4494|       |
 4495|  2.70k|    if (session->version != SNMP_DEFAULT_VERSION) {
  ------------------
  |  |   90|  2.70k|#define SNMP_DEFAULT_VERSION	    -1
  ------------------
  |  Branch (4495:9): [True: 2.70k, False: 0]
  ------------------
 4496|  2.70k|        pdu->version = session->version;
 4497|  2.70k|    } else {
 4498|      0|        pdu->version = snmp_parse_version(data, length);
 4499|      0|    }
 4500|       |
 4501|  2.70k|    switch (pdu->version) {
 4502|      0|#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
 4503|      0|#ifndef NETSNMP_DISABLE_SNMPV1
 4504|  2.70k|    case SNMP_VERSION_1:
  ------------------
  |  |  107|  2.70k|#define SNMP_VERSION_1	   0
  ------------------
  |  Branch (4504:5): [True: 2.70k, False: 0]
  ------------------
 4505|  2.70k|#endif
 4506|  2.70k|#ifndef NETSNMP_DISABLE_SNMPV2C
 4507|  2.70k|    case SNMP_VERSION_2c:
  ------------------
  |  |  110|  2.70k|#define SNMP_VERSION_2c    1
  ------------------
  |  Branch (4507:5): [True: 0, False: 2.70k]
  ------------------
 4508|  2.70k|#endif
 4509|  2.70k|        NETSNMP_RUNTIME_PROTOCOL_CHECK_V1V2(pdu->version,unsupported_version);
  ------------------
  |  |  220|  2.70k|#define NETSNMP_RUNTIME_PROTOCOL_CHECK_V1V2(pc_ver, pc_target) do {    \
  |  |  221|  2.70k|        if (NETSNMP_RUNTIME_PROTOCOL_SKIP_V1(pc_ver) ||                \
  |  |  ------------------
  |  |  |  |  205|  5.40k|    ((pc_ver) == SNMP_VERSION_1 &&                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|  5.40k|#define SNMP_VERSION_1	   0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (205:6): [True: 2.70k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  206|  5.40k|     netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|  2.70k|#define NETSNMP_DS_LIBRARY_ID     0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (206:6): [True: 0, False: 2.70k]
  |  |  |  |  ------------------
  |  |  |  |  207|  2.70k|                            NETSNMP_DS_LIB_DISABLE_V1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  2.70k|#define NETSNMP_DS_LIB_DISABLE_V1          43 /* disable SNMPv1 */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  222|  2.70k|            NETSNMP_RUNTIME_PROTOCOL_SKIP_V2(pc_ver)) {                \
  |  |  ------------------
  |  |  |  |  215|  2.70k|    ((pc_ver) == SNMP_VERSION_2c &&                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  5.40k|#define SNMP_VERSION_2c    1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (215:6): [True: 0, False: 2.70k]
  |  |  |  |  ------------------
  |  |  |  |  216|  2.70k|     netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,                      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|      0|#define NETSNMP_DS_LIBRARY_ID     0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (216:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  217|      0|                            NETSNMP_DS_LIB_DISABLE_V2c))
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|      0|#define NETSNMP_DS_LIB_DISABLE_V2c         44 /* disable SNMPv2c */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  223|      0|            DEBUGMSGTL(("snmp:protocol:disabled", "enforced\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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  224|      0|            goto pc_target;                                            \
  |  |  225|      0|        }                                                              \
  |  |  226|  2.70k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (226:13): [Folded, False: 2.70k]
  |  |  ------------------
  ------------------
 4510|  2.70k|        DEBUGMSGTL(("snmp_api", "Parsing SNMPv%ld message...\n",
  ------------------
  |  |   66|  2.70k|#define DEBUGMSGTL(x)      do {if (_DBG_IF_) {__DBGMSGTL(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.70k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #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: 2.70k]
  |  |  ------------------
  ------------------
 4511|  2.70k|                    (1 + pdu->version)));
 4512|       |
 4513|       |        /*
 4514|       |         * authenticates message and returns length if valid 
 4515|       |         */
 4516|  2.70k|#ifndef NETSNMP_DISABLE_SNMPV1
 4517|  2.70k|        if (pdu->version == SNMP_VERSION_1) {
  ------------------
  |  |  107|  2.70k|#define SNMP_VERSION_1	   0
  ------------------
  |  Branch (4517:13): [True: 2.70k, False: 0]
  ------------------
 4518|  2.70k|            DEBUGDUMPSECTION("recv", "SNMPv1 message\n");
  ------------------
  |  |   81|  2.70k|	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.70k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  191|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  192|      0|        debugmsg("dumph_" token,"%s\n",x);\
  |  |  |  |  193|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (81:56): [Folded, False: 2.70k]
  |  |  ------------------
  ------------------
 4519|  2.70k|        } else {
 4520|      0|#endif
 4521|      0|            DEBUGDUMPSECTION("recv", "SNMPv2c message\n");
  ------------------
  |  |   81|      0|	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|      0|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  191|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  192|      0|        debugmsg("dumph_" token,"%s\n",x);\
  |  |  |  |  193|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (81:56): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4522|      0|#ifndef NETSNMP_DISABLE_SNMPV1
 4523|      0|        }
 4524|  2.70k|#endif
 4525|  2.70k|        data = snmp_comstr_parse(data, &length,
 4526|  2.70k|                                 community, &community_length,
 4527|  2.70k|                                 &pdu->version);
 4528|  2.70k|        if (data == NULL)
  ------------------
  |  Branch (4528:13): [True: 1.19k, False: 1.50k]
  ------------------
 4529|  1.19k|            return -1;
 4530|       |
 4531|  1.50k|        if (pdu->version != session->version &&
  ------------------
  |  Branch (4531:13): [True: 90, False: 1.41k]
  ------------------
 4532|     90|            session->version != SNMP_DEFAULT_VERSION) {
  ------------------
  |  |   90|     90|#define SNMP_DEFAULT_VERSION	    -1
  ------------------
  |  Branch (4532:13): [True: 90, False: 0]
  ------------------
 4533|     90|            session->s_snmp_errno = SNMPERR_BAD_VERSION;
  ------------------
  |  |  198|     90|#define SNMPERR_BAD_VERSION		(-14)
  ------------------
 4534|     90|            return -1;
 4535|     90|        }
 4536|       |
 4537|       |        /*
 4538|       |         * maybe get the community string. 
 4539|       |         */
 4540|  1.41k|        pdu->securityLevel = SNMP_SEC_LEVEL_NOAUTH;
  ------------------
  |  |  299|  1.41k|#define SNMP_SEC_LEVEL_NOAUTH		1
  ------------------
 4541|  1.41k|        pdu->securityModel = 
 4542|  1.41k|#ifndef NETSNMP_DISABLE_SNMPV1
 4543|  1.41k|            (pdu->version == SNMP_VERSION_1) ? SNMP_SEC_MODEL_SNMPv1 : 
  ------------------
  |  |  107|  1.41k|#define SNMP_VERSION_1	   0
  ------------------
                          (pdu->version == SNMP_VERSION_1) ? SNMP_SEC_MODEL_SNMPv1 : 
  ------------------
  |  |  293|  1.41k|#define SNMP_SEC_MODEL_SNMPv1		1
  ------------------
  |  Branch (4543:13): [True: 1.41k, False: 0]
  ------------------
 4544|  1.41k|#endif
 4545|  1.41k|                                               SNMP_SEC_MODEL_SNMPv2c;
  ------------------
  |  |  294|  1.41k|#define SNMP_SEC_MODEL_SNMPv2c		2
  ------------------
 4546|  1.41k|        SNMP_FREE(pdu->community);
  ------------------
  |  |   62|  1.41k|#define SNMP_FREE(s)    do { if (s) { free(s); s=NULL; } } while(0)
  |  |  ------------------
  |  |  |  Branch (62:34): [True: 0, False: 1.41k]
  |  |  |  Branch (62:66): [Folded, False: 1.41k]
  |  |  ------------------
  ------------------
 4547|  1.41k|        pdu->community_len = 0;
 4548|  1.41k|        pdu->community = (u_char *) 0;
 4549|  1.41k|        if (community_length) {
  ------------------
  |  Branch (4549:13): [True: 45, False: 1.37k]
  ------------------
 4550|     45|            pdu->community_len = community_length;
 4551|     45|            pdu->community = netsnmp_memdup(community, community_length);
 4552|     45|            if (pdu->community == NULL) {
  ------------------
  |  Branch (4552:17): [True: 0, False: 45]
  ------------------
 4553|      0|                session->s_snmp_errno = SNMPERR_MALLOC;
  ------------------
  |  |  246|      0|#define SNMPERR_MALLOC			(-62)
  ------------------
 4554|      0|                return -1;
 4555|      0|            }
 4556|     45|        }
 4557|  1.41k|        if (session->authenticator) {
  ------------------
  |  Branch (4557:13): [True: 0, False: 1.41k]
  ------------------
 4558|      0|            data = session->authenticator(data, &length,
 4559|      0|                                          community, community_length);
 4560|      0|            if (data == NULL) {
  ------------------
  |  Branch (4560:17): [True: 0, False: 0]
  ------------------
 4561|      0|                session->s_snmp_errno = SNMPERR_AUTHENTICATION_FAILURE;
  ------------------
  |  |  219|      0|#define SNMPERR_AUTHENTICATION_FAILURE 	(-35)
  ------------------
 4562|      0|                return -1;
 4563|      0|            }
 4564|      0|        }
 4565|       |
 4566|  1.41k|        DEBUGDUMPSECTION("recv", "PDU");
  ------------------
  |  |   81|  1.41k|	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  1.41k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPSECTION(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  191|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  192|      0|        debugmsg("dumph_" token,"%s\n",x);\
  |  |  |  |  193|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (81:56): [Folded, False: 1.41k]
  |  |  ------------------
  ------------------
 4567|  1.41k|        result = snmp_pdu_parse(pdu, data, &length);
 4568|  1.41k|        if (result < 0) {
  ------------------
  |  Branch (4568:13): [True: 1.27k, False: 142]
  ------------------
 4569|       |            /*
 4570|       |             * This indicates a parse error.  
 4571|       |             */
 4572|  1.27k|            snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|  1.27k|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 4573|  1.27k|        }
 4574|  1.41k|        DEBUGINDENTADD(-6);
  ------------------
  |  |   73|  1.41k|#define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  1.41k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTADD(x)  do {if (_DBG_IF_) {__DBGINDENTADD(x);} }while(0)
  |  |  ------------------
  |  |  |  |  172|      0|#define __DBGINDENTADD(x)  debug_indent_add(x)
  |  |  ------------------
  |  |  |  Branch (73:74): [Folded, False: 1.41k]
  |  |  ------------------
  ------------------
 4575|  1.41k|        break;
 4576|      0|#endif /* support for community based SNMP */
 4577|       |
 4578|      0|    case SNMP_VERSION_3:
  ------------------
  |  |  113|      0|#define SNMP_VERSION_3     3
  ------------------
  |  Branch (4578:5): [True: 0, False: 2.70k]
  ------------------
 4579|      0|        NETSNMP_RUNTIME_PROTOCOL_CHECK_V3(SNMP_VERSION_3,unsupported_version);
  ------------------
  |  |  233|      0|#define NETSNMP_RUNTIME_PROTOCOL_CHECK_V3(pc_ver, pc_target) do {      \
  |  |  234|      0|        if (NETSNMP_RUNTIME_PROTOCOL_SKIP_V3(pc_ver)) {                \
  |  |  ------------------
  |  |  |  |  229|      0|    ((pc_ver == SNMP_VERSION_3) &&                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|      0|#define SNMP_VERSION_3     3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (229:6): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |  230|      0|     netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|      0|#define NETSNMP_DS_LIBRARY_ID     0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (230:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  231|      0|                            NETSNMP_DS_LIB_DISABLE_V3))
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|      0|#define NETSNMP_DS_LIB_DISABLE_V3          45 /* disable SNMPv3 */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  235|      0|            DEBUGMSGTL(("snmp:protocol:disabled", "enforced\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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  236|      0|            goto pc_target;                                            \
  |  |  237|      0|        }                                                              \
  |  |  238|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (238:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4580|      0|        result = snmpv3_parse(pdu, data, &length, NULL, session);
 4581|      0|        DEBUGMSGTL(("snmp_parse",
  ------------------
  |  |   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 (164:52): [True: 0, False: 0]
  |  |  |  |  |  Branch (164:52): [True: 0, False: 0]
  |  |  |  |  |  Branch (164:64): [True: 0, False: 0]
  |  |  |  |  |  Branch (164:64): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (66:70): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4582|      0|                    "Parsed SNMPv3 message (secName:%s, secLevel:%s): %s\n",
 4583|      0|                    pdu->securityName,
 4584|      0|                    (pdu->securityLevel >= 0 && pdu->securityLevel < 4) ?
 4585|      0|                    secLevelName[pdu->securityLevel] : "ERROR: invalid",
 4586|      0|                    snmp_api_errstring(result)));
 4587|       |
 4588|      0|        if (result == SNMPERR_USM_UNKNOWNSECURITYNAME) {
  ------------------
  |  |  227|      0|#define SNMPERR_USM_UNKNOWNSECURITYNAME		(-43)
  ------------------
  |  Branch (4588:13): [True: 0, False: 0]
  ------------------
 4589|      0|            snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
  ------------------
  |  |   19|      0|#define SNMP_CALLBACK_APPLICATION 1
  ------------------
 4590|      0|                                SNMPD_CALLBACK_AUTH_FAILURE, pdu);
  ------------------
  |  |   21|      0|#define SNMPD_CALLBACK_AUTH_FAILURE             17
  ------------------
 4591|      0|        }
 4592|       |        
 4593|      0|        if (result) {
  ------------------
  |  Branch (4593:13): [True: 0, False: 0]
  ------------------
 4594|      0|            struct snmp_secmod_def *secmod =
 4595|      0|                find_sec_mod(pdu->securityModel);
 4596|      0|            if (!slp) {
  ------------------
  |  Branch (4596:17): [True: 0, False: 0]
  ------------------
 4597|      0|                session->s_snmp_errno = result;
 4598|      0|            } else {
 4599|       |                /*
 4600|       |                 * Call the security model to special handle any errors
 4601|       |                 */
 4602|       |
 4603|      0|                if (secmod && secmod->handle_report) {
  ------------------
  |  Branch (4603:21): [True: 0, False: 0]
  |  Branch (4603:31): [True: 0, False: 0]
  ------------------
 4604|      0|                    (*secmod->handle_report)(slp, slp->transport, session,
 4605|      0|                                             result, pdu);
 4606|      0|                }
 4607|      0|            }
 4608|      0|            free_securityStateRef(pdu);
 4609|      0|        }
 4610|       |
 4611|       |        /* Implement RFC5343 here for two reasons:
 4612|       |           1) From a security perspective it handles this otherwise
 4613|       |              always approved request earlier.  It bypasses the need
 4614|       |              for authorization to the snmpEngineID scalar, which is
 4615|       |              what is what RFC3415 appendix A species as ok.  Note
 4616|       |              that we haven't bypassed authentication since if there
 4617|       |              was an authentication error it would have been handled
 4618|       |              above in the if(result) part at the latest.
 4619|       |           2) From an application point of view if we let this request
 4620|       |              get all the way to the application, it'd require that
 4621|       |              all application types supporting discovery also fire up
 4622|       |              a minimal agent in order to handle just this request
 4623|       |              which seems like overkill.  Though there is no other
 4624|       |              application types that currently need discovery (NRs
 4625|       |              accept notifications from contextEngineIDs that derive
 4626|       |              from the NO not the NR).  Also a lame excuse for doing
 4627|       |              it here.
 4628|       |           3) Less important technically, but the net-snmp agent
 4629|       |              doesn't currently handle registrations of different
 4630|       |              engineIDs either and it would have been a lot more work
 4631|       |              to implement there since we'd need to support that
 4632|       |              first. :-/ Supporting multiple context engineIDs should
 4633|       |              be done anyway, so it's not a valid excuse here.
 4634|       |           4) There is a lot less to do if we trump the agent at this
 4635|       |              point; IE, the agent does a lot more unnecessary
 4636|       |              processing when the only thing that should ever be in
 4637|       |              this context by definition is the single scalar.
 4638|       |        */
 4639|       |
 4640|       |        /* special RFC5343 engineID discovery engineID check */
 4641|      0|        if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
  ------------------
  |  |   48|      0|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
  |  Branch (4641:13): [True: 0, False: 0]
  ------------------
 4642|      0|                                    NETSNMP_DS_LIB_NO_DISCOVERY) &&
  ------------------
  |  |   98|      0|#define NETSNMP_DS_LIB_NO_DISCOVERY        38 /* don't support RFC5343 contextEngineID discovery */
  ------------------
 4643|      0|            SNMP_MSG_RESPONSE       != pdu->command &&
  ------------------
  |  |  127|      0|#define SNMP_MSG_RESPONSE   (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2) /* a2=162 */
  |  |  ------------------
  |  |  |  |   92|      0|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_MSG_RESPONSE   (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2) /* a2=162 */
  |  |  ------------------
  |  |  |  |   96|      0|#define ASN_CONSTRUCTOR	    0x20U
  |  |  ------------------
  ------------------
  |  Branch (4643:13): [True: 0, False: 0]
  ------------------
 4644|      0|            NULL                    != pdu->contextEngineID &&
  ------------------
  |  Branch (4644:13): [True: 0, False: 0]
  ------------------
 4645|      0|            pdu->contextEngineIDLen == 5 &&
  ------------------
  |  Branch (4645:13): [True: 0, False: 0]
  ------------------
 4646|      0|            pdu->contextEngineID[0] == 0x80 &&
  ------------------
  |  Branch (4646:13): [True: 0, False: 0]
  ------------------
 4647|      0|            pdu->contextEngineID[1] == 0x00 &&
  ------------------
  |  Branch (4647:13): [True: 0, False: 0]
  ------------------
 4648|      0|            pdu->contextEngineID[2] == 0x00 &&
  ------------------
  |  Branch (4648:13): [True: 0, False: 0]
  ------------------
 4649|      0|            pdu->contextEngineID[3] == 0x00 &&
  ------------------
  |  Branch (4649:13): [True: 0, False: 0]
  ------------------
 4650|      0|            pdu->contextEngineID[4] == 0x06) {
  ------------------
  |  Branch (4650:13): [True: 0, False: 0]
  ------------------
 4651|       |
 4652|       |            /* define a result so it doesn't get past us at this point
 4653|       |               and gets dropped by future parts of the stack */
 4654|      0|            result = SNMPERR_JUST_A_CONTEXT_PROBE;
  ------------------
  |  |  250|      0|#define SNMPERR_JUST_A_CONTEXT_PROBE    (-66)
  ------------------
 4655|       |
 4656|      0|            DEBUGMSGTL(("snmpv3_contextid", "starting context ID discovery\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]
  |  |  ------------------
  ------------------
 4657|       |            /* ensure exactly one variable */
 4658|      0|            if (NULL != pdu->variables &&
  ------------------
  |  Branch (4658:17): [True: 0, False: 0]
  ------------------
 4659|      0|                NULL == pdu->variables->next_variable &&
  ------------------
  |  Branch (4659:17): [True: 0, False: 0]
  ------------------
 4660|       |
 4661|       |                /* if it's a GET, match it exactly */
 4662|      0|                ((SNMP_MSG_GET == pdu->command &&
  ------------------
  |  |  125|      0|#define SNMP_MSG_GET        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0) /* a0=160 */
  |  |  ------------------
  |  |  |  |   92|      0|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_MSG_GET        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0) /* a0=160 */
  |  |  ------------------
  |  |  |  |   96|      0|#define ASN_CONSTRUCTOR	    0x20U
  |  |  ------------------
  ------------------
  |  Branch (4662:19): [True: 0, False: 0]
  ------------------
 4663|      0|                  snmp_oid_compare(snmpEngineIDoid,
  ------------------
  |  Branch (4663:19): [True: 0, False: 0]
  ------------------
 4664|      0|                                   snmpEngineIDoid_len,
 4665|      0|                                   pdu->variables->name,
 4666|      0|                                   pdu->variables->name_length) == 0)
 4667|       |                 /* if it's a GETNEXT ensure it's less than the engineID oid */
 4668|      0|                 ||
 4669|      0|                 (SNMP_MSG_GETNEXT == pdu->command &&
  ------------------
  |  |  126|      0|#define SNMP_MSG_GETNEXT    (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1) /* a1=161 */
  |  |  ------------------
  |  |  |  |   92|      0|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_MSG_GETNEXT    (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1) /* a1=161 */
  |  |  ------------------
  |  |  |  |   96|      0|#define ASN_CONSTRUCTOR	    0x20U
  |  |  ------------------
  ------------------
  |  Branch (4669:19): [True: 0, False: 0]
  ------------------
 4670|      0|                  snmp_oid_compare(snmpEngineIDoid,
  ------------------
  |  Branch (4670:19): [True: 0, False: 0]
  ------------------
 4671|      0|                                   snmpEngineIDoid_len,
 4672|      0|                                   pdu->variables->name,
 4673|      0|                                   pdu->variables->name_length) > 0)
 4674|      0|                    )) {
 4675|       |
 4676|      0|                DEBUGMSGTL(("snmpv3_contextid",
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 4677|      0|                            "  One correct variable found\n"));
 4678|       |
 4679|       |                /* Note: we're explicitly not handling a GETBULK.  Deal. */
 4680|       |
 4681|       |                /* set up the response */
 4682|      0|                pdu2 = snmp_clone_pdu(pdu);
 4683|      0|                if (NULL == pdu2) {
  ------------------
  |  Branch (4683:21): [True: 0, False: 0]
  ------------------
 4684|      0|                    snmp_log(LOG_ERR, "failed to clone PDU for rfc5343 probe\n");
 4685|      0|                    if (pdu->securityStateRef)
  ------------------
  |  Branch (4685:25): [True: 0, False: 0]
  ------------------
 4686|      0|                        free_securityStateRef(pdu);
 4687|      0|                    return result;
 4688|      0|                }
 4689|       |
 4690|       |                /* free the current varbind */
 4691|      0|                snmp_free_varbind(pdu2->variables);
 4692|       |
 4693|       |                /* set the variables */
 4694|      0|                pdu2->variables = NULL;
 4695|      0|                pdu2->command = SNMP_MSG_RESPONSE;
  ------------------
  |  |  127|      0|#define SNMP_MSG_RESPONSE   (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2) /* a2=162 */
  |  |  ------------------
  |  |  |  |   92|      0|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define SNMP_MSG_RESPONSE   (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2) /* a2=162 */
  |  |  ------------------
  |  |  |  |   96|      0|#define ASN_CONSTRUCTOR	    0x20U
  |  |  ------------------
  ------------------
 4696|      0|                pdu2->errstat = 0;
 4697|      0|                pdu2->errindex = 0;
 4698|       |
 4699|      0|                ourEngineID_len =
 4700|      0|                    snmpv3_get_engineID((u_char*)ourEngineID, ourEngineID_len);
 4701|      0|                if (0 != ourEngineID_len) {
  ------------------
  |  Branch (4701:21): [True: 0, False: 0]
  ------------------
 4702|       |
 4703|      0|                    DEBUGMSGTL(("snmpv3_contextid",
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 4704|      0|                                "  responding with our engineID\n"));
 4705|       |
 4706|      0|                    snmp_pdu_add_variable(pdu2,
 4707|      0|                                          snmpEngineIDoid, snmpEngineIDoid_len,
 4708|      0|                                          ASN_OCTET_STR,
  ------------------
  |  |   78|      0|#define ASN_OCTET_STR	    0x04U
  ------------------
 4709|      0|                                          ourEngineID, ourEngineID_len);
 4710|       |                    
 4711|       |                    /* send the response */
 4712|      0|                    if (0 == snmp_sess_send(slp, pdu2)) {
  ------------------
  |  Branch (4712:25): [True: 0, False: 0]
  ------------------
 4713|       |
 4714|      0|                        DEBUGMSGTL(("snmpv3_contextid",
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 4715|      0|                                    "  sent it off!\n"));
 4716|       |
 4717|      0|                        snmp_free_pdu(pdu2);
 4718|       |                        
 4719|      0|                        snmp_log(LOG_ERR, "sending a response to the context engineID probe failed\n");
 4720|      0|                    }
 4721|      0|                } else {
 4722|      0|                    snmp_log(LOG_ERR, "failed to get our own engineID!\n");
 4723|      0|                    snmp_free_pdu(pdu2);
 4724|      0|                }
 4725|      0|            } else {
 4726|      0|                snmp_log(LOG_WARNING,
 4727|      0|                         "received an odd context engineID probe\n");
 4728|      0|            }
 4729|      0|            if (pdu->securityStateRef)
  ------------------
  |  Branch (4729:17): [True: 0, False: 0]
  ------------------
 4730|      0|                free_securityStateRef(pdu);
 4731|      0|        }
 4732|       |
 4733|      0|        break;
 4734|      0|    case SNMPERR_BAD_VERSION:
  ------------------
  |  |  198|      0|#define SNMPERR_BAD_VERSION		(-14)
  ------------------
  |  Branch (4734:5): [True: 0, False: 2.70k]
  ------------------
 4735|      0|        ERROR_MSG("error parsing snmp message version");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 4736|      0|        snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|      0|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 4737|      0|        session->s_snmp_errno = SNMPERR_BAD_VERSION;
  ------------------
  |  |  198|      0|#define SNMPERR_BAD_VERSION		(-14)
  ------------------
 4738|      0|        break;
 4739|       |
 4740|      0|        unsupported_version:  /* goto label */
 4741|      0|    case SNMP_VERSION_sec:
  ------------------
  |  |  118|      0|#define SNMP_VERSION_sec   128  /* not (will never be) supported by this code */
  ------------------
  |  Branch (4741:5): [True: 0, False: 2.70k]
  ------------------
 4742|      0|    case SNMP_VERSION_2u:
  ------------------
  |  |  112|      0|#define SNMP_VERSION_2u    2    /* not (will never be) supported by this code */
  ------------------
  |  Branch (4742:5): [True: 0, False: 2.70k]
  ------------------
 4743|      0|    case SNMP_VERSION_2star:
  ------------------
  |  |  120|      0|#define SNMP_VERSION_2star 130  /* not (will never be) supported by this code */
  ------------------
  |  Branch (4743:5): [True: 0, False: 2.70k]
  ------------------
 4744|      0|    case SNMP_VERSION_2p:
  ------------------
  |  |  119|      0|#define SNMP_VERSION_2p	   129  /* no longer supported by this code (> 4.0) */
  ------------------
  |  Branch (4744:5): [True: 0, False: 2.70k]
  ------------------
 4745|      0|    default:
  ------------------
  |  Branch (4745:5): [True: 0, False: 2.70k]
  ------------------
 4746|      0|        ERROR_MSG("unsupported snmp message version");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 4747|      0|        snmp_increment_statistic(STAT_SNMPINBADVERSIONS);
  ------------------
  |  |  634|      0|#define  STAT_SNMPINBADVERSIONS              11
  ------------------
 4748|       |
 4749|       |        /*
 4750|       |         * need better way to determine OS independent
 4751|       |         * INT32_MAX value, for now hardcode
 4752|       |         */
 4753|      0|        if (pdu->version < 0 || pdu->version > 2147483647) {
  ------------------
  |  Branch (4753:13): [True: 0, False: 0]
  |  Branch (4753:33): [True: 0, False: 0]
  ------------------
 4754|      0|            snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
  ------------------
  |  |  637|      0|#define  STAT_SNMPINASNPARSEERRS             14
  ------------------
 4755|      0|        }
 4756|      0|        session->s_snmp_errno = SNMPERR_BAD_VERSION;
  ------------------
  |  |  198|      0|#define SNMPERR_BAD_VERSION		(-14)
  ------------------
 4757|      0|        break;
 4758|  2.70k|    }
 4759|       |
 4760|  1.41k|    return result;
 4761|  2.70k|}

snmp_comstr_parse:
  109|  2.70k|{
  110|  2.70k|    u_char          type;
  111|  2.70k|    long            ver;
  112|  2.70k|    size_t          origlen = *slen;
  113|       |
  114|       |    /*
  115|       |     * Message is an ASN.1 SEQUENCE.
  116|       |     */
  117|  2.70k|    data = asn_parse_sequence(data, length, &type,
  118|  2.70k|                              (ASN_SEQUENCE | ASN_CONSTRUCTOR),
  ------------------
  |  |   84|  2.70k|#define ASN_SEQUENCE	    0x10U
  ------------------
                                            (ASN_SEQUENCE | ASN_CONSTRUCTOR),
  ------------------
  |  |   96|  2.70k|#define ASN_CONSTRUCTOR	    0x20U
  ------------------
  119|  2.70k|                              "auth message");
  120|  2.70k|    if (data == NULL) {
  ------------------
  |  Branch (120:9): [True: 293, False: 2.41k]
  ------------------
  121|    293|        return NULL;
  122|    293|    }
  123|       |
  124|       |    /*
  125|       |     * First field is the version.
  126|       |     */
  127|  2.41k|    DEBUGDUMPHEADER("recv", "SNMP version");
  ------------------
  |  |   79|  2.41k|	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.41k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  178|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  179|      0|        debugmsg("dumph_" token,x); \
  |  |  |  |  180|      0|        if (debug_is_token_registered("dumpx" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  181|      0|            debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  182|      0|            (debug_is_token_registered("dumpx_" token) != SNMPERR_SUCCESS &&  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (182:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  183|      0|             debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (183:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  184|      0|            debugmsg("dumph_" token,"\n"); \
  |  |  |  |  185|      0|        } else { \
  |  |  |  |  186|      0|            debugmsg("dumph_" token,"  "); \
  |  |  |  |  187|      0|        } \
  |  |  |  |  188|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (79:55): [Folded, False: 2.41k]
  |  |  ------------------
  ------------------
  128|  2.41k|    data = asn_parse_int(data, length, &type, &ver, sizeof(ver));
  129|  2.41k|    DEBUGINDENTLESS();
  ------------------
  |  |   75|  2.41k|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.41k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 2.41k]
  |  |  ------------------
  ------------------
  130|  2.41k|    *version = ver;
  131|  2.41k|    if (data == NULL) {
  ------------------
  |  Branch (131:9): [True: 172, False: 2.23k]
  ------------------
  132|    172|        ERROR_MSG("bad parse of version");
  ------------------
  |  |  188|    172|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  133|    172|        return NULL;
  134|    172|    }
  135|       |
  136|       |    /*
  137|       |     * second field is the community string for SNMPv1 & SNMPv2c 
  138|       |     */
  139|  2.23k|    DEBUGDUMPHEADER("recv", "community string");
  ------------------
  |  |   79|  2.23k|	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.23k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  178|      0|        __DBGPRINTINDENT("dumph_" token); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  175|      0|#define __DBGPRINTINDENT(token) __DBGMSGTL((token, "%*s", __DBGINDENT(), ""))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  179|      0|        debugmsg("dumph_" token,x); \
  |  |  |  |  180|      0|        if (debug_is_token_registered("dumpx" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  181|      0|            debug_is_token_registered("dumpv" token) == SNMPERR_SUCCESS ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  182|      0|            (debug_is_token_registered("dumpx_" token) != SNMPERR_SUCCESS &&  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (182:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  183|      0|             debug_is_token_registered("dumpv_" token) != SNMPERR_SUCCESS)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|      0|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (183:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  184|      0|            debugmsg("dumph_" token,"\n"); \
  |  |  |  |  185|      0|        } else { \
  |  |  |  |  186|      0|            debugmsg("dumph_" token,"  "); \
  |  |  |  |  187|      0|        } \
  |  |  |  |  188|      0|        __DBGINDENTMORE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define __DBGINDENTMORE()  debug_indent_add(2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (79:55): [Folded, False: 2.23k]
  |  |  ------------------
  ------------------
  140|  2.23k|    data = asn_parse_string(data, length, &type, psid, slen);
  141|  2.23k|    DEBUGINDENTLESS();
  ------------------
  |  |   75|  2.23k|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.23k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 2.23k]
  |  |  ------------------
  ------------------
  142|  2.23k|    if (data == NULL) {
  ------------------
  |  Branch (142:9): [True: 733, False: 1.50k]
  ------------------
  143|    733|        ERROR_MSG("bad parse of community");
  ------------------
  |  |  188|    733|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  144|    733|        return NULL;
  145|    733|    }
  146|  1.50k|    psid[SNMP_MIN(*slen, origlen - 1)] = '\0';
  ------------------
  |  |  111|  1.50k|#define SNMP_MIN(a,b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (111:24): [True: 1, False: 1.50k]
  |  |  ------------------
  ------------------
  147|  1.50k|    return (u_char *) data;
  148|       |
  149|  2.23k|}                               /* end snmp_comstr_parse() */

snmp_set_var_objid:
  700|  16.8k|{
  701|  16.8k|    size_t          len = sizeof(oid) * name_length;
  702|       |
  703|  16.8k|    if (vp->name != vp->name_loc && vp->name != NULL) {
  ------------------
  |  Branch (703:9): [True: 16.8k, False: 0]
  |  Branch (703:37): [True: 0, False: 16.8k]
  ------------------
  704|       |        /*
  705|       |         * Probably previously-allocated "big storage".  Better free it
  706|       |         * else memory leaks possible.  
  707|       |         */
  708|      0|        free(vp->name);
  709|      0|    }
  710|       |
  711|       |    /*
  712|       |     * use built-in storage for smaller values 
  713|       |     */
  714|  16.8k|    if (len <= sizeof(vp->name_loc)) {
  ------------------
  |  Branch (714:9): [True: 16.8k, False: 0]
  ------------------
  715|  16.8k|        vp->name = vp->name_loc;
  716|  16.8k|    } else {
  717|      0|        vp->name = (oid *) malloc(len);
  718|      0|        if (!vp->name)
  ------------------
  |  Branch (718:13): [True: 0, False: 0]
  ------------------
  719|      0|            return 1;
  720|      0|    }
  721|  16.8k|    if (objid)
  ------------------
  |  Branch (721:9): [True: 16.8k, False: 0]
  ------------------
  722|  16.8k|        memmove(vp->name, objid, len);
  723|  16.8k|    vp->name_length = name_length;
  724|  16.8k|    return 0;
  725|  16.8k|}

snmp_get_do_debugging:
  551|   249k|{
  552|   249k|    return dodebug;
  553|   249k|}

se_add_pair_to_list:
  269|      2|{
  270|      2|    struct snmp_enum_list *lastnode = NULL, *new_node, *tmp;
  271|       |
  272|      2|    if (!list) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2]
  ------------------
  273|      0|        free(label);
  274|      0|        return SE_DNE;
  ------------------
  |  |   45|      0|#define SE_DNE           -2
  ------------------
  275|      0|    }
  276|       |
  277|      2|    tmp = *list;
  278|      2|    while (tmp) {
  ------------------
  |  Branch (278:12): [True: 0, False: 2]
  ------------------
  279|      0|        if (tmp->value == value) {
  ------------------
  |  Branch (279:13): [True: 0, False: 0]
  ------------------
  280|      0|            free(label);
  281|      0|            return (SE_ALREADY_THERE);
  ------------------
  |  |   44|      0|#define SE_ALREADY_THERE 2
  ------------------
  282|      0|        }
  283|      0|        lastnode = tmp;
  284|      0|        tmp = tmp->next;
  285|      0|    }
  286|       |
  287|      2|    new_node = SNMP_MALLOC_STRUCT(snmp_enum_list);
  ------------------
  |  |   69|      2|#define SNMP_MALLOC_STRUCT(s)   (struct s *) calloc(1, sizeof(struct s))
  ------------------
  288|      2|    if (!new_node) {
  ------------------
  |  Branch (288:9): [True: 0, False: 2]
  ------------------
  289|      0|        free(label);
  290|      0|        return (SE_NOMEM);
  ------------------
  |  |   43|      0|#define SE_NOMEM         1
  ------------------
  291|      0|    }
  292|       |
  293|      2|    if (lastnode)
  ------------------
  |  Branch (293:9): [True: 0, False: 2]
  ------------------
  294|      0|        lastnode->next = new_node;
  295|      2|    else
  296|      2|        *list = new_node;
  297|      2|    new_node->label = label;
  298|      2|    new_node->value = value;
  299|      2|    new_node->next = NULL;
  300|      2|    return (SE_OK);
  ------------------
  |  |   42|      2|#define SE_OK            0
  ------------------
  301|      2|}
se_add_pair_to_slist:
  365|      2|{
  366|      2|    struct snmp_enum_list **list_p = se_find_slist_ptr(listname);
  367|       |
  368|      2|    if (!list_p) {
  ------------------
  |  Branch (368:9): [True: 2, False: 0]
  ------------------
  369|      2|        struct snmp_enum_list_str *sptr =
  370|      2|            SNMP_MALLOC_STRUCT(snmp_enum_list_str);
  ------------------
  |  |   69|      2|#define SNMP_MALLOC_STRUCT(s)   (struct s *) calloc(1, sizeof(struct s))
  ------------------
  371|      2|        if (!sptr) {
  ------------------
  |  Branch (371:13): [True: 0, False: 2]
  ------------------
  372|      0|            free(label);
  373|      0|            return SE_NOMEM;
  ------------------
  |  |   43|      0|#define SE_NOMEM         1
  ------------------
  374|      0|        }
  375|      2|        sptr->next = sliststorage;
  376|      2|        sptr->name = strdup(listname);
  377|      2|        if (!sptr->name) {
  ------------------
  |  Branch (377:13): [True: 0, False: 2]
  ------------------
  378|      0|            free(sptr);
  379|      0|            free(label);
  380|      0|            return SE_NOMEM;
  ------------------
  |  |   43|      0|#define SE_NOMEM         1
  ------------------
  381|      0|        }
  382|      2|        list_p = &sptr->list;
  383|      2|        sliststorage = sptr;
  384|      2|    }
  385|       |
  386|      2|    return se_add_pair_to_list(list_p, label, value);
  387|      2|}
snmp_enum.c:se_find_slist_ptr:
  314|      2|{
  315|      2|    struct snmp_enum_list_str *sptr;
  316|      2|    if (!listname)
  ------------------
  |  Branch (316:9): [True: 0, False: 2]
  ------------------
  317|      0|        return NULL;
  318|       |
  319|      2|    for (sptr = sliststorage; sptr != NULL; sptr = sptr->next)
  ------------------
  |  Branch (319:31): [True: 0, False: 2]
  ------------------
  320|      0|        if (sptr->name && strcmp(sptr->name, listname) == 0)
  ------------------
  |  Branch (320:13): [True: 0, False: 0]
  |  Branch (320:27): [True: 0, False: 0]
  ------------------
  321|      0|            return &sptr->list;
  322|       |
  323|      2|    return NULL;
  324|      2|}

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|    186|{
 1104|    186|    static int      newline = 1;	 /* MTCRITICAL_RESOURCE */
 1105|    186|    const char     *newline_ptr;
 1106|    186|    char            sbuf[40];
 1107|       |
 1108|    186|    if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, 
  ------------------
  |  |   48|    186|#define NETSNMP_DS_LIBRARY_ID     0
  ------------------
  |  Branch (1108:9): [True: 0, False: 186]
  ------------------
 1109|    186|                               NETSNMP_DS_LIB_LOG_TIMESTAMP) && newline) {
  ------------------
  |  |   64|    186|#define NETSNMP_DS_LIB_LOG_TIMESTAMP       5
  ------------------
  |  Branch (1109:65): [True: 0, False: 0]
  ------------------
 1110|      0|        snprintf_stamp(NULL, sbuf, sizeof(sbuf));
 1111|    186|    } else {
 1112|    186|        strcpy(sbuf, "");
 1113|    186|    }
 1114|       |    /*
 1115|       |     * Remember whether or not the current line ends with a newline for the
 1116|       |     * next call of log_handler_stdouterr().
 1117|       |     */
 1118|    186|    newline_ptr = strrchr(str, '\n');
 1119|    186|    newline = newline_ptr && newline_ptr[1] == 0;
  ------------------
  |  Branch (1119:15): [True: 186, False: 0]
  |  Branch (1119:30): [True: 186, False: 0]
  ------------------
 1120|       |
 1121|    186|    if (logh->imagic)
  ------------------
  |  Branch (1121:9): [True: 0, False: 186]
  ------------------
 1122|      0|       printf(         "%s%s", sbuf, str);
 1123|    186|    else
 1124|    186|       fprintf(stderr, "%s%s", sbuf, str);
 1125|       |
 1126|    186|    return 1;
 1127|    186|}
snmp_log_string:
 1294|    186|{
 1295|    186|#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
 1296|    186|    static int stderr_enabled = 0;
 1297|    186|    static netsnmp_log_handler lh = { 1, 0, 0, 0, "stderr",
 1298|    186|                                      log_handler_stdouterr, 0, NULL,  NULL,
 1299|    186|                                      NULL };
 1300|    186|#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
 1301|    186|    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|    186|    if (0 == logh_enabled) {
  ------------------
  |  Branch (1307:9): [True: 186, False: 0]
  ------------------
 1308|    186|#ifndef NETSNMP_FEATURE_REMOVE_LOGGING_STDIO
 1309|    186|        if (!stderr_enabled) {
  ------------------
  |  Branch (1309:13): [True: 1, False: 185]
  ------------------
 1310|      1|            ++stderr_enabled;
 1311|      1|            netsnmp_set_line_buffering(stderr);
 1312|      1|        }
 1313|    186|        log_handler_stdouterr( &lh, priority, str );
 1314|    186|#endif /* NETSNMP_FEATURE_REMOVE_LOGGING_STDIO */
 1315|       |
 1316|    186|        return;
 1317|    186|    }
 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|    186|{
 1384|    186|    char           *buffer = NULL;
 1385|    186|    int             length;
 1386|       |
 1387|    186|    length = vasprintf(&buffer, format, ap);
 1388|    186|    if (length < 0) {
  ------------------
  |  Branch (1388:9): [True: 0, False: 186]
  ------------------
 1389|      0|        snmp_log_string(LOG_ERR, "Could not format log-string\n");
 1390|      0|        return -1;
 1391|      0|    }
 1392|       |
 1393|    186|    snmp_log_string(priority, buffer);
 1394|    186|    free(buffer);
 1395|    186|    return 0;
 1396|    186|}
snmp_log:
 1407|    186|{
 1408|    186|    va_list         ap;
 1409|    186|    int             ret;
 1410|    186|    va_start(ap, format);
 1411|    186|    ret = snmp_vlog(priority, format, ap);
 1412|       |    va_end(ap);
 1413|    186|    return (ret);
 1414|    186|}

register_sec_mod:
   70|      2|{
   71|      2|    int             result = 0;
   72|      2|    struct snmp_secmod_list *sptr;
   73|      2|    char           *othername, *modname2 = NULL;
   74|       |
   75|      2|    for (sptr = registered_services; sptr; sptr = sptr->next) {
  ------------------
  |  Branch (75:38): [True: 0, False: 2]
  ------------------
   76|      0|        if (sptr->securityModel == secmod) {
  ------------------
  |  Branch (76:13): [True: 0, False: 0]
  ------------------
   77|      0|            return SNMPERR_GENERR;
  ------------------
  |  |  185|      0|#define SNMPERR_GENERR			(-1)
  ------------------
   78|      0|        }
   79|      0|    }
   80|      2|    sptr = SNMP_MALLOC_STRUCT(snmp_secmod_list);
  ------------------
  |  |   69|      2|#define SNMP_MALLOC_STRUCT(s)   (struct s *) calloc(1, sizeof(struct s))
  ------------------
   81|      2|    if (sptr == NULL)
  ------------------
  |  Branch (81:9): [True: 0, False: 2]
  ------------------
   82|      0|        return SNMPERR_MALLOC;
  ------------------
  |  |  246|      0|#define SNMPERR_MALLOC			(-62)
  ------------------
   83|      2|    sptr->secDef = newdef;
   84|      2|    sptr->securityModel = secmod;
   85|      2|    sptr->next = registered_services;
   86|      2|    registered_services = sptr;
   87|      2|    modname2 = strdup(modname);
   88|      2|    if (!modname2)
  ------------------
  |  Branch (88:9): [True: 0, False: 2]
  ------------------
   89|      0|        result = SE_NOMEM;
  ------------------
  |  |   43|      0|#define SE_NOMEM         1
  ------------------
   90|      2|    else
   91|      2|        result = se_add_pair_to_slist("snmp_secmods", modname2, secmod);
   92|      2|    if (result != SE_OK) {
  ------------------
  |  |   42|      2|#define SE_OK            0
  ------------------
  |  Branch (92:9): [True: 0, False: 2]
  ------------------
   93|      0|        switch (result) {
   94|      0|        case SE_NOMEM:
  ------------------
  |  |   43|      0|#define SE_NOMEM         1
  ------------------
  |  Branch (94:9): [True: 0, False: 0]
  ------------------
   95|      0|            snmp_log(LOG_CRIT, "snmp_secmod: no memory\n");
   96|      0|            break;
   97|       |
   98|      0|        case SE_ALREADY_THERE:
  ------------------
  |  |   44|      0|#define SE_ALREADY_THERE 2
  ------------------
  |  Branch (98:9): [True: 0, False: 0]
  ------------------
   99|      0|            othername = se_find_label_in_slist("snmp_secmods", secmod);
  100|      0|            if (strcmp(othername, modname) != 0) {
  ------------------
  |  Branch (100:17): [True: 0, False: 0]
  ------------------
  101|      0|                snmp_log(LOG_ERR,
  102|      0|                         "snmp_secmod: two security modules %s and %s registered with the same security number\n",
  103|      0|                         modname, othername);
  104|      0|            }
  105|      0|            break;
  106|       |
  107|      0|        default:
  ------------------
  |  Branch (107:9): [True: 0, False: 0]
  ------------------
  108|      0|            snmp_log(LOG_ERR,
  109|      0|                     "snmp_secmod: unknown error trying to register a new security module\n");
  110|      0|            break;
  111|      0|        }
  112|      0|        return SNMPERR_GENERR;
  ------------------
  |  |  185|      0|#define SNMPERR_GENERR			(-1)
  ------------------
  113|      0|    }
  114|      2|    return SNMPERR_SUCCESS;
  ------------------
  |  |  184|      2|#define SNMPERR_SUCCESS			(0)     /* XXX  Non-PDU "success" code. */
  ------------------
  115|      2|}
find_sec_mod:
  160|  5.46k|{
  161|  5.46k|    struct snmp_secmod_list *sptr;
  162|       |
  163|  10.9k|    for (sptr = registered_services; sptr; sptr = sptr->next) {
  ------------------
  |  Branch (163:38): [True: 5.46k, False: 5.46k]
  ------------------
  164|  5.46k|        if (sptr->securityModel == secmod) {
  ------------------
  |  Branch (164:13): [True: 0, False: 5.46k]
  ------------------
  165|      0|            return sptr->secDef;
  166|      0|        }
  167|  5.46k|    }
  168|       |    /*
  169|       |     * not registered 
  170|       |     */
  171|  5.46k|    return NULL;
  172|  5.46k|}

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

netsnmp_memdup:
  278|  1.80k|{
  279|  1.80k|    void *to = NULL;
  280|       |
  281|  1.80k|    if (from) {
  ------------------
  |  Branch (281:9): [True: 1.80k, False: 0]
  ------------------
  282|  1.80k|        to = malloc(size);
  283|  1.80k|        if (to)
  ------------------
  |  Branch (283:13): [True: 1.80k, False: 0]
  ------------------
  284|  1.80k|            memcpy(to, from, size);
  285|  1.80k|    }
  286|  1.80k|    return to;
  287|  1.80k|}                               /* end netsnmp_memdup() */

LLVMFuzzerInitialize:
   40|      2|int LLVMFuzzerInitialize(int *argc, char ***argv) {
   41|      2|    if (getenv("NETSNMP_DEBUGGING") != NULL) {
  ------------------
  |  Branch (41:9): [True: 0, False: 2]
  ------------------
   42|       |        /*
   43|       |         * Turn on all debugging, to help understand what
   44|       |         * bits of the parser are running.
   45|       |         */
   46|      0|        snmp_enable_stderrlog();
   47|      0|        snmp_set_do_debugging(1);
   48|      0|        debug_register_tokens("");
   49|      0|    }
   50|       |
   51|      2|    struct snmp_secmod_def *sndef = SNMP_MALLOC_STRUCT(snmp_secmod_def);
  ------------------
  |  |   69|      2|#define SNMP_MALLOC_STRUCT(s)   (struct s *) calloc(1, sizeof(struct s))
  ------------------
   52|      2|    sndef->decode = SecmodInMsg_CB;
   53|      2|    register_sec_mod(-1, "modname", sndef);
   54|      2|    return 0;
   55|      2|}
LLVMFuzzerTestOneInput:
   57|  2.70k|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   58|  2.70k|    size_t bytes_remaining = size;
   59|  2.70k|    netsnmp_pdu *pdu = SNMP_MALLOC_TYPEDEF(netsnmp_pdu);
  ------------------
  |  |   73|  2.70k|#define SNMP_MALLOC_TYPEDEF(td)  (td *) calloc(1, sizeof(td))
  ------------------
   60|       |
   61|  2.70k|    netsnmp_session sess = { };
   62|  2.70k|    snmpv3_parse(pdu, NETSNMP_REMOVE_CONST(uint8_t *, data), &bytes_remaining,
  ------------------
  |  |   91|  2.70k|    (__extension__ ({ const t tmp = (e); (t)(size_t)tmp; }))
  ------------------
   63|  2.70k|                 NULL, &sess);
   64|  2.70k|    snmp_free_pdu(pdu);
   65|       |
   66|  2.70k|    pdu = SNMP_MALLOC_TYPEDEF(netsnmp_pdu);
  ------------------
  |  |   73|  2.70k|#define SNMP_MALLOC_TYPEDEF(td)  (td *) calloc(1, sizeof(td))
  ------------------
   67|  2.70k|    memset(&sess, 0, sizeof(sess));
   68|  2.70k|    snmp_parse(NULL, &sess, pdu, NETSNMP_REMOVE_CONST(uint8_t *, data), size);
  ------------------
  |  |   91|  2.70k|    (__extension__ ({ const t tmp = (e); (t)(size_t)tmp; }))
  ------------------
   69|  2.70k|    snmp_free_pdu(pdu);
   70|       |
   71|  2.70k|    return 0;
   72|  2.70k|}

