Changeset 43 for pjproject/main/pjsip/include/pjsip/sip_parser.h
- Timestamp:
- Nov 11, 2005 7:01:31 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/main/pjsip/include/pjsip/sip_parser.h
- Property svn:keywords set to Id
r38 r43 1 1 /* $Id$ 2 *3 2 */ 4 3 #ifndef __PJSIP_SIP_PARSER_H__ … … 11 10 12 11 #include <pjsip/sip_types.h> 13 #include <pj /scanner.h>12 #include <pjlib-util/scanner.h> 14 13 #include <pj/list.h> 15 14 … … 52 51 typedef struct pjsip_parser_err_report 53 52 { 54 PJ_DECL_LIST_MEMBER(struct pjsip_parser_err_report) 53 PJ_DECL_LIST_MEMBER(struct pjsip_parser_err_report); 55 54 int exception_code; /**< Error exception (e.g. PJSIP_SYN_ERR_EXCEPTION) */ 56 55 int line; /**< Line number. */ … … 58 57 pj_str_t hname; /**< Header name, if any. */ 59 58 } pjsip_parser_err_report; 59 60 61 /** 62 * Parsing context, the default argument for parsing functions. 63 */ 64 typedef struct pjsip_parse_ctx 65 { 66 pj_scanner *scanner; /**< The scanner. */ 67 pj_pool_t *pool; /**< The pool. */ 68 pjsip_rx_data *rdata; /**< Optional rdata. */ 69 } pjsip_parse_ctx; 60 70 61 71 … … 77 87 * can be terminated when seeing EOF. 78 88 */ 79 typedef void* (pjsip_parse_hdr_func)(pj_scanner *scanner, pj_pool_t *pool);89 typedef pjsip_hdr* (pjsip_parse_hdr_func)(pjsip_parse_ctx *context); 80 90 81 91 /** … … 95 105 * @param fptr The pointer to function to parser the header. 96 106 * 97 * @return zero if success. 98 * @see pjsip_parse_hdr_func 107 * @return PJ_SUCCESS if success, or the appropriate error code. 99 108 */ 100 109 PJ_DECL(pj_status_t) pjsip_register_hdr_parser( const char *hname, … … 186 195 187 196 /** 197 * Parse a packet buffer and build a rdata. The resulting message will be 198 * stored in \c msg field in the \c rdata. This behaves pretty much like 199 * #pjsip_parse_msg(), except that it will also initialize the header fields 200 * in the \c rdata. 201 * 202 * This function is normally called by the transport layer. 203 * 204 * @param buf The input buffer 205 * @param buf The input buffer, which size must be at least (size+1) 206 * because the function will temporarily put NULL 207 * termination at the end of the buffer during parsing. 208 * @param size The length of the string (not counting NULL terminator). 209 * @param rdata The receive data buffer to store the message and 210 * its elements. 211 * 212 * @return The message inside the rdata if successfull, or NULL. 213 */ 214 PJ_DECL(pjsip_msg *) pjsip_parse_rdata( char *buf, pj_size_t size, 215 pjsip_rx_data *rdata ); 216 217 /** 188 218 * Check incoming packet to see if a (probably) valid SIP message has been 189 219 * received. … … 194 224 * the size of the SIP message (including body, if any). 195 225 * 196 * @return PJ_TRUE (1) if a message is found. 197 */ 198 PJ_DECL(pj_bool_t) pjsip_find_msg( const char *buf, pj_size_t size, 199 pj_bool_t is_datagram, pj_size_t *msg_size); 226 * @return PJ_SUCCESS if a message is found, or an error code. 227 */ 228 PJ_DECL(pj_status_t) pjsip_find_msg(const char *buf, 229 pj_size_t size, 230 pj_bool_t is_datagram, 231 pj_size_t *msg_size); 200 232 201 233 /** … … 248 280 */ 249 281 extern 250 pj_c har_specpjsip_HOST_SPEC, /* For scanning host part. */282 pj_cis_t pjsip_HOST_SPEC, /* For scanning host part. */ 251 283 pjsip_DIGIT_SPEC, /* Decimal digits */ 252 284 pjsip_ALPHA_SPEC, /* Alpha (A-Z, a-z) */
Note: See TracChangeset
for help on using the changeset viewer.