Ignore:
Timestamp:
Mar 24, 2007 1:00:30 PM (17 years ago)
Author:
bennylp
Message:

ICE (work in progress): implement error codes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/include/pjnath/errno.h

    r1099 r1101  
    2424 
    2525/** 
    26  * @defgroup PJNATH_ERROR NAT Helper Error Codes 
     26 * @defgroup PJNATH_ERROR NAT Helper Library Error Codes 
    2727 * @ingroup PJNATH 
    2828 * @{ 
     
    3636 
    3737 
     38/************************************************************ 
     39 * STUN MESSAGING ERRORS 
     40 ***********************************************************/ 
    3841 
    39 /************************************************************ 
    40  * NEW STUN ERROR 
    41  ***********************************************************/ 
    42 /* Messaging errors */ 
    43 #define PJNATH_ESTUNINATTRLEN       -1 
    44 #define PJNATH_ESTUNINMSGLEN        -1 
    45 #define PJNATH_ESTUNINMSGTYPE       -1 
    46 #define PJNATH_ESTUNFINGERPRINT     -1 
    47 #define PJNATH_ESTUNNOTRESPOND      -1 
    48 #define PJNATH_ESTUNNOXORMAP        -1 
     42/** 
     43 * Map STUN error code (300-699) into pj_status_t error space. 
     44 */ 
     45#define PJ_STATUS_FROM_STUN_CODE(code)  (PJNATH_ERRNO_START+code) 
     46 
     47/** 
     48 * @hideinitializer 
     49 * Invalid STUN message length. 
     50 */ 
     51#define PJNATH_EINSTUNMSGLEN        (PJNATH_ERRNO_START+1)  /* 370001 */ 
     52/** 
     53 * @hideinitializer 
     54 * Invalid or unexpected STUN message type 
     55 */ 
     56#define PJNATH_EINSTUNMSGTYPE       (PJNATH_ERRNO_START+2)  /* 370002 */ 
     57/** 
     58 * @hideinitializer 
     59 * STUN transaction has timed out 
     60 */ 
     61#define PJNATH_ESTUNTIMEDOUT        (PJNATH_ERRNO_START+3)  /* 370003 */ 
     62 
     63 
    4964 
    5065/** 
     
    5267 * Too many STUN attributes. 
    5368 */ 
    54 #define PJNATH_ESTUNTOOMANYATTR     (PJNATH_ERRNO_START+110)/* 370110 */ 
     69#define PJNATH_ESTUNTOOMANYATTR     (PJNATH_ERRNO_START+21) /* 370021 */ 
    5570/** 
    5671 * @hideinitializer 
    57  * Unknown STUN attribute. This error happens when the decoder encounters 
    58  * mandatory attribute type which it doesn't understand. 
     72 * Invalid STUN attribute length. 
    5973 */ 
    60 #define PJNATH_ESTUNUNKNOWNATTR     (PJNATH_ERRNO_START+111)/* 370111 */ 
     74#define PJNATH_ESTUNINATTRLEN       (PJNATH_ERRNO_START+22) /* 370022 */ 
    6175/** 
    6276 * @hideinitializer 
    63  * Invalid STUN socket address length. 
     77 * Found duplicate STUN attribute. 
    6478 */ 
    65 #define PJNATH_ESTUNINADDRLEN       (PJNATH_ERRNO_START+112)/* 370112 */ 
     79#define PJNATH_ESTUNDUPATTR         (PJNATH_ERRNO_START+23) /* 370023 */ 
     80 
     81/** 
     82 * @hideinitializer 
     83 * STUN FINGERPRINT verification failed 
     84 */ 
     85#define PJNATH_ESTUNFINGERPRINT     (PJNATH_ERRNO_START+30) /* 370030 */ 
     86/** 
     87 * @hideinitializer 
     88 * Invalid STUN attribute after MESSAGE-INTEGRITY. 
     89 */ 
     90#define PJNATH_ESTUNMSGINTPOS       (PJNATH_ERRNO_START+31) /* 370031 */ 
     91/** 
     92 * @hideinitializer 
     93 * Invalid STUN attribute after FINGERPRINT. 
     94 */ 
     95#define PJNATH_ESTUNFINGERPOS       (PJNATH_ERRNO_START+33) /* 370033 */ 
     96 
     97 
     98/** 
     99 * @hideinitializer 
     100 * STUN (XOR-)MAPPED-ADDRESS attribute not found 
     101 */ 
     102#define PJNATH_ESTUNNOMAPPEDADDR    (PJNATH_ERRNO_START+40) /* 370040 */ 
    66103/** 
    67104 * @hideinitializer 
    68105 * STUN IPv6 attribute not supported 
    69106 */ 
    70 #define PJNATH_ESTUNIPV6NOTSUPP     (PJNATH_ERRNO_START+113)/* 370113 */ 
    71 /** 
    72  * @hideinitializer 
    73  * Expecting STUN response message. 
    74  */ 
    75 #define PJNATH_ESTUNNOTRESPONSE     (PJNATH_ERRNO_START+114)/* 370114 */ 
    76 /** 
    77  * @hideinitializer 
    78  * STUN transaction ID mismatch. 
    79  */ 
    80 #define PJNATH_ESTUNINVALIDID       (PJNATH_ERRNO_START+115)/* 370115 */ 
    81 /** 
    82  * @hideinitializer 
    83  * Unable to find handler for the request. 
    84  */ 
    85 #define PJNATH_ESTUNNOHANDLER       (PJNATH_ERRNO_START+116)/* 370116 */ 
    86 /** 
    87  * @hideinitializer 
    88  * Found non-FINGERPRINT attribute after MESSAGE-INTEGRITY. This is not 
    89  * valid since MESSAGE-INTEGRITY MUST be the last attribute or the 
    90  * attribute right before FINGERPRINT before the message. 
    91  */ 
    92 #define PJNATH_ESTUNMSGINTPOS       (PJNATH_ERRNO_START+118)/* 370118 */ 
    93 /** 
    94  * @hideinitializer 
    95  * Found attribute after FINGERPRINT. This is not valid since FINGERPRINT 
    96  * MUST be the last attribute in the message. 
    97  */ 
    98 #define PJNATH_ESTUNFINGERPOS       (PJNATH_ERRNO_START+119)/* 370119 */ 
    99 /** 
    100  * @hideinitializer 
    101  * Missing STUN USERNAME attribute. 
    102  * When credential is included in the STUN message (MESSAGE-INTEGRITY is 
    103  * present), the USERNAME attribute must be present in the message. 
    104  */ 
    105 #define PJNATH_ESTUNNOUSERNAME      (PJNATH_ERRNO_START+120)/* 370120 */ 
    106 /** 
    107  * @hideinitializer 
    108  * Unknown STUN username/credential. 
    109  */ 
    110 #define PJNATH_ESTUNUSERNAME        (PJNATH_ERRNO_START+121)/* 370121 */ 
    111 /** 
    112  * @hideinitializer 
    113  * Missing/invalidSTUN MESSAGE-INTEGRITY attribute. 
    114  */ 
    115 #define PJNATH_ESTUNMSGINT          (PJNATH_ERRNO_START+122)/* 370122 */ 
    116 /** 
    117  * @hideinitializer 
    118  * Found duplicate STUN attribute. 
    119  */ 
    120 #define PJNATH_ESTUNDUPATTR         (PJNATH_ERRNO_START+123)/* 370123 */ 
    121 /** 
    122  * @hideinitializer 
    123  * Missing STUN REALM attribute. 
    124  */ 
    125 #define PJNATH_ESTUNNOREALM         (PJNATH_ERRNO_START+124)/* 370124 */ 
    126 /** 
    127  * @hideinitializer 
    128  * Missing/stale STUN NONCE attribute value. 
    129  */ 
    130 #define PJNATH_ESTUNNONCE           (PJNATH_ERRNO_START+125)/* 370125 */ 
    131 /** 
    132  * @hideinitializer 
    133  * STUN transaction terminates with failure. 
    134  */ 
    135 #define PJNATH_ESTUNTSXFAILED       (PJNATH_ERRNO_START+126)/* 370126 */ 
    136 /** 
    137  * @hideinitializer 
    138  * STUN mapped address attribute not found 
    139  */ 
    140 #define PJNATH_ESTUNNOMAPPEDADDR    (PJNATH_ERRNO_START+127)/* 370127 */ 
     107#define PJNATH_ESTUNIPV6NOTSUPP     (PJNATH_ERRNO_START+41) /* 370041 */ 
    141108 
    142109 
    143 //#define PJ_STATUS_FROM_STUN_CODE(code)        (PJNATH_ERRNO_START+code) 
    144110 
     111 
     112/************************************************************ 
     113 * ICE ERROR CODES 
     114 ***********************************************************/ 
    145115 
    146116/** 
    147117 * @hideinitializer 
    148  * No ICE checklist is formed. 
     118 * ICE session not available 
    149119 */ 
    150 #define PJ_EICENOCHECKLIST          -1 
     120#define PJNATH_ENOICE               (PJNATH_ERRNO_START+80) /* 370080 */ 
    151121/** 
    152122 * @hideinitializer 
    153  * No suitable default ICE candidate for the component. 
     123 * ICE check is in progress 
    154124 */ 
    155 #define PJ_EICENOCAND               -1 
     125#define PJNATH_EICEINPROGRESS       (PJNATH_ERRNO_START+81) /* 370081 */ 
     126/** 
     127 * @hideinitializer 
     128 * All ICE checklists failed 
     129 */ 
     130#define PJNATH_EICEFAILED           (PJNATH_ERRNO_START+82) /* 370082 */ 
    156131/** 
    157132 * @hideinitializer 
    158133 * Invalid ICE component ID 
    159134 */ 
    160 #define PJ_EICEINCOMPID             -1 
     135#define PJNATH_EICEINCOMPID         (PJNATH_ERRNO_START+86) /* 370086 */ 
    161136/** 
    162137 * @hideinitializer 
    163138 * Invalid ICE candidate ID 
    164139 */ 
    165 #define PJ_EICEINCANDID             -1 
    166 /** 
    167  * @hideinitializer 
    168  * ICE session not available 
    169  */ 
    170 #define PJ_ENOICE                   -1 
    171 /** 
    172  * @hideinitializer 
    173  * ICE check is in progress 
    174  */ 
    175 #define PJ_EICEINPROGRESS           -1 
     140#define PJNATH_EICEINCANDID         (PJNATH_ERRNO_START+87) /* 370087 */ 
    176141/** 
    177142 * @hideinitializer 
    178143 * Missing ICE SDP attribute 
    179144 */ 
    180 #define PJ_EICEMISSINGSDP           -1 
     145#define PJNATH_EICEMISSINGSDP       (PJNATH_ERRNO_START+90) /* 370090 */ 
    181146/** 
    182147 * @hideinitializer 
    183148 * Invalid SDP "candidate" attribute 
    184149 */ 
    185 #define PJ_EICEINCANDSDP            -1 
     150#define PJNATH_EICEINCANDSDP        (PJNATH_ERRNO_START+91) /* 370091 */ 
    186151 
    187152 
Note: See TracChangeset for help on using the changeset viewer.