asn_parse_nlength:
  325|  94.0k|{
  326|  94.0k|    int len_len;
  327|       |
  328|  94.0k|    if (pkt_len < 1)
  ------------------
  |  Branch (328:9): [True: 0, False: 94.0k]
  ------------------
  329|      0|        return NULL;               /* always too short */
  330|       |
  331|  94.0k|    if (NULL == pkt || NULL == data_len)
  ------------------
  |  Branch (331:9): [True: 0, False: 94.0k]
  |  Branch (331:24): [True: 0, False: 94.0k]
  ------------------
  332|      0|        return NULL;
  333|       |
  334|  94.0k|    *data_len = 0;
  335|       |
  336|  94.0k|    if (*pkt & 0x80) {
  ------------------
  |  Branch (336:9): [True: 12.8k, False: 81.1k]
  ------------------
  337|       |        /*
  338|       |         * long length; first byte is length of length (after masking high bit)
  339|       |         */
  340|  12.8k|        len_len = (int) ((*pkt & ~0x80) + 1);
  341|  12.8k|        if (pkt_len < len_len)
  ------------------
  |  Branch (341:13): [True: 134, False: 12.7k]
  ------------------
  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.7k|        if (NULL == asn_parse_length(pkt, data_len))
  ------------------
  |  Branch (345:13): [True: 350, False: 12.4k]
  ------------------
  346|    350|            return NULL;           /* propagate error from asn_parse_length */
  347|  81.1k|    } else {
  348|       |        /*
  349|       |         * short length; first byte is the length
  350|       |         */
  351|  81.1k|        len_len = 1;
  352|  81.1k|        *data_len = *pkt;
  353|  81.1k|    }
  354|       |
  355|  93.5k|    if ((*data_len + len_len) > pkt_len)
  ------------------
  |  Branch (355:9): [True: 1.03k, False: 92.5k]
  ------------------
  356|  1.03k|        return NULL;
  357|       |
  358|  92.5k|    return (pkt + len_len);
  359|  93.5k|}
asn_parse_int:
  559|  9.11k|{
  560|       |    /*
  561|       |     * ASN.1 integer ::= 0x02 asnlength byte {byte}*
  562|       |     */
  563|  9.11k|    static const char *errpre = "parse int";
  564|  9.11k|    register u_char *bufp = data;
  565|  9.11k|    u_long          asn_length;
  566|  9.11k|    int             i;
  567|  9.11k|    union {
  568|  9.11k|        long          l;
  569|  9.11k|        unsigned char b[sizeof(long)];
  570|  9.11k|    } value;
  571|       |
  572|  9.11k|    if (NULL == data || NULL == datalength || NULL == type || NULL == intp) {
  ------------------
  |  Branch (572:9): [True: 0, False: 9.11k]
  |  Branch (572:25): [True: 0, False: 9.11k]
  |  Branch (572:47): [True: 0, False: 9.11k]
  |  Branch (572:63): [True: 0, False: 9.11k]
  ------------------
  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.11k|    if (intsize != sizeof(long)) {
  ------------------
  |  Branch (577:9): [True: 0, False: 9.11k]
  ------------------
  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.11k|    if (*datalength < 2) {
  ------------------
  |  Branch (583:9): [True: 78, False: 9.03k]
  ------------------
  584|     78|        _asn_short_err(errpre, *datalength, 2);
  585|     78|        return NULL;
  586|     78|    }
  587|       |
  588|  9.03k|    *type = *bufp++;
  589|  9.03k|    if (*type != ASN_INTEGER) {
  ------------------
  |  |   64|  9.03k|#define ASN_INTEGER	    0x02U
  ------------------
  |  Branch (589:9): [True: 38, False: 9.00k]
  ------------------
  590|     38|        _asn_type_err(errpre, *type);
  591|     38|        return NULL;
  592|     38|    }
  593|       |
  594|  9.00k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
  595|  9.00k|    if (NULL == bufp) {
  ------------------
  |  Branch (595:9): [True: 304, False: 8.69k]
  ------------------
  596|    304|        _asn_short_err(errpre, *datalength - 1, asn_length);
  597|    304|        return NULL;
  598|    304|    }
  599|       |
  600|  8.69k|    if ((size_t) asn_length > intsize || (int) asn_length == 0) {
  ------------------
  |  Branch (600:9): [True: 31, False: 8.66k]
  |  Branch (600:42): [True: 15, False: 8.65k]
  ------------------
  601|     46|        _asn_length_err(errpre, (size_t) asn_length, intsize);
  602|     46|        return NULL;
  603|     46|    }
  604|       |
  605|  8.65k|    *datalength -= (int) asn_length + (bufp - data);
  606|       |
  607|  8.65k|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|  8.65k|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  8.65k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 8.65k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	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: 8.65k]
  |  |  ------------------
  ------------------
  608|       |
  609|  8.65k|    memset(&value.b, *bufp & 0x80 ? 0xff : 0, sizeof(value.b));
  ------------------
  |  Branch (609:22): [True: 1.67k, False: 6.97k]
  ------------------
  610|  8.65k|    if (NETSNMP_BIGENDIAN) {
  ------------------
  |  | 2431|  8.65k|#  define NETSNMP_BIGENDIAN 0
  |  |  ------------------
  |  |  |  Branch (2431:29): [Folded, False: 8.65k]
  |  |  ------------------
  ------------------
  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|  8.65k|    } else {
  614|  23.9k|        for (i = asn_length - 1; asn_length--; i--)
  ------------------
  |  Branch (614:34): [True: 15.3k, False: 8.65k]
  ------------------
  615|  15.3k|            value.b[i] = *bufp++;
  616|  8.65k|    }
  617|       |
  618|  8.65k|    CHECK_OVERFLOW_S(value.l, 1);
  ------------------
  |  |  214|  8.65k|#define CHECK_OVERFLOW_S(x,y) do {                                      \
  |  |  215|  8.65k|        if (x > INT32_MAX) {                                            \
  |  |  ------------------
  |  |  |  Branch (215:13): [True: 489, False: 8.16k]
  |  |  ------------------
  |  |  216|    489|            DEBUGMSG(("asn","truncating signed value %ld to 32 bits (%d)\n",(long)(x),y)); \
  |  |  ------------------
  |  |  |  |   61|    489|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|    489|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (144:29): [True: 0, False: 489]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (61:67): [Folded, False: 489]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  217|    489|            x &= 0xffffffff;                                            \
  |  |  218|  8.16k|        } else if (x < INT32_MIN) {                                     \
  |  |  ------------------
  |  |  |  Branch (218:20): [True: 448, False: 7.71k]
  |  |  ------------------
  |  |  219|    448|            DEBUGMSG(("asn","truncating signed value %ld to 32 bits (%d)\n",(long)(x),y)); \
  |  |  ------------------
  |  |  |  |   61|    448|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|    448|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (144:29): [True: 0, False: 448]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (61:67): [Folded, False: 448]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  220|    448|            x = 0 - (x & 0xffffffff);                                   \
  |  |  221|    448|        }                                                               \
  |  |  222|  8.65k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded, False: 8.65k]
  |  |  ------------------
  ------------------
  619|       |
  620|  8.65k|    DEBUGMSG(("dumpv_recv", "  Integer:\t%ld (0x%.2lX)\n", value.l, value.l));
  ------------------
  |  |   61|  8.65k|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|  8.65k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 8.65k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 8.65k]
  |  |  ------------------
  ------------------
  621|       |
  622|  8.65k|    *intp = value.l;
  623|  8.65k|    return bufp;
  624|  8.69k|}
asn_parse_unsigned_int:
  652|  3.65k|{
  653|       |    /*
  654|       |     * ASN.1 integer ::= 0x02 asnlength byte {byte}*
  655|       |     */
  656|  3.65k|    static const char *errpre = "parse uint";
  657|  3.65k|    register u_char *bufp = data;
  658|  3.65k|    u_long          asn_length;
  659|  3.65k|    register u_long value = 0;
  660|       |
  661|  3.65k|    if (NULL == data || NULL == datalength || NULL == type || NULL == intp) {
  ------------------
  |  Branch (661:9): [True: 0, False: 3.65k]
  |  Branch (661:25): [True: 0, False: 3.65k]
  |  Branch (661:47): [True: 0, False: 3.65k]
  |  Branch (661:63): [True: 0, False: 3.65k]
  ------------------
  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.65k|    if (intsize != sizeof(long)) {
  ------------------
  |  Branch (666:9): [True: 0, False: 3.65k]
  ------------------
  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.65k|    if (*datalength < 2) {
  ------------------
  |  Branch (672:9): [True: 2, False: 3.64k]
  ------------------
  673|      2|        _asn_short_err(errpre, *datalength, 2);
  674|      2|        return NULL;
  675|      2|    }
  676|       |
  677|  3.64k|    *type = *bufp++;
  678|  3.64k|    if (*type != ASN_COUNTER && *type != ASN_GAUGE && *type != ASN_TIMETICKS
  ------------------
  |  |   89|  7.29k|#define ASN_COUNTER	(ASN_APPLICATION | 1)
  |  |  ------------------
  |  |  |  |   80|  3.64k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
                  if (*type != ASN_COUNTER && *type != ASN_GAUGE && *type != ASN_TIMETICKS
  ------------------
  |  |   90|  6.04k|#define ASN_GAUGE	(ASN_APPLICATION | 2)
  |  |  ------------------
  |  |  |  |   80|  2.39k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
                  if (*type != ASN_COUNTER && *type != ASN_GAUGE && *type != ASN_TIMETICKS
  ------------------
  |  |   92|  5.25k|#define ASN_TIMETICKS   (ASN_APPLICATION | 3)
  |  |  ------------------
  |  |  |  |   80|  1.60k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (678:9): [True: 2.39k, False: 1.25k]
  |  Branch (678:33): [True: 1.60k, False: 797]
  |  Branch (678:55): [True: 867, False: 734]
  ------------------
  679|    867|            && *type != ASN_UINTEGER) {
  ------------------
  |  |  100|    867|#define ASN_UINTEGER    (ASN_APPLICATION | 7)   /* historic - don't use */
  |  |  ------------------
  |  |  |  |   80|    867|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (679:16): [True: 20, False: 847]
  ------------------
  680|     20|        _asn_type_err(errpre, *type);
  681|     20|        return NULL;
  682|     20|    }
  683|       |
  684|  3.62k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
  685|  3.62k|    if (NULL == bufp) {
  ------------------
  |  Branch (685:9): [True: 138, False: 3.49k]
  ------------------
  686|    138|        _asn_short_err(errpre, *datalength - 1, asn_length);
  687|    138|        return NULL;
  688|    138|    }
  689|       |
  690|  3.49k|    if ((asn_length > (intsize + 1)) || ((int) asn_length == 0) ||
  ------------------
  |  Branch (690:9): [True: 13, False: 3.47k]
  |  Branch (690:41): [True: 16, False: 3.46k]
  ------------------
  691|  3.46k|        ((asn_length == intsize + 1) && *bufp != 0x00)) {
  ------------------
  |  Branch (691:10): [True: 344, False: 3.11k]
  |  Branch (691:41): [True: 9, False: 335]
  ------------------
  692|     38|        _asn_length_err(errpre, (size_t) asn_length, intsize);
  693|     38|        return NULL;
  694|     38|    }
  695|  3.45k|    *datalength -= (int) asn_length + (bufp - data);
  696|       |
  697|  3.45k|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|  3.45k|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  3.45k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 3.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	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.45k]
  |  |  ------------------
  ------------------
  698|       |
  699|  13.3k|    while (asn_length--)
  ------------------
  |  Branch (699:12): [True: 9.86k, False: 3.45k]
  ------------------
  700|  9.86k|        value = (value << 8) | *bufp++;
  701|       |
  702|  3.45k|    CHECK_OVERFLOW_U(value,2);
  ------------------
  |  |  224|  3.45k|#define CHECK_OVERFLOW_U(x,y) do {                                      \
  |  |  225|  3.45k|        if (x > UINT32_MAX) {                                           \
  |  |  ------------------
  |  |  |  Branch (225:13): [True: 876, False: 2.57k]
  |  |  ------------------
  |  |  226|    876|            x &= 0xffffffff;                                            \
  |  |  227|    876|            DEBUGMSG(("asn","truncating unsigned value to 32 bits (%d)\n",y)); \
  |  |  ------------------
  |  |  |  |   61|    876|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|    876|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (144:29): [True: 0, False: 876]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (61:67): [Folded, False: 876]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  228|    876|        }                                                               \
  |  |  229|  3.45k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (229:13): [Folded, False: 3.45k]
  |  |  ------------------
  ------------------
  703|       |
  704|  3.45k|    DEBUGMSG(("dumpv_recv", "  UInteger:\t%ld (0x%.2lX)\n", value, value));
  ------------------
  |  |   61|  3.45k|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|  3.45k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 3.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 3.45k]
  |  |  ------------------
  ------------------
  705|       |
  706|  3.45k|    *intp = value;
  707|  3.45k|    return bufp;
  708|  3.49k|}
asn_parse_string:
  912|  6.32k|{
  913|  6.32k|    static const char *errpre = "parse string";
  914|  6.32k|    u_char         *bufp = data;
  915|  6.32k|    u_long          asn_length;
  916|       |
  917|  6.32k|    if (NULL == data || NULL == datalength || NULL == type || NULL == str ||
  ------------------
  |  Branch (917:9): [True: 0, False: 6.32k]
  |  Branch (917:25): [True: 0, False: 6.32k]
  |  Branch (917:47): [True: 0, False: 6.32k]
  |  Branch (917:63): [True: 0, False: 6.32k]
  ------------------
  918|  6.32k|        NULL == strlength) {
  ------------------
  |  Branch (918:9): [True: 0, False: 6.32k]
  ------------------
  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.32k|    if (*datalength < 2) {
  ------------------
  |  Branch (924:9): [True: 296, False: 6.02k]
  ------------------
  925|    296|        _asn_short_err(errpre, *datalength, 2);
  926|    296|        return NULL;
  927|    296|    }
  928|       |
  929|  6.02k|    *type = *bufp++;
  930|  6.02k|    if (*type != ASN_OCTET_STR && *type != ASN_IPADDRESS && *type != ASN_OPAQUE
  ------------------
  |  |   67|  12.0k|#define ASN_OCTET_STR	    0x04U
  ------------------
                  if (*type != ASN_OCTET_STR && *type != ASN_IPADDRESS && *type != ASN_OPAQUE
  ------------------
  |  |   88|  9.84k|#define ASN_IPADDRESS   (ASN_APPLICATION | 0)
  |  |  ------------------
  |  |  |  |   80|  3.82k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
                  if (*type != ASN_OCTET_STR && *type != ASN_IPADDRESS && *type != ASN_OPAQUE
  ------------------
  |  |   93|  9.23k|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   80|  3.20k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (930:9): [True: 3.82k, False: 2.20k]
  |  Branch (930:35): [True: 3.20k, False: 614]
  |  Branch (930:61): [True: 1.67k, False: 1.53k]
  ------------------
  931|  1.67k|            && *type != ASN_NSAP) {
  ------------------
  |  |   98|  1.67k|#define ASN_NSAP	(ASN_APPLICATION | 5)   /* historic - don't use */
  |  |  ------------------
  |  |  |  |   80|  1.67k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (931:16): [True: 412, False: 1.25k]
  ------------------
  932|    412|        _asn_type_err(errpre, *type);
  933|    412|        return NULL;
  934|    412|    }
  935|       |
  936|  5.61k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
  937|  5.61k|    if (NULL == bufp) {
  ------------------
  |  Branch (937:9): [True: 156, False: 5.45k]
  ------------------
  938|    156|        _asn_short_err(errpre, *datalength - 1, asn_length);
  939|    156|        return NULL;
  940|    156|    }
  941|       |
  942|  5.45k|    if (asn_length > *strlength) {
  ------------------
  |  Branch (942:9): [True: 36, False: 5.42k]
  ------------------
  943|     36|        _asn_length_err(errpre, (size_t) asn_length, *strlength);
  944|     36|        return NULL;
  945|     36|    }
  946|       |
  947|  5.42k|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|  5.42k|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  5.42k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 5.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	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.42k]
  |  |  ------------------
  ------------------
  948|       |
  949|  5.42k|    memmove(str, bufp, asn_length);
  950|  5.42k|    if (*strlength > asn_length)
  ------------------
  |  Branch (950:9): [True: 2.29k, False: 3.13k]
  ------------------
  951|  2.29k|        str[asn_length] = 0;
  952|  5.42k|    *strlength = asn_length;
  953|  5.42k|    *datalength -= asn_length + (bufp - data);
  954|       |
  955|  5.42k|    DEBUGIF("dumpv_recv") {
  ------------------
  |  |  145|  5.42k|#define DEBUGIF(x)         if (_DBG_IF_ && debug_is_token_registered(x) == SNMPERR_SUCCESS)
  |  |  ------------------
  |  |  |  |  144|  10.8k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 5.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #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.42k|    return bufp + asn_length;
  976|  5.45k|}
asn_parse_header:
 1073|  44.4k|{
 1074|  44.4k|    register u_char *bufp;
 1075|  44.4k|    u_long          asn_length = 0;
 1076|  44.4k|    const char      *errpre = "parse header";
 1077|       |
 1078|  44.4k|    if (!data || !datalength || !type) {
  ------------------
  |  Branch (1078:9): [True: 0, False: 44.4k]
  |  Branch (1078:18): [True: 0, False: 44.4k]
  |  Branch (1078:33): [True: 0, False: 44.4k]
  ------------------
 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.4k|    if (*datalength < 2) {
  ------------------
  |  Branch (1084:9): [True: 368, False: 44.0k]
  ------------------
 1085|    368|        _asn_short_err(errpre, *datalength, 2);
 1086|    368|        return NULL;
 1087|    368|    }
 1088|       |
 1089|  44.0k|    bufp = data;
 1090|       |    /*
 1091|       |     * this only works on data types < 30, i.e. no extension octets 
 1092|       |     */
 1093|  44.0k|    if (IS_EXTENSION_ID(*bufp)) {
  ------------------
  |  |   92|  44.0k|#define IS_EXTENSION_ID(byte)	(((byte) & ASN_EXTENSION_ID) == ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   88|  44.0k|#define ASN_EXTENSION_ID    0x1FU
  |  |  ------------------
  |  |               #define IS_EXTENSION_ID(byte)	(((byte) & ASN_EXTENSION_ID) == ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   88|  44.0k|#define ASN_EXTENSION_ID    0x1FU
  |  |  ------------------
  |  |  |  Branch (92:31): [True: 14, False: 44.0k]
  |  |  ------------------
  ------------------
 1094|     14|        ERROR_MSG("can't process ID >= 30");
  ------------------
  |  |  188|     14|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1095|     14|        return NULL;
 1096|     14|    }
 1097|  44.0k|    *type = *bufp++;
 1098|       |
 1099|  44.0k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
 1100|  44.0k|    if (NULL == bufp) {
  ------------------
  |  Branch (1100:9): [True: 746, False: 43.3k]
  ------------------
 1101|    746|        _asn_short_err(errpre, *datalength - 1, asn_length);
 1102|    746|        return NULL;
 1103|    746|    }
 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|  43.3k|#endif
 1115|       |
 1116|  43.3k|#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
 1117|       |
 1118|  43.3k|    if ((asn_length > 2) && (*type == ASN_OPAQUE) && (*bufp == ASN_OPAQUE_TAG1)) {
  ------------------
  |  |   93|  32.5k|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   80|  32.5k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
                  if ((asn_length > 2) && (*type == ASN_OPAQUE) && (*bufp == ASN_OPAQUE_TAG1)) {
  ------------------
  |  |  120|  3.77k|#define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   81|  3.77k|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   88|  3.77k|#define ASN_EXTENSION_ID    0x1FU
  |  |  ------------------
  ------------------
  |  Branch (1118:9): [True: 32.5k, False: 10.8k]
  |  Branch (1118:29): [True: 3.77k, False: 28.7k]
  |  Branch (1118:54): [True: 3.24k, False: 532]
  ------------------
 1119|       |
 1120|       |        /*
 1121|       |         * check if 64-but counter 
 1122|       |         */
 1123|  3.24k|        switch (*(bufp + 1)) {
 1124|    442|        case ASN_OPAQUE_COUNTER64:
  ------------------
  |  |  145|    442|#define ASN_OPAQUE_COUNTER64 (ASN_OPAQUE_TAG2 + ASN_APP_COUNTER64)
  |  |  ------------------
  |  |  |  |  125|    442|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_COUNTER64 (ASN_OPAQUE_TAG2 + ASN_APP_COUNTER64)
  |  |  ------------------
  |  |  |  |  135|    442|#define ASN_APP_COUNTER64 (ASN_APPLICATION | 6)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|    442|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1124:9): [True: 442, False: 2.80k]
  ------------------
 1125|    869|        case ASN_OPAQUE_U64:
  ------------------
  |  |  181|    869|#define ASN_OPAQUE_U64 (ASN_OPAQUE_TAG2 + ASN_APP_U64)
  |  |  ------------------
  |  |  |  |  125|    869|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_U64 (ASN_OPAQUE_TAG2 + ASN_APP_U64)
  |  |  ------------------
  |  |  |  |  139|    869|#define ASN_APP_U64 (ASN_APPLICATION | 11)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|    869|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1125:9): [True: 427, False: 2.82k]
  ------------------
 1126|  1.26k|        case ASN_OPAQUE_FLOAT:
  ------------------
  |  |  154|  1.26k|#define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  125|  1.26k|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  136|  1.26k|#define ASN_APP_FLOAT (ASN_APPLICATION | 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  1.26k|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1126:9): [True: 394, False: 2.85k]
  ------------------
 1127|  1.53k|        case ASN_OPAQUE_DOUBLE:
  ------------------
  |  |  163|  1.53k|#define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  125|  1.53k|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  137|  1.53k|#define ASN_APP_DOUBLE (ASN_APPLICATION | 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  1.53k|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1127:9): [True: 269, False: 2.97k]
  ------------------
 1128|  2.87k|        case ASN_OPAQUE_I64:
  ------------------
  |  |  172|  2.87k|#define ASN_OPAQUE_I64 (ASN_OPAQUE_TAG2 + ASN_APP_I64)
  |  |  ------------------
  |  |  |  |  125|  2.87k|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_I64 (ASN_OPAQUE_TAG2 + ASN_APP_I64)
  |  |  ------------------
  |  |  |  |  138|  2.87k|#define ASN_APP_I64 (ASN_APPLICATION | 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  2.87k|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1128:9): [True: 1.34k, False: 1.90k]
  ------------------
 1129|  2.87k|            *type = *(bufp + 1);
 1130|  2.87k|            break;
 1131|       |
 1132|    371|        default:
  ------------------
  |  Branch (1132:9): [True: 371, False: 2.87k]
  ------------------
 1133|       |            /*
 1134|       |             * just an Opaque 
 1135|       |             */
 1136|    371|            *datalength = (int) asn_length;
 1137|    371|            return bufp;
 1138|  3.24k|        }
 1139|       |        /*
 1140|       |         * value is encoded as special format 
 1141|       |         */
 1142|  2.87k|        *datalength = (int) asn_length;
 1143|  2.87k|        bufp = asn_parse_nlength(bufp+2, *datalength - 2, &asn_length);
 1144|  2.87k|        if (NULL == bufp) {
  ------------------
  |  Branch (1144:13): [True: 36, False: 2.84k]
  ------------------
 1145|     36|            _asn_short_err("parse opaque header", *datalength - 2, asn_length);
 1146|     36|            return NULL;
 1147|     36|        }
 1148|  2.87k|    }
 1149|  42.9k|#endif                          /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
 1150|       |
 1151|  42.9k|    *datalength = (int) asn_length;
 1152|       |
 1153|  42.9k|    return bufp;
 1154|  43.3k|}
asn_parse_sequence:
 1173|  25.8k|{                               /* error message prefix */
 1174|  25.8k|    data = asn_parse_header(data, datalength, type);
 1175|  25.8k|    if (data && (*type != expected_type)) {
  ------------------
  |  Branch (1175:9): [True: 24.6k, False: 1.12k]
  |  Branch (1175:17): [True: 1.62k, False: 23.0k]
  ------------------
 1176|  1.62k|        char            ebuf[128];
 1177|  1.62k|        snprintf(ebuf, sizeof(ebuf),
 1178|  1.62k|                 "%s header type %02X: s/b %02X", estr,
 1179|  1.62k|                (u_char) * type, (u_char) expected_type);
 1180|  1.62k|        ERROR_MSG(ebuf);
  ------------------
  |  |  188|  1.62k|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1181|  1.62k|        return NULL;
 1182|  1.62k|    }
 1183|  24.1k|    return data;
 1184|  25.8k|}
asn_parse_length:
 1295|  12.7k|{
 1296|  12.7k|    static const char *errpre = "parse length";
 1297|  12.7k|    char            ebuf[128];
 1298|  12.7k|    register u_char lengthbyte;
 1299|       |
 1300|  12.7k|    if (!data || !length) {
  ------------------
  |  Branch (1300:9): [True: 0, False: 12.7k]
  |  Branch (1300:18): [True: 0, False: 12.7k]
  ------------------
 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.7k|    lengthbyte = *data;
 1305|       |
 1306|  12.7k|    if (lengthbyte & ASN_LONG_LEN) {
  ------------------
  |  |   87|  12.7k|#define ASN_LONG_LEN	    0x80U
  ------------------
  |  Branch (1306:9): [True: 12.7k, False: 0]
  ------------------
 1307|  12.7k|        lengthbyte &= ~ASN_LONG_LEN;    /* turn MSb off */
  ------------------
  |  |   87|  12.7k|#define ASN_LONG_LEN	    0x80U
  ------------------
 1308|  12.7k|        if (lengthbyte == 0) {
  ------------------
  |  Branch (1308:13): [True: 107, False: 12.6k]
  ------------------
 1309|    107|            snprintf(ebuf, sizeof(ebuf),
 1310|    107|                     "%s: indefinite length not supported", errpre);
 1311|    107|            ERROR_MSG(ebuf);
  ------------------
  |  |  188|    107|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1312|    107|            return NULL;
 1313|    107|        }
 1314|  12.6k|        if (lengthbyte > sizeof(long)) {
  ------------------
  |  Branch (1314:13): [True: 120, False: 12.5k]
  ------------------
 1315|    120|            snprintf(ebuf, sizeof(ebuf),
 1316|    120|                    "%s: data length %d > %lu not supported", errpre,
 1317|    120|                    lengthbyte, (unsigned long)sizeof(long));
 1318|    120|            ERROR_MSG(ebuf);
  ------------------
  |  |  188|    120|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1319|    120|            return NULL;
 1320|    120|        }
 1321|  12.5k|        data++;
 1322|  12.5k|        *length = 0;            /* protect against short lengths */
 1323|  31.3k|        while (lengthbyte--) {
  ------------------
  |  Branch (1323:16): [True: 18.7k, False: 12.5k]
  ------------------
 1324|  18.7k|            *length <<= 8;
 1325|  18.7k|            *length |= *data++;
 1326|  18.7k|        }
 1327|  12.5k|        if ((long) *length < 0) {
  ------------------
  |  Branch (1327:13): [True: 123, False: 12.4k]
  ------------------
 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|  12.4k|        return data;
 1335|  12.5k|    } else {                    /* short asnlength */
 1336|      0|        *length = (long) lengthbyte;
 1337|      0|        return data + 1;
 1338|      0|    }
 1339|  12.7k|}
asn_parse_objid:
 1437|  19.3k|{
 1438|  19.3k|    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|  19.3k|    register u_char *bufp = data;
 1446|  19.3k|    register oid   *oidp = objid + 1;
 1447|  19.3k|    register u_long subidentifier;
 1448|  19.3k|    register long   length;
 1449|  19.3k|    u_long          asn_length;
 1450|  19.3k|    size_t          original_length = *objidlength;
 1451|       |
 1452|  19.3k|    if (NULL == data || NULL == datalength || NULL == type || NULL == objid) {
  ------------------
  |  Branch (1452:9): [True: 0, False: 19.3k]
  |  Branch (1452:25): [True: 0, False: 19.3k]
  |  Branch (1452:47): [True: 0, False: 19.3k]
  |  Branch (1452:63): [True: 0, False: 19.3k]
  ------------------
 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|  19.3k|    if (*datalength < 2) {
  ------------------
  |  Branch (1458:9): [True: 20, False: 19.2k]
  ------------------
 1459|     20|        _asn_short_err(errpre, *datalength, 2);
 1460|     20|        return NULL;
 1461|     20|    }
 1462|       |
 1463|  19.2k|    *type = *bufp++;
 1464|  19.2k|    if (*type != ASN_OBJECT_ID) {
  ------------------
  |  |   70|  19.2k|#define ASN_OBJECT_ID	    0x06U
  ------------------
  |  Branch (1464:9): [True: 28, False: 19.2k]
  ------------------
 1465|     28|        _asn_type_err(errpre, *type);
 1466|     28|        return NULL;
 1467|     28|    }
 1468|  19.2k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
 1469|  19.2k|    if (NULL == bufp) {
  ------------------
  |  Branch (1469:9): [True: 140, False: 19.1k]
  ------------------
 1470|    140|        _asn_short_err(errpre, *datalength - 1, asn_length);
 1471|    140|        return NULL;
 1472|    140|    }
 1473|       |
 1474|  19.1k|    *datalength -= (int) asn_length + (bufp - data);
 1475|       |
 1476|  19.1k|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|  19.1k|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  19.1k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 19.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	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: 19.1k]
  |  |  ------------------
  ------------------
 1477|       |
 1478|       |    /*
 1479|       |     * Handle invalid object identifier encodings of the form 06 00 robustly 
 1480|       |     */
 1481|  19.1k|    if (asn_length == 0)
  ------------------
  |  Branch (1481:9): [True: 15.7k, False: 3.42k]
  ------------------
 1482|  15.7k|        objid[0] = objid[1] = 0;
 1483|       |
 1484|  19.1k|    length = asn_length;
 1485|  19.1k|    (*objidlength)--;           /* account for expansion of first byte */
 1486|       |
 1487|  38.0k|    while (length > 0 && (*objidlength)-- > 0) {
  ------------------
  |  Branch (1487:12): [True: 19.0k, False: 19.0k]
  |  Branch (1487:26): [True: 18.9k, False: 21]
  ------------------
 1488|  18.9k|        subidentifier = 0;
 1489|  21.6k|        do {                    /* shift and add in low order 7 bits */
 1490|  21.6k|            if (subidentifier > (MAX_SUBID >> 7)) {
  ------------------
  |  |   18|  21.6k|#define MAX_SUBID   0xFFFFFFFFUL
  ------------------
  |  Branch (1490:17): [True: 22, False: 21.6k]
  ------------------
 1491|     22|                ERROR_MSG("subidentifier too large / overflow");
  ------------------
  |  |  188|     22|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1492|     22|                return NULL;
 1493|     22|            }
 1494|  21.6k|            subidentifier =
 1495|  21.6k|                (subidentifier << 7) + (*(u_char *) bufp & ~ASN_BIT8);
  ------------------
  |  |   89|  21.6k|#define ASN_BIT8	    0x80U
  ------------------
 1496|  21.6k|            length--;
 1497|  21.6k|        } while ((*(u_char *) bufp++ & ASN_BIT8) && (length > 0));        /* last byte has high bit clear */
  ------------------
  |  |   89|  21.6k|#define ASN_BIT8	    0x80U
  ------------------
  |  Branch (1497:18): [True: 2.72k, False: 18.9k]
  |  Branch (1497:53): [True: 2.70k, False: 23]
  ------------------
 1498|       |
 1499|  18.9k|	if (length == 0) {
  ------------------
  |  Branch (1499:6): [True: 3.37k, False: 15.5k]
  ------------------
 1500|  3.37k|            u_char *last_byte = bufp - 1;
 1501|  3.37k|            if (*last_byte & ASN_BIT8) {
  ------------------
  |  |   89|  3.37k|#define ASN_BIT8	    0x80U
  ------------------
  |  Branch (1501:17): [True: 23, False: 3.35k]
  ------------------
 1502|       |                /* last byte has high bit set -> wrong BER encoded OID */
 1503|     23|                ERROR_MSG("subidentifier syntax error");
  ------------------
  |  |  188|     23|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1504|     23|                return NULL;
 1505|     23|            }
 1506|  3.37k|        }
 1507|  18.9k|        if (subidentifier > MAX_SUBID) {
  ------------------
  |  |   18|  18.9k|#define MAX_SUBID   0xFFFFFFFFUL
  ------------------
  |  Branch (1507:13): [True: 0, False: 18.9k]
  ------------------
 1508|      0|            ERROR_MSG("subidentifier too large");
  ------------------
  |  |  188|      0|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1509|      0|            return NULL;
 1510|      0|        }
 1511|  18.9k|        *oidp++ = (oid) subidentifier;
 1512|  18.9k|    }
 1513|       |
 1514|  19.0k|    if (length || oidp < objid + 1) {
  ------------------
  |  Branch (1514:9): [True: 21, False: 19.0k]
  |  Branch (1514:19): [True: 0, False: 19.0k]
  ------------------
 1515|     21|        ERROR_MSG("OID length exceeds buffer size");
  ------------------
  |  |  188|     21|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 1516|     21|        *objidlength = original_length;
 1517|     21|        return NULL;
 1518|     21|    }
 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|  19.0k|    subidentifier = oidp - objid >= 2 ? objid[1] : 0;
  ------------------
  |  Branch (1526:21): [True: 3.35k, False: 15.7k]
  ------------------
 1527|  19.0k|    if (subidentifier == 0x2B) {
  ------------------
  |  Branch (1527:9): [True: 473, False: 18.5k]
  ------------------
 1528|    473|        objid[0] = 1;
 1529|    473|        objid[1] = 3;
 1530|  18.5k|    } else {
 1531|  18.5k|        if (subidentifier < 40) {
  ------------------
  |  Branch (1531:13): [True: 16.2k, False: 2.29k]
  ------------------
 1532|  16.2k|            objid[0] = 0;
 1533|  16.2k|            objid[1] = subidentifier;
 1534|  16.2k|        } else if (subidentifier < 80) {
  ------------------
  |  Branch (1534:20): [True: 996, False: 1.29k]
  ------------------
 1535|    996|            objid[0] = 1;
 1536|    996|            objid[1] = subidentifier - 40;
 1537|  1.29k|        } else {
 1538|  1.29k|            objid[0] = 2;
 1539|  1.29k|            objid[1] = subidentifier - 80;
 1540|  1.29k|        }
 1541|  18.5k|    }
 1542|       |
 1543|  19.0k|    *objidlength = (int) (oidp - objid);
 1544|       |
 1545|  19.0k|    DEBUGMSG(("dumpv_recv", "  ObjID: "));
  ------------------
  |  |   61|  19.0k|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|  19.0k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 19.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 19.0k]
  |  |  ------------------
  ------------------
 1546|  19.0k|    DEBUGMSGOID(("dumpv_recv", objid, *objidlength));
  ------------------
  |  |   67|  19.0k|#define DEBUGMSGOID(x)     do {if (_DBG_IF_) {__DBGMSGOID(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  19.0k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 19.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGOID(x)     do {if (_DBG_IF_) {__DBGMSGOID(x);} }while(0)
  |  |  ------------------
  |  |  |  |  165|      0|#define __DBGMSGOID(x)     debugmsg_oid x
  |  |  ------------------
  |  |  |  Branch (67:71): [Folded, False: 19.0k]
  |  |  ------------------
  ------------------
 1547|  19.0k|    DEBUGMSG(("dumpv_recv", "\n"));
  ------------------
  |  |   61|  19.0k|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|  19.0k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 19.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 19.0k]
  |  |  ------------------
  ------------------
 1548|  19.0k|    return bufp;
 1549|  19.0k|}
asn_parse_bitstring:
 1819|  1.01k|{
 1820|       |    /*
 1821|       |     * bitstring ::= 0x03 asnlength unused {byte}*
 1822|       |     */
 1823|  1.01k|    static const char *errpre = "parse bitstring";
 1824|  1.01k|    register u_char *bufp = data;
 1825|  1.01k|    u_long          asn_length;
 1826|       |
 1827|  1.01k|    if (NULL == data || NULL == datalength || NULL == type ||
  ------------------
  |  Branch (1827:9): [True: 0, False: 1.01k]
  |  Branch (1827:25): [True: 0, False: 1.01k]
  |  Branch (1827:47): [True: 0, False: 1.01k]
  ------------------
 1828|  1.01k|        NULL == str || NULL == strlength) {
  ------------------
  |  Branch (1828:9): [True: 0, False: 1.01k]
  |  Branch (1828:24): [True: 0, False: 1.01k]
  ------------------
 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.01k|    if (*datalength < 2) {
  ------------------
  |  Branch (1834:9): [True: 0, False: 1.01k]
  ------------------
 1835|      0|        _asn_short_err(errpre, *datalength, 2);
 1836|      0|        return NULL;
 1837|      0|    }
 1838|       |
 1839|  1.01k|    *type = *bufp++;
 1840|  1.01k|    if (*type != ASN_BIT_STR) {
  ------------------
  |  |   66|  1.01k|#define ASN_BIT_STR	    0x03U
  ------------------
  |  Branch (1840:9): [True: 0, False: 1.01k]
  ------------------
 1841|      0|        _asn_type_err(errpre, *type);
 1842|      0|        return NULL;
 1843|      0|    }
 1844|       |
 1845|  1.01k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
 1846|  1.01k|    if (NULL == bufp) {
  ------------------
  |  Branch (1846:9): [True: 0, False: 1.01k]
  ------------------
 1847|      0|        _asn_short_err(errpre, *datalength - 1, asn_length);
 1848|      0|        return NULL;
 1849|      0|    }
 1850|       |
 1851|  1.01k|    if ((size_t) asn_length > *strlength) {
  ------------------
  |  Branch (1851:9): [True: 0, False: 1.01k]
  ------------------
 1852|      0|        _asn_length_err(errpre, (size_t) asn_length, *strlength);
 1853|      0|        return NULL;
 1854|      0|    }
 1855|  1.01k|    if (_asn_bitstring_check(errpre, asn_length, *bufp))
  ------------------
  |  Branch (1855:9): [True: 8, False: 1.00k]
  ------------------
 1856|      8|        return NULL;
 1857|       |
 1858|  1.00k|    DEBUGDUMPSETUP("recv", data, bufp - data);
  ------------------
  |  |   83|  1.00k|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  1.00k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	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.00k]
  |  |  ------------------
  ------------------
 1859|  1.00k|    DEBUGMSG(("dumpv_recv", "  Bitstring: "));
  ------------------
  |  |   61|  1.00k|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|  1.00k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 1.00k]
  |  |  ------------------
  ------------------
 1860|  1.00k|    DEBUGMSGHEX(("dumpv_recv", data, asn_length));
  ------------------
  |  |   71|  1.00k|#define DEBUGMSGHEX(x)     do {if (_DBG_IF_) {__DBGMSGHEX(x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  1.00k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGMSGHEX(x)     do {if (_DBG_IF_) {__DBGMSGHEX(x);} }while(0)
  |  |  ------------------
  |  |  |  |  169|      0|#define __DBGMSGHEX(x)     debugmsg_hex x
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 1.00k]
  |  |  ------------------
  ------------------
 1861|  1.00k|    DEBUGMSG(("dumpv_recv", "\n"));
  ------------------
  |  |   61|  1.00k|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|  1.00k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 1.00k]
  |  |  ------------------
  ------------------
 1862|       |
 1863|  1.00k|    memmove(str, bufp, asn_length);
 1864|  1.00k|    *strlength = (int) asn_length;
 1865|  1.00k|    *datalength -= (int) asn_length + (bufp - data);
 1866|  1.00k|    return bufp + asn_length;
 1867|  1.01k|}
asn_parse_unsigned_int64:
 1951|  2.52k|{
 1952|       |    /*
 1953|       |     * ASN.1 integer ::= 0x02 asnlength byte {byte}*
 1954|       |     */
 1955|  2.52k|    static const char *errpre = "parse uint64";
 1956|  2.52k|    const int       uint64sizelimit = (4 * 2) + 1;
 1957|  2.52k|    register u_char *bufp = data;
 1958|  2.52k|    u_char         *endp;
 1959|  2.52k|    u_long          asn_length;
 1960|  2.52k|    register u_long low = 0, high = 0;
 1961|       |
 1962|  2.52k|    if (countersize != sizeof(struct counter64)) {
  ------------------
  |  Branch (1962:9): [True: 0, False: 2.52k]
  ------------------
 1963|      0|        _asn_size_err(errpre, countersize, sizeof(struct counter64));
 1964|      0|        return NULL;
 1965|      0|    }
 1966|       |
 1967|  2.52k|    if (NULL == data || NULL == datalength || NULL == type || NULL == cp) {
  ------------------
  |  Branch (1967:9): [True: 0, False: 2.52k]
  |  Branch (1967:25): [True: 0, False: 2.52k]
  |  Branch (1967:47): [True: 0, False: 2.52k]
  |  Branch (1967:63): [True: 0, False: 2.52k]
  ------------------
 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.52k|    if (*datalength < 2) {
  ------------------
  |  Branch (1973:9): [True: 0, False: 2.52k]
  ------------------
 1974|      0|        _asn_short_err(errpre, *datalength, 2);
 1975|      0|        return NULL;
 1976|      0|    }
 1977|       |
 1978|  2.52k|    *type = *bufp++;
 1979|  2.52k|    if (*type != ASN_COUNTER64
  ------------------
  |  |   99|  5.04k|#define ASN_COUNTER64   (ASN_APPLICATION | 6)
  |  |  ------------------
  |  |  |  |   80|  2.52k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (1979:9): [True: 855, False: 1.66k]
  ------------------
 1980|    855|#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
 1981|    855|            && *type != ASN_OPAQUE
  ------------------
  |  |   93|    855|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   80|    855|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (1981:16): [True: 5, False: 850]
  ------------------
 1982|  2.52k|#endif
 1983|  2.52k|            ) {
 1984|      5|        _asn_type_err(errpre, *type);
 1985|      5|        return NULL;
 1986|      5|    }
 1987|  2.51k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
 1988|  2.51k|    if (NULL == bufp) {
  ------------------
  |  Branch (1988:9): [True: 0, False: 2.51k]
  ------------------
 1989|      0|        _asn_short_err(errpre, *datalength - 1, asn_length);
 1990|      0|        return NULL;
 1991|      0|    }
 1992|  2.51k|    endp = bufp + asn_length;
 1993|       |
 1994|  2.51k|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|  2.51k|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.51k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.51k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	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.51k]
  |  |  ------------------
  ------------------
 1995|  2.51k|#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
 1996|       |    /** need at least 2 bytes: ASN_OPAQUE_TAG1 and ASN_OPAQUE_<type> */
 1997|  2.51k|    if ((*type == ASN_OPAQUE) && (asn_length < 2)) {
  ------------------
  |  |   93|  2.51k|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   80|  2.51k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (1997:9): [True: 850, False: 1.66k]
  |  Branch (1997:34): [True: 0, False: 850]
  ------------------
 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.51k|    if ((*type == ASN_OPAQUE) &&
  ------------------
  |  |   93|  2.51k|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   80|  2.51k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (2005:9): [True: 850, False: 1.66k]
  ------------------
 2006|    850|        (asn_length <= ASN_OPAQUE_COUNTER64_MX_BER_LEN) &&
  ------------------
  |  |  149|    850|#define ASN_OPAQUE_COUNTER64_MX_BER_LEN 12
  ------------------
  |  Branch (2006:9): [True: 840, False: 10]
  ------------------
 2007|    840|        (*bufp == ASN_OPAQUE_TAG1) &&
  ------------------
  |  |  120|    840|#define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   81|    840|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   88|    840|#define ASN_EXTENSION_ID    0x1FU
  |  |  ------------------
  ------------------
  |  Branch (2007:9): [True: 840, False: 0]
  ------------------
 2008|    840|        ((*(bufp + 1) == ASN_OPAQUE_COUNTER64) ||
  ------------------
  |  |  145|    840|#define ASN_OPAQUE_COUNTER64 (ASN_OPAQUE_TAG2 + ASN_APP_COUNTER64)
  |  |  ------------------
  |  |  |  |  125|    840|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_COUNTER64 (ASN_OPAQUE_TAG2 + ASN_APP_COUNTER64)
  |  |  ------------------
  |  |  |  |  135|    840|#define ASN_APP_COUNTER64 (ASN_APPLICATION | 6)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|    840|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2008:10): [True: 426, False: 414]
  ------------------
 2009|    840|         (*(bufp + 1) == ASN_OPAQUE_U64))) {
  ------------------
  |  |  181|    414|#define ASN_OPAQUE_U64 (ASN_OPAQUE_TAG2 + ASN_APP_U64)
  |  |  ------------------
  |  |  |  |  125|    414|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_U64 (ASN_OPAQUE_TAG2 + ASN_APP_U64)
  |  |  ------------------
  |  |  |  |  139|    414|#define ASN_APP_U64 (ASN_APPLICATION | 11)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|    414|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2009:10): [True: 414, False: 0]
  ------------------
 2010|    840|        size_t          outer_length = asn_length - 2;
 2011|       |
 2012|       |        /*
 2013|       |         * change type to Counter64 or U64 
 2014|       |         */
 2015|    840|        *type = *(bufp + 1);
 2016|       |        /*
 2017|       |         * value is encoded as special format 
 2018|       |         */
 2019|    840|        bufp = asn_parse_nlength(bufp + 2, outer_length, &asn_length);
 2020|    840|        if (NULL == bufp) {
  ------------------
  |  Branch (2020:13): [True: 0, False: 840]
  ------------------
 2021|      0|            _asn_short_err("parse opaque uint64", outer_length, asn_length);
 2022|      0|            return NULL;
 2023|      0|        }
 2024|    840|    }
 2025|  2.51k|#endif                          /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
 2026|  2.51k|    if (((int) asn_length > uint64sizelimit) ||
  ------------------
  |  Branch (2026:9): [True: 13, False: 2.50k]
  ------------------
 2027|  2.50k|        (((int) asn_length == uint64sizelimit) && *bufp != 0x00)) {
  ------------------
  |  Branch (2027:10): [True: 612, False: 1.89k]
  |  Branch (2027:51): [True: 10, False: 602]
  ------------------
 2028|     23|        _asn_length_err(errpre, (size_t) asn_length, uint64sizelimit);
 2029|     23|        return NULL;
 2030|     23|    }
 2031|  2.49k|    *datalength -= endp - data;
 2032|  9.10k|    while (asn_length--) {
  ------------------
  |  Branch (2032:12): [True: 6.61k, False: 2.49k]
  ------------------
 2033|  6.61k|        high = ((0x00FFFFFF & high) << 8) | ((low & 0xFF000000U) >> 24);
 2034|  6.61k|        low = ((low & 0x00FFFFFF) << 8) | *bufp++;
 2035|  6.61k|    }
 2036|  2.49k|    bufp = endp;
 2037|       |
 2038|  2.49k|    CHECK_OVERFLOW_U(high,6);
  ------------------
  |  |  224|  2.49k|#define CHECK_OVERFLOW_U(x,y) do {                                      \
  |  |  225|  2.49k|        if (x > UINT32_MAX) {                                           \
  |  |  ------------------
  |  |  |  Branch (225:13): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  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.49k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (229:13): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
 2039|  2.49k|    CHECK_OVERFLOW_U(low,6);
  ------------------
  |  |  224|  2.49k|#define CHECK_OVERFLOW_U(x,y) do {                                      \
  |  |  225|  2.49k|        if (x > UINT32_MAX) {                                           \
  |  |  ------------------
  |  |  |  Branch (225:13): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  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.49k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (229:13): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
 2040|       |
 2041|  2.49k|    cp->low = low;
 2042|  2.49k|    cp->high = high;
 2043|       |
 2044|  2.49k|    DEBUGIF("dumpv_recv") {
  ------------------
  |  |  145|  2.49k|#define DEBUGIF(x)         if (_DBG_IF_ && debug_is_token_registered(x) == SNMPERR_SUCCESS)
  |  |  ------------------
  |  |  |  |  144|  4.98k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #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.49k|    return bufp;
 2051|  2.51k|}
asn_parse_signed_int64:
 2228|  1.34k|{
 2229|  1.34k|    static const char *errpre = "parse int64";
 2230|  1.34k|    const int       int64sizelimit = (4 * 2) + 1;
 2231|  1.34k|    char            ebuf[128];
 2232|  1.34k|    register u_char *bufp = data;
 2233|  1.34k|    u_char         *endp;
 2234|  1.34k|    u_long          asn_length;
 2235|  1.34k|    register u_int  low = 0, high = 0;
 2236|       |
 2237|  1.34k|    if (countersize != sizeof(struct counter64)) {
  ------------------
  |  Branch (2237:9): [True: 0, False: 1.34k]
  ------------------
 2238|      0|        _asn_size_err(errpre, countersize, sizeof(struct counter64));
 2239|      0|        return NULL;
 2240|      0|    }
 2241|       |
 2242|  1.34k|    if (NULL == data || NULL == datalength || NULL == type || NULL == cp) {
  ------------------
  |  Branch (2242:9): [True: 0, False: 1.34k]
  |  Branch (2242:25): [True: 0, False: 1.34k]
  |  Branch (2242:47): [True: 0, False: 1.34k]
  |  Branch (2242:63): [True: 0, False: 1.34k]
  ------------------
 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.34k|    if (*datalength < 2) {
  ------------------
  |  Branch (2248:9): [True: 0, False: 1.34k]
  ------------------
 2249|      0|        _asn_short_err(errpre, *datalength, 2);
 2250|      0|        return NULL;
 2251|      0|    }
 2252|       |
 2253|  1.34k|    *type = *bufp++;
 2254|  1.34k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
 2255|  1.34k|    if (NULL == bufp) {
  ------------------
  |  Branch (2255:9): [True: 0, False: 1.34k]
  ------------------
 2256|      0|        _asn_short_err(errpre, *datalength - 1, asn_length);
 2257|      0|        return NULL;
 2258|      0|    }
 2259|  1.34k|    endp = bufp + asn_length;
 2260|       |
 2261|       |    /** need at least 2 bytes: ASN_OPAQUE_TAG1 and ASN_OPAQUE_I64 */
 2262|  1.34k|    if (asn_length < 2) {
  ------------------
  |  Branch (2262:9): [True: 10, False: 1.33k]
  ------------------
 2263|     10|        _asn_short_err(errpre, asn_length, 2);
 2264|     10|        return NULL;
 2265|     10|    }
 2266|       |
 2267|  1.33k|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|  1.33k|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  1.33k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1.33k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	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.33k]
  |  |  ------------------
  ------------------
 2268|  1.33k|    if ((*type == ASN_OPAQUE) &&
  ------------------
  |  |   93|  1.33k|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   80|  1.33k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (2268:9): [True: 1.32k, False: 12]
  ------------------
 2269|  1.32k|        (asn_length <= ASN_OPAQUE_COUNTER64_MX_BER_LEN) &&
  ------------------
  |  |  149|  1.32k|#define ASN_OPAQUE_COUNTER64_MX_BER_LEN 12
  ------------------
  |  Branch (2269:9): [True: 1.31k, False: 13]
  ------------------
 2270|  1.31k|        (*bufp == ASN_OPAQUE_TAG1) && (*(bufp + 1) == ASN_OPAQUE_I64)) {
  ------------------
  |  |  120|  1.31k|#define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   81|  1.31k|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   88|  1.31k|#define ASN_EXTENSION_ID    0x1FU
  |  |  ------------------
  ------------------
                      (*bufp == ASN_OPAQUE_TAG1) && (*(bufp + 1) == ASN_OPAQUE_I64)) {
  ------------------
  |  |  172|  1.31k|#define ASN_OPAQUE_I64 (ASN_OPAQUE_TAG2 + ASN_APP_I64)
  |  |  ------------------
  |  |  |  |  125|  1.31k|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_I64 (ASN_OPAQUE_TAG2 + ASN_APP_I64)
  |  |  ------------------
  |  |  |  |  138|  1.31k|#define ASN_APP_I64 (ASN_APPLICATION | 10)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  1.31k|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2270:9): [True: 1.31k, False: 0]
  |  Branch (2270:39): [True: 1.31k, False: 0]
  ------------------
 2271|  1.31k|        size_t          outer_length = asn_length - 2;
 2272|       |
 2273|       |        /*
 2274|       |         * change type to Int64 
 2275|       |         */
 2276|  1.31k|        *type = *(bufp + 1);
 2277|       |        /*
 2278|       |         * value is encoded as special format 
 2279|       |         */
 2280|  1.31k|        bufp = asn_parse_nlength(bufp + 2, outer_length, &asn_length);
 2281|  1.31k|        if (NULL == bufp) {
  ------------------
  |  Branch (2281:13): [True: 0, False: 1.31k]
  ------------------
 2282|      0|            _asn_short_err("parse opaque int64", outer_length, asn_length);
 2283|      0|            return NULL;
 2284|      0|        }
 2285|  1.31k|    }
 2286|       |    /*
 2287|       |     * this should always have been true until snmp gets int64 PDU types 
 2288|       |     */
 2289|     25|    else {
 2290|     25|        snprintf(ebuf, sizeof(ebuf),
 2291|     25|                "%s: wrong type: %d, len %d, buf bytes (%02X,%02X)",
 2292|     25|                errpre, *type, (int) asn_length, *bufp, *(bufp + 1));
 2293|     25|        ERROR_MSG(ebuf);
  ------------------
  |  |  188|     25|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
 2294|     25|        return NULL;
 2295|     25|    }
 2296|  1.31k|    if (((int) asn_length > int64sizelimit) ||
  ------------------
  |  Branch (2296:9): [True: 0, False: 1.31k]
  ------------------
 2297|  1.31k|        (((int) asn_length == int64sizelimit) && *bufp != 0x00)) {
  ------------------
  |  Branch (2297:10): [True: 203, False: 1.11k]
  |  Branch (2297:50): [True: 1, False: 202]
  ------------------
 2298|      1|        _asn_length_err(errpre, (size_t) asn_length, int64sizelimit);
 2299|      1|        return NULL;
 2300|      1|    }
 2301|  1.31k|    *datalength -= endp - data;
 2302|  1.31k|    if ((asn_length > 0) && (*bufp & 0x80)) {
  ------------------
  |  Branch (2302:9): [True: 965, False: 347]
  |  Branch (2302:29): [True: 247, False: 718]
  ------------------
 2303|    247|        low = 0xFFFFFFFFU;   /* first byte bit 1 means start the data with 1s */
 2304|    247|        high = 0xFFFFFFFFU;
 2305|    247|    }
 2306|       |
 2307|  4.27k|    for ( ; asn_length; asn_length--) {
  ------------------
  |  Branch (2307:13): [True: 2.96k, False: 1.31k]
  ------------------
 2308|  2.96k|        high = ((0x00FFFFFF & high) << 8) | ((low & 0xFF000000U) >> 24);
 2309|  2.96k|        low = ((low & 0x00FFFFFF) << 8) | *bufp++;
 2310|  2.96k|    }
 2311|  1.31k|    bufp = endp;
 2312|       |
 2313|  1.31k|    CHECK_OVERFLOW_U(high,8);
  ------------------
  |  |  224|  1.31k|#define CHECK_OVERFLOW_U(x,y) do {                                      \
  |  |  225|  1.31k|        if (x > UINT32_MAX) {                                           \
  |  |  ------------------
  |  |  |  Branch (225:13): [True: 0, False: 1.31k]
  |  |  ------------------
  |  |  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.31k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (229:13): [Folded, False: 1.31k]
  |  |  ------------------
  ------------------
 2314|  1.31k|    CHECK_OVERFLOW_U(low,8);
  ------------------
  |  |  224|  1.31k|#define CHECK_OVERFLOW_U(x,y) do {                                      \
  |  |  225|  1.31k|        if (x > UINT32_MAX) {                                           \
  |  |  ------------------
  |  |  |  Branch (225:13): [True: 0, False: 1.31k]
  |  |  ------------------
  |  |  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.31k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (229:13): [Folded, False: 1.31k]
  |  |  ------------------
  ------------------
 2315|       |
 2316|  1.31k|    cp->low = low;
 2317|  1.31k|    cp->high = high;
 2318|       |
 2319|  1.31k|    DEBUGIF("dumpv_recv") {
  ------------------
  |  |  145|  1.31k|#define DEBUGIF(x)         if (_DBG_IF_ && debug_is_token_registered(x) == SNMPERR_SUCCESS)
  |  |  ------------------
  |  |  |  |  144|  2.62k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1.31k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #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.31k|    return bufp;
 2326|  1.31k|}
asn_parse_float:
 2449|    932|{
 2450|    932|    static const char *errpre = "parse float";
 2451|    932|    register u_char *bufp = data;
 2452|    932|    u_long          asn_length;
 2453|    932|    union {
 2454|    932|        float           floatVal;
 2455|    932|        long            longVal;
 2456|    932|        u_char          c[sizeof(float)];
 2457|    932|    } fu;
 2458|       |
 2459|    932|    if (floatsize != sizeof(float)) {
  ------------------
  |  Branch (2459:9): [True: 0, False: 932]
  ------------------
 2460|      0|        _asn_size_err("parse float", floatsize, sizeof(float));
 2461|      0|        return NULL;
 2462|      0|    }
 2463|       |
 2464|    932|    if (NULL == data || NULL == datalength || NULL == type || NULL == floatp) {
  ------------------
  |  Branch (2464:9): [True: 0, False: 932]
  |  Branch (2464:25): [True: 0, False: 932]
  |  Branch (2464:47): [True: 0, False: 932]
  |  Branch (2464:63): [True: 0, False: 932]
  ------------------
 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|    932|    if (*datalength < 2) {
  ------------------
  |  Branch (2470:9): [True: 0, False: 932]
  ------------------
 2471|      0|        _asn_short_err(errpre, *datalength, 2);
 2472|      0|        return NULL;
 2473|      0|    }
 2474|       |
 2475|    932|    *type = *bufp++;
 2476|    932|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
 2477|    932|    if (NULL == bufp) {
  ------------------
  |  Branch (2477:9): [True: 0, False: 932]
  ------------------
 2478|      0|        _asn_short_err(errpre, *datalength - 1, asn_length);
 2479|      0|        return NULL;
 2480|      0|    }
 2481|       |
 2482|    932|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|    932|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|    932|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 932]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	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: 932]
  |  |  ------------------
  ------------------
 2483|       |    /*
 2484|       |     * the float is encoded as an opaque 
 2485|       |     */
 2486|    932|    if ((*type == ASN_OPAQUE) &&
  ------------------
  |  |   93|    932|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   80|    932|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (2486:9): [True: 386, False: 546]
  ------------------
 2487|    386|        (asn_length == ASN_OPAQUE_FLOAT_BER_LEN) &&
  ------------------
  |  |  158|    386|#define ASN_OPAQUE_FLOAT_BER_LEN 7
  ------------------
  |  Branch (2487:9): [True: 375, False: 11]
  ------------------
 2488|    375|        (*bufp == ASN_OPAQUE_TAG1) && (*(bufp + 1) == ASN_OPAQUE_FLOAT)) {
  ------------------
  |  |  120|    375|#define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   81|    375|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   88|    375|#define ASN_EXTENSION_ID    0x1FU
  |  |  ------------------
  ------------------
                      (*bufp == ASN_OPAQUE_TAG1) && (*(bufp + 1) == ASN_OPAQUE_FLOAT)) {
  ------------------
  |  |  154|    375|#define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  125|    375|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  136|    375|#define ASN_APP_FLOAT (ASN_APPLICATION | 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|    375|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2488:9): [True: 375, False: 0]
  |  Branch (2488:39): [True: 375, False: 0]
  ------------------
 2489|    375|        size_t          outer_length = asn_length - 2;
 2490|       |
 2491|       |        /*
 2492|       |         * value is encoded as special format 
 2493|       |         */
 2494|    375|        bufp = asn_parse_nlength(bufp + 2, outer_length, &asn_length);
 2495|    375|        if (NULL == bufp) {
  ------------------
  |  Branch (2495:13): [True: 0, False: 375]
  ------------------
 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|    375|        *type = ASN_OPAQUE_FLOAT;
  ------------------
  |  |  154|    375|#define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  125|    375|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  136|    375|#define ASN_APP_FLOAT (ASN_APPLICATION | 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|    375|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2503|    375|    }
 2504|       |
 2505|    932|    if (*type != ASN_OPAQUE_FLOAT) {
  ------------------
  |  |  154|    932|#define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  125|    932|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_FLOAT (ASN_OPAQUE_TAG2 + ASN_APP_FLOAT)
  |  |  ------------------
  |  |  |  |  136|    932|#define ASN_APP_FLOAT (ASN_APPLICATION | 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|    932|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2505:9): [True: 11, False: 921]
  ------------------
 2506|     11|        _asn_type_err(errpre, *type);
 2507|     11|        return NULL;
 2508|     11|    }
 2509|       |
 2510|    921|    if (asn_length != sizeof(float)) {
  ------------------
  |  Branch (2510:9): [True: 23, False: 898]
  ------------------
 2511|     23|        _asn_size_err("parse seq float", asn_length, sizeof(float));
 2512|     23|        return NULL;
 2513|     23|    }
 2514|       |
 2515|    898|    *datalength -= (int) asn_length + (bufp - data);
 2516|    898|    memcpy(&fu.c[0], bufp, asn_length);
 2517|    898|    bufp += asn_length;
 2518|       |
 2519|       |    /*
 2520|       |     * correct for endian differences 
 2521|       |     */
 2522|    898|    fu.longVal = ntohl(fu.longVal);
 2523|       |
 2524|    898|    *floatp = fu.floatVal;
 2525|       |
 2526|    898|    DEBUGMSG(("dumpv_recv", "Opaque float: %f\n", *floatp));
  ------------------
  |  |   61|    898|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|    898|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 898]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 898]
  |  |  ------------------
  ------------------
 2527|    898|    return bufp;
 2528|    921|}
asn_parse_double:
 2633|  1.03k|{
 2634|  1.03k|    static const char *errpre = "parse double";
 2635|  1.03k|    register u_char *bufp = data;
 2636|  1.03k|    u_long          asn_length;
 2637|  1.03k|    long            tmp;
 2638|  1.03k|    union {
 2639|  1.03k|        double          doubleVal;
 2640|  1.03k|        int             intVal[2];
 2641|  1.03k|        u_char          c[sizeof(double)];
 2642|  1.03k|    } fu;
 2643|       |
 2644|       |
 2645|  1.03k|    if (doublesize != sizeof(double)) {
  ------------------
  |  Branch (2645:9): [True: 0, False: 1.03k]
  ------------------
 2646|      0|        _asn_size_err("parse double", doublesize, sizeof(double));
 2647|      0|        return NULL;
 2648|      0|    }
 2649|       |
 2650|  1.03k|    if (NULL == data || NULL == datalength || NULL == type || NULL == doublep) {
  ------------------
  |  Branch (2650:9): [True: 0, False: 1.03k]
  |  Branch (2650:25): [True: 0, False: 1.03k]
  |  Branch (2650:47): [True: 0, False: 1.03k]
  |  Branch (2650:63): [True: 0, False: 1.03k]
  ------------------
 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|  1.03k|    if (*datalength < 2) {
  ------------------
  |  Branch (2656:9): [True: 0, False: 1.03k]
  ------------------
 2657|      0|        _asn_short_err(errpre, *datalength, 2);
 2658|      0|        return NULL;
 2659|      0|    }
 2660|       |
 2661|  1.03k|    *type = *bufp++;
 2662|  1.03k|    bufp = asn_parse_nlength(bufp, *datalength - 1, &asn_length);
 2663|  1.03k|    if (NULL == bufp) {
  ------------------
  |  Branch (2663:9): [True: 0, False: 1.03k]
  ------------------
 2664|      0|        _asn_short_err(errpre, *datalength - 1, asn_length);
 2665|      0|        return NULL;
 2666|      0|    }
 2667|       |
 2668|  1.03k|    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);
  ------------------
  |  |   83|  1.03k|	do {if (_DBG_IF_) {__DBGDUMPSETUP(token,buf,len);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  1.03k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 1.03k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	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.03k]
  |  |  ------------------
  ------------------
 2669|       |    /*
 2670|       |     * the double is encoded as an opaque 
 2671|       |     */
 2672|       |    /** need at least 2 bytes: ASN_OPAQUE_TAG1 and ASN_OPAQUE_DOUBLE */
 2673|  1.03k|    if ((*type == ASN_OPAQUE) && (asn_length < 2)) {
  ------------------
  |  |   93|  1.03k|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   80|  1.03k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (2673:9): [True: 262, False: 776]
  |  Branch (2673:34): [True: 0, False: 262]
  ------------------
 2674|      0|        _asn_short_err(errpre, asn_length, 2);
 2675|      0|        return NULL;
 2676|      0|    }
 2677|  1.03k|    if ((*type == ASN_OPAQUE) &&
  ------------------
  |  |   93|  1.03k|#define ASN_OPAQUE	(ASN_APPLICATION | 4)   /* changed so no conflict with other includes */
  |  |  ------------------
  |  |  |  |   80|  1.03k|#define ASN_APPLICATION     0x40U
  |  |  ------------------
  ------------------
  |  Branch (2677:9): [True: 262, False: 776]
  ------------------
 2678|    262|        (asn_length == ASN_OPAQUE_DOUBLE_BER_LEN) &&
  ------------------
  |  |  167|    262|#define ASN_OPAQUE_DOUBLE_BER_LEN 11
  ------------------
  |  Branch (2678:9): [True: 244, False: 18]
  ------------------
 2679|    244|        (*bufp == ASN_OPAQUE_TAG1) && (*(bufp + 1) == ASN_OPAQUE_DOUBLE)) {
  ------------------
  |  |  120|    244|#define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   81|    244|#define ASN_CONTEXT	    0x80U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_TAG1 (ASN_CONTEXT | ASN_EXTENSION_ID)
  |  |  ------------------
  |  |  |  |   88|    244|#define ASN_EXTENSION_ID    0x1FU
  |  |  ------------------
  ------------------
                      (*bufp == ASN_OPAQUE_TAG1) && (*(bufp + 1) == ASN_OPAQUE_DOUBLE)) {
  ------------------
  |  |  163|    244|#define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  125|    244|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  137|    244|#define ASN_APP_DOUBLE (ASN_APPLICATION | 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|    244|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2679:9): [True: 244, False: 0]
  |  Branch (2679:39): [True: 244, False: 0]
  ------------------
 2680|    244|        size_t          outer_length = asn_length - 2;
 2681|       |
 2682|       |        /*
 2683|       |         * value is encoded as special format 
 2684|       |         */
 2685|    244|        bufp = asn_parse_nlength(bufp + 2, outer_length, &asn_length);
 2686|    244|        if (NULL == bufp) {
  ------------------
  |  Branch (2686:13): [True: 0, False: 244]
  ------------------
 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|    244|        *type = ASN_OPAQUE_DOUBLE;
  ------------------
  |  |  163|    244|#define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  125|    244|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  137|    244|#define ASN_APP_DOUBLE (ASN_APPLICATION | 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|    244|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2695|    244|    }
 2696|       |
 2697|  1.03k|    if (*type != ASN_OPAQUE_DOUBLE) {
  ------------------
  |  |  163|  1.03k|#define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  125|  1.03k|#define ASN_OPAQUE_TAG2 0x30U
  |  |  ------------------
  |  |               #define ASN_OPAQUE_DOUBLE (ASN_OPAQUE_TAG2 + ASN_APP_DOUBLE)
  |  |  ------------------
  |  |  |  |  137|  1.03k|#define ASN_APP_DOUBLE (ASN_APPLICATION | 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  1.03k|#define ASN_APPLICATION     0x40U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2697:9): [True: 18, False: 1.02k]
  ------------------
 2698|     18|        _asn_type_err(errpre, *type);
 2699|     18|        return NULL;
 2700|     18|    }
 2701|       |
 2702|  1.02k|    if (asn_length != sizeof(double)) {
  ------------------
  |  Branch (2702:9): [True: 26, False: 994]
  ------------------
 2703|     26|        _asn_size_err("parse seq double", asn_length, sizeof(double));
 2704|     26|        return NULL;
 2705|     26|    }
 2706|    994|    *datalength -= (int) asn_length + (bufp - data);
 2707|    994|    memcpy(&fu.c[0], bufp, asn_length);
 2708|    994|    bufp += asn_length;
 2709|       |
 2710|       |    /*
 2711|       |     * correct for endian differences 
 2712|       |     */
 2713|       |
 2714|    994|    tmp = ntohl(fu.intVal[0]);
 2715|    994|    fu.intVal[0] = ntohl(fu.intVal[1]);
 2716|    994|    fu.intVal[1] = tmp;
 2717|       |
 2718|    994|    *doublep = fu.doubleVal;
 2719|    994|    DEBUGMSG(("dumpv_recv", "  Opaque Double:\t%f\n", *doublep));
  ------------------
  |  |   61|    994|#define DEBUGMSG(x)        do {if (_DBG_IF_) {debugmsg x;} }while(0)
  |  |  ------------------
  |  |  |  |  144|    994|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 994]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:67): [Folded, False: 994]
  |  |  ------------------
  ------------------
 2720|       |
 2721|    994|    return bufp;
 2722|  1.02k|}
asn1.c:_asn_size_err:
  242|     49|{
  243|     49|    char            ebuf[128];
  244|       |
  245|     49|    snprintf(ebuf, sizeof(ebuf),
  246|     49|            "%s size %lu: s/b %lu", str,
  247|     49|	    (unsigned long)wrongsize, (unsigned long)rightsize);
  248|     49|    ERROR_MSG(ebuf);
  ------------------
  |  |  188|     49|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  249|     49|}
asn1.c:_asn_short_err:
  299|  2.29k|{
  300|  2.29k|    char            ebuf[128];
  301|       |
  302|  2.29k|    snprintf(ebuf, sizeof(ebuf), "%s length %lu too short: need %lu", str,
  303|  2.29k|	    (unsigned long)wrongsize, (unsigned long)rightsize);
  304|  2.29k|    ERROR_MSG(ebuf);
  ------------------
  |  |  188|  2.29k|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  305|  2.29k|}
asn1.c:_asn_type_err:
  261|    532|{
  262|    532|    char            ebuf[128];
  263|       |
  264|    532|    snprintf(ebuf, sizeof(ebuf), "%s type %d", str, wrongtype);
  265|    532|    ebuf[ sizeof(ebuf)-1 ] = 0;
  266|    532|    ERROR_MSG(ebuf);
  ------------------
  |  |  188|    532|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  267|    532|}
asn1.c:_asn_length_err:
  280|    144|{
  281|    144|    char            ebuf[128];
  282|       |
  283|    144|    snprintf(ebuf, sizeof(ebuf),
  284|    144|            "%s length %lu too large: exceeds %lu", str,
  285|    144|	    (unsigned long)wrongsize, (unsigned long)rightsize);
  286|    144|    ERROR_MSG(ebuf);
  ------------------
  |  |  188|    144|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  287|    144|}
asn1.c:_asn_bitstring_check:
  515|  1.01k|{
  516|  1.01k|    char            ebuf[128];
  517|       |
  518|  1.01k|    if (asn_length < 1) {
  ------------------
  |  Branch (518:9): [True: 8, False: 1.00k]
  ------------------
  519|      8|        snprintf(ebuf, sizeof(ebuf),
  520|      8|                "%s: length %d too small", str, (int) asn_length);
  521|      8|        ERROR_MSG(ebuf);
  ------------------
  |  |  188|      8|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  522|      8|        return 1;
  523|      8|    }
  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|  1.00k|    return 0;
  532|  1.01k|}

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

snmp_parse_var_op:
  161|  17.6k|{
  162|  17.6k|    u_char          var_op_type;
  163|  17.6k|    size_t          var_op_len = *listlength;
  164|  17.6k|    u_char         *var_op_start = data;
  165|       |
  166|  17.6k|    data = asn_parse_sequence(data, &var_op_len, &var_op_type,
  167|  17.6k|                              (ASN_SEQUENCE | ASN_CONSTRUCTOR), "var_op");
  ------------------
  |  |   73|  17.6k|#define ASN_SEQUENCE	    0x10U
  ------------------
                                            (ASN_SEQUENCE | ASN_CONSTRUCTOR), "var_op");
  ------------------
  |  |   85|  17.6k|#define ASN_CONSTRUCTOR	    0x20U
  ------------------
  168|  17.6k|    if (data == NULL) {
  ------------------
  |  Branch (168:9): [True: 298, False: 17.3k]
  ------------------
  169|       |        /*
  170|       |         * msg detail is set 
  171|       |         */
  172|    298|        return NULL;
  173|    298|    }
  174|  17.3k|    DEBUGDUMPHEADER("recv", "Name");
  ------------------
  |  |   79|  17.3k|	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  17.3k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 17.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	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: 17.3k]
  |  |  ------------------
  ------------------
  175|  17.3k|    data =
  176|  17.3k|        asn_parse_objid(data, &var_op_len, &var_op_type, var_name,
  177|  17.3k|                        var_name_len);
  178|  17.3k|    DEBUGINDENTLESS();
  ------------------
  |  |   75|  17.3k|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|  17.3k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 17.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 17.3k]
  |  |  ------------------
  ------------------
  179|  17.3k|    if (data == NULL) {
  ------------------
  |  Branch (179:9): [True: 47, False: 17.2k]
  ------------------
  180|     47|        ERROR_MSG("No OID for variable");
  ------------------
  |  |  188|     47|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  181|     47|        return NULL;
  182|     47|    }
  183|  17.2k|    if (var_op_type !=
  ------------------
  |  Branch (183:9): [True: 0, False: 17.2k]
  ------------------
  184|  17.2k|        (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID))
  ------------------
  |  |   79|  17.2k|#define ASN_UNIVERSAL	    0x00U
  ------------------
                      (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID))
  ------------------
  |  |   84|  17.2k|#define ASN_PRIMITIVE	    0x00U
  ------------------
                      (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID))
  ------------------
  |  |   70|  17.2k|#define ASN_OBJECT_ID	    0x06U
  ------------------
  185|      0|        return NULL;
  186|  17.2k|    *var_val = data;            /* save pointer to this object */
  187|       |    /*
  188|       |     * find out what type of object this is 
  189|       |     */
  190|  17.2k|    data = asn_parse_header(data, &var_op_len, var_val_type);
  191|  17.2k|    if (data == NULL) {
  ------------------
  |  Branch (191:9): [True: 20, False: 17.2k]
  ------------------
  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|  17.2k|    *var_val_len = var_op_len;
  199|  17.2k|    data += var_op_len;
  200|  17.2k|    *listlength -= (int) (data - var_op_start);
  201|  17.2k|    return data;
  202|  17.2k|}

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

snmp_comstr_parse:
  109|  2.62k|{
  110|  2.62k|    u_char          type;
  111|  2.62k|    long            ver;
  112|  2.62k|    size_t          origlen = *slen;
  113|       |
  114|       |    /*
  115|       |     * Message is an ASN.1 SEQUENCE.
  116|       |     */
  117|  2.62k|    data = asn_parse_sequence(data, length, &type,
  118|  2.62k|                              (ASN_SEQUENCE | ASN_CONSTRUCTOR),
  ------------------
  |  |   73|  2.62k|#define ASN_SEQUENCE	    0x10U
  ------------------
                                            (ASN_SEQUENCE | ASN_CONSTRUCTOR),
  ------------------
  |  |   85|  2.62k|#define ASN_CONSTRUCTOR	    0x20U
  ------------------
  119|  2.62k|                              "auth message");
  120|  2.62k|    if (data == NULL) {
  ------------------
  |  Branch (120:9): [True: 276, False: 2.34k]
  ------------------
  121|    276|        return NULL;
  122|    276|    }
  123|       |
  124|       |    /*
  125|       |     * First field is the version.
  126|       |     */
  127|  2.34k|    DEBUGDUMPHEADER("recv", "SNMP version");
  ------------------
  |  |   79|  2.34k|	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.34k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.34k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	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.34k]
  |  |  ------------------
  ------------------
  128|  2.34k|    data = asn_parse_int(data, length, &type, &ver, sizeof(ver));
  129|  2.34k|    DEBUGINDENTLESS();
  ------------------
  |  |   75|  2.34k|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.34k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.34k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 2.34k]
  |  |  ------------------
  ------------------
  130|  2.34k|    *version = ver;
  131|  2.34k|    if (data == NULL) {
  ------------------
  |  Branch (131:9): [True: 177, False: 2.16k]
  ------------------
  132|    177|        ERROR_MSG("bad parse of version");
  ------------------
  |  |  188|    177|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  133|    177|        return NULL;
  134|    177|    }
  135|       |
  136|       |    /*
  137|       |     * second field is the community string for SNMPv1 & SNMPv2c 
  138|       |     */
  139|  2.16k|    DEBUGDUMPHEADER("recv", "community string");
  ------------------
  |  |   79|  2.16k|	do {if (_DBG_IF_) {__DBGDUMPHEADER(token,x);} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.16k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.16k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	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.16k]
  |  |  ------------------
  ------------------
  140|  2.16k|    data = asn_parse_string(data, length, &type, psid, slen);
  141|  2.16k|    DEBUGINDENTLESS();
  ------------------
  |  |   75|  2.16k|#define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  144|  2.16k|#define _DBG_IF_            snmp_get_do_debugging()
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:29): [True: 0, False: 2.16k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DEBUGINDENTLESS()  do {if (_DBG_IF_) {__DBGINDENTLESS();} }while(0)
  |  |  ------------------
  |  |  |  |  174|      0|#define __DBGINDENTLESS()  debug_indent_add(-2)
  |  |  ------------------
  |  |  |  Branch (75:74): [Folded, False: 2.16k]
  |  |  ------------------
  ------------------
  142|  2.16k|    if (data == NULL) {
  ------------------
  |  Branch (142:9): [True: 721, False: 1.44k]
  ------------------
  143|    721|        ERROR_MSG("bad parse of community");
  ------------------
  |  |  188|    721|#define ERROR_MSG(string)	snmp_set_detail(string)
  ------------------
  144|    721|        return NULL;
  145|    721|    }
  146|  1.44k|    psid[SNMP_MIN(*slen, origlen - 1)] = '\0';
  ------------------
  |  |  111|  1.44k|#define SNMP_MIN(a,b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (111:24): [True: 2, False: 1.44k]
  |  |  ------------------
  ------------------
  147|  1.44k|    return (u_char *) data;
  148|       |
  149|  2.16k|}                               /* end snmp_comstr_parse() */

snmp_set_var_objid:
  700|  17.2k|{
  701|  17.2k|    size_t          len = sizeof(oid) * name_length;
  702|       |
  703|  17.2k|    if (vp->name != vp->name_loc && vp->name != NULL) {
  ------------------
  |  Branch (703:9): [True: 17.2k, False: 0]
  |  Branch (703:37): [True: 0, False: 17.2k]
  ------------------
  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|  17.2k|    if (len <= sizeof(vp->name_loc)) {
  ------------------
  |  Branch (714:9): [True: 17.2k, False: 0]
  ------------------
  715|  17.2k|        vp->name = vp->name_loc;
  716|  17.2k|    } 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|  17.2k|    if (objid)
  ------------------
  |  Branch (721:9): [True: 17.2k, False: 0]
  ------------------
  722|  17.2k|        memmove(vp->name, objid, len);
  723|  17.2k|    vp->name_length = name_length;
  724|  17.2k|    return 0;
  725|  17.2k|}

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

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

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.30k|{
  161|  5.30k|    struct snmp_secmod_list *sptr;
  162|       |
  163|  10.6k|    for (sptr = registered_services; sptr; sptr = sptr->next) {
  ------------------
  |  Branch (163:38): [True: 5.30k, False: 5.30k]
  ------------------
  164|  5.30k|        if (sptr->securityModel == secmod) {
  ------------------
  |  Branch (164:13): [True: 0, False: 5.30k]
  ------------------
  165|      0|            return sptr->secDef;
  166|      0|        }
  167|  5.30k|    }
  168|       |    /*
  169|       |     * not registered 
  170|       |     */
  171|  5.30k|    return NULL;
  172|  5.30k|}

netsnmp_memdup:
  278|  1.83k|{
  279|  1.83k|    void *to = NULL;
  280|       |
  281|  1.83k|    if (from) {
  ------------------
  |  Branch (281:9): [True: 1.83k, False: 0]
  ------------------
  282|  1.83k|        to = malloc(size);
  283|  1.83k|        if (to)
  ------------------
  |  Branch (283:13): [True: 1.83k, False: 0]
  ------------------
  284|  1.83k|            memcpy(to, from, size);
  285|  1.83k|    }
  286|  1.83k|    return to;
  287|  1.83k|}                               /* 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.62k|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   58|  2.62k|    size_t bytes_remaining = size;
   59|  2.62k|    netsnmp_pdu *pdu = SNMP_MALLOC_TYPEDEF(netsnmp_pdu);
  ------------------
  |  |   73|  2.62k|#define SNMP_MALLOC_TYPEDEF(td)  (td *) calloc(1, sizeof(td))
  ------------------
   60|       |
   61|  2.62k|    netsnmp_session sess = { };
   62|  2.62k|    snmpv3_parse(pdu, NETSNMP_REMOVE_CONST(uint8_t *, data), &bytes_remaining,
  ------------------
  |  |   91|  2.62k|    (__extension__ ({ const t tmp = (e); (t)(size_t)tmp; }))
  ------------------
   63|  2.62k|                 NULL, &sess);
   64|  2.62k|    snmp_free_pdu(pdu);
   65|       |
   66|  2.62k|    pdu = SNMP_MALLOC_TYPEDEF(netsnmp_pdu);
  ------------------
  |  |   73|  2.62k|#define SNMP_MALLOC_TYPEDEF(td)  (td *) calloc(1, sizeof(td))
  ------------------
   67|  2.62k|    memset(&sess, 0, sizeof(sess));
   68|  2.62k|    snmp_parse(NULL, &sess, pdu, NETSNMP_REMOVE_CONST(uint8_t *, data), size);
  ------------------
  |  |   91|  2.62k|    (__extension__ ({ const t tmp = (e); (t)(size_t)tmp; }))
  ------------------
   69|  2.62k|    snmp_free_pdu(pdu);
   70|       |
   71|  2.62k|    return 0;
   72|  2.62k|}

