Ignore:
Timestamp:
Sep 30, 2006 11:39:17 AM (18 years ago)
Author:
bennylp
Message:

Added initial implementation of low-level DNS packetization
and parsing functions in PJLIB-UTIL/dns.h. Errors codes
added for DNS formatting related errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/include/pjlib-util/errno.h

    r264 r745  
    2626/** 
    2727 * Start of error code relative to PJ_ERRNO_START_USER. 
     28 * This value is 320000. 
    2829 */ 
    2930#define PJLIB_UTIL_ERRNO_START    (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*3) 
     
    3738 * Unable to resolve STUN server 
    3839 */ 
    39 #define PJLIB_UTIL_ESTUNRESOLVE     (PJLIB_UTIL_ERRNO_START+1) 
     40#define PJLIB_UTIL_ESTUNRESOLVE     (PJLIB_UTIL_ERRNO_START+1)  /* 320001 */ 
    4041/** 
    4142 * @hideinitializer 
    4243 * Unknown STUN message type. 
    4344 */ 
    44 #define PJLIB_UTIL_ESTUNINMSGTYPE   (PJLIB_UTIL_ERRNO_START+2) 
     45#define PJLIB_UTIL_ESTUNINMSGTYPE   (PJLIB_UTIL_ERRNO_START+2)  /* 320002 */ 
    4546/** 
    4647 * @hideinitializer 
    4748 * Invalid STUN message length. 
    4849 */ 
    49 #define PJLIB_UTIL_ESTUNINMSGLEN    (PJLIB_UTIL_ERRNO_START+3) 
     50#define PJLIB_UTIL_ESTUNINMSGLEN    (PJLIB_UTIL_ERRNO_START+3)  /* 320003 */ 
    5051/** 
    5152 * @hideinitializer 
    5253 * STUN attribute length error. 
    5354 */ 
    54 #define PJLIB_UTIL_ESTUNINATTRLEN   (PJLIB_UTIL_ERRNO_START+4) 
     55#define PJLIB_UTIL_ESTUNINATTRLEN   (PJLIB_UTIL_ERRNO_START+4)  /* 320004 */ 
    5556/** 
    5657 * @hideinitializer 
    5758 * Invalid STUN attribute type 
    5859 */ 
    59 #define PJLIB_UTIL_ESTUNINATTRTYPE  (PJLIB_UTIL_ERRNO_START+5) 
     60#define PJLIB_UTIL_ESTUNINATTRTYPE  (PJLIB_UTIL_ERRNO_START+5)  /* 320005 */ 
    6061/** 
    6162 * @hideinitializer 
    6263 * Invalid STUN server/socket index 
    6364 */ 
    64 #define PJLIB_UTIL_ESTUNININDEX     (PJLIB_UTIL_ERRNO_START+6) 
     65#define PJLIB_UTIL_ESTUNININDEX     (PJLIB_UTIL_ERRNO_START+6)  /* 320006 */ 
    6566/** 
    6667 * @hideinitializer 
    6768 * No STUN binding response in the message 
    6869 */ 
    69 #define PJLIB_UTIL_ESTUNNOBINDRES   (PJLIB_UTIL_ERRNO_START+7) 
     70#define PJLIB_UTIL_ESTUNNOBINDRES   (PJLIB_UTIL_ERRNO_START+7)  /* 320007 */ 
    7071/** 
    7172 * @hideinitializer 
    7273 * Received STUN error attribute 
    7374 */ 
    74 #define PJLIB_UTIL_ESTUNRECVERRATTR (PJLIB_UTIL_ERRNO_START+8) 
     75#define PJLIB_UTIL_ESTUNRECVERRATTR (PJLIB_UTIL_ERRNO_START+8)  /* 320008 */ 
    7576/** 
    7677 * @hideinitializer 
    7778 * No STUN mapped address attribute 
    7879 */ 
    79 #define PJLIB_UTIL_ESTUNNOMAP       (PJLIB_UTIL_ERRNO_START+9) 
     80#define PJLIB_UTIL_ESTUNNOMAP       (PJLIB_UTIL_ERRNO_START+9)  /* 320009 */ 
    8081/** 
    8182 * @hideinitializer 
    8283 * Received no response from STUN server 
    8384 */ 
    84 #define PJLIB_UTIL_ESTUNNOTRESPOND  (PJLIB_UTIL_ERRNO_START+10) 
     85#define PJLIB_UTIL_ESTUNNOTRESPOND  (PJLIB_UTIL_ERRNO_START+10) /* 320010 */ 
    8586/** 
    8687 * @hideinitializer 
    8788 * Symetric NAT detected by STUN 
    8889 */ 
    89 #define PJLIB_UTIL_ESTUNSYMMETRIC   (PJLIB_UTIL_ERRNO_START+11) 
     90#define PJLIB_UTIL_ESTUNSYMMETRIC   (PJLIB_UTIL_ERRNO_START+11) /* 320011 */ 
    9091 
    9192 
     
    9899 * General invalid XML message. 
    99100 */ 
    100 #define PJLIB_UTIL_EINXML           (PJLIB_UTIL_ERRNO_START+20) 
     101#define PJLIB_UTIL_EINXML           (PJLIB_UTIL_ERRNO_START+20) /* 320020 */ 
     102 
     103 
     104 
     105/************************************************************ 
     106 * DNS ERROR 
     107 ***********************************************************/ 
     108/** 
     109 * @hideinitializer 
     110 * Outgoing DNS query packet buffer is too small. 
     111 * This error occurs when the user supplied buffer for creating DNS 
     112 * query (#pj_dns_make_query() function) is too small. 
     113 */ 
     114#define PJLIB_UTIL_EDNSQRYTOOSMALL  (PJLIB_UTIL_ERRNO_START+40) /* 320040 */ 
     115/** 
     116 * @hideinitializer 
     117 * Invalid packet length in DNS response. 
     118 * This error occurs when the received DNS response packet does not 
     119 * match all the fields length. 
     120 */ 
     121#define PJLIB_UTIL_EDNSINSIZE       (PJLIB_UTIL_ERRNO_START+41) /* 320041 */ 
     122/** 
     123 * @hideinitializer 
     124 * Invalid class in DNS response. 
     125 * This error occurs when the received DNS response contains network 
     126 * class other than IN (Internet). 
     127 */ 
     128#define PJLIB_UTIL_EDNSINCLASS      (PJLIB_UTIL_ERRNO_START+42) /* 320042 */ 
     129/** 
     130 * @hideinitializer 
     131 * Invalid name pointer in DNS response. 
     132 * This error occurs when parsing the compressed names inside DNS 
     133 * response packet, when the name pointer points to an invalid address 
     134 * or the parsing has triggerred too much recursion. 
     135 */ 
     136#define PJLIB_UTIL_EDNSINNAMEPTR    (PJLIB_UTIL_ERRNO_START+43) /* 320043 */ 
     137 
    101138 
    102139 
Note: See TracChangeset for help on using the changeset viewer.