diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-09-30 11:39:17 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-09-30 11:39:17 +0000 |
commit | f21319f288dfd1703311e09b38a21bd552c2b088 (patch) | |
tree | fa15b2fa1df6e577c6a2057c849319dc254e7556 /pjlib | |
parent | f91822a157bb753d4e83d553cb3aa3e4186a33b5 (diff) |
Added initial implementation of low-level DNS packetization
and parsing functions in PJLIB-UTIL/dns.h. Errors codes
added for DNS formatting related errors.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@745 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r-- | pjlib/include/pj/errno.h | 8 | ||||
-rw-r--r-- | pjlib/src/pj/errno.c | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/pjlib/include/pj/errno.h b/pjlib/include/pj/errno.h index 5744a754..03440c2a 100644 --- a/pjlib/include/pj/errno.h +++ b/pjlib/include/pj/errno.h @@ -287,9 +287,15 @@ PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code, #define PJ_ETOOBIG (PJ_ERRNO_START_STATUS + 17)/* 70017 */ /** * @hideinitializer - * Error in gethostbyname() + * Error in gethostbyname(). This is a generic error returned when + * gethostbyname() has returned an error. */ #define PJ_ERESOLVE (PJ_ERRNO_START_STATUS + 18)/* 70018 */ +/** + * @hideinitializer + * Size is too small. + */ +#define PJ_ETOOSMALL (PJ_ERRNO_START_STATUS + 19)/* 70019 */ /** @} */ /* pj_errnum */ diff --git a/pjlib/src/pj/errno.c b/pjlib/src/pj/errno.c index b3a9b329..1d7767f4 100644 --- a/pjlib/src/pj/errno.c +++ b/pjlib/src/pj/errno.c @@ -65,6 +65,7 @@ static const struct PJ_BUILD_ERR(PJ_EEOF, "End of file" ), PJ_BUILD_ERR(PJ_ETOOBIG, "Size is too big"), PJ_BUILD_ERR(PJ_ERESOLVE, "gethostbyname() has returned error"), + PJ_BUILD_ERR(PJ_ETOOSMALL, "Size is too short"), }; #endif /* PJ_HAS_ERROR_STRING */ @@ -161,6 +162,9 @@ PJ_DEF(pj_str_t) pj_strerror( pj_status_t statcode, return (*err_msg_hnd[i].strerror)(statcode, buf, bufsize); } } + + /* Handler not found! */ + len = pj_ansi_snprintf( buf, bufsize, "Unknown error %d", statcode); } if (len < 1) { |