53 void const *data, ssize_t len);
82 #define msg_home(h) ((su_home_t*)(h)) 127 MSG_FLG_USERMASK = (1<<16) - 1
154 MSG_FLG_PARSERMASK = ((-1) ^ ((1<<16) - 1))
157 #define MSG_DO_COMPACT MSG_FLG_COMPACT 158 #define MSG_DO_CANONIC MSG_FLG_CANONIC 159 #define MSG_DO_EXTRACT_COPY MSG_FLG_EXTRACT_COPY 162 #define MSG_FLAGS(f, v) (((f) & (v)) == v) 164 #define MSG_IS_COMPACT(f) MSG_FLAGS((f), MSG_FLG_COMPACT) 165 #define MSG_IS_CANONIC(f) MSG_FLAGS((f), MSG_FLG_CANONIC) 166 #define MSG_IS_EXTRACT_COPY(f) MSG_FLAGS((f), MSG_FLG_EXTRACT_COPY) 167 #define MSG_IS_COMMA_LISTS(f) MSG_FLAGS((f), MSG_FLG_COMMA_LISTS) 168 #define MSG_IS_MAILBOX(f) MSG_FLAGS((f), MSG_FLG_MAILBOX) 170 #define MSG_HAS_COMPLETE(f) MSG_FLAGS((f), MSG_FLG_COMPLETE) 171 #define MSG_HAS_ERROR(f) MSG_FLAGS((f), MSG_FLG_ERROR) 173 #define MSG_IS_COMPLETE(mo) (((mo)->msg_flags & MSG_FLG_COMPLETE) != 0) msg_t * msg_ref_create(msg_t *msg)
Increment the reference count.
Definition: msg.c:146
msg_flg_user
Flags controlling parser/printer.
Definition: msg.h:102
Extract trailers for this message.
Definition: msg.h:139
Enable streaming.
Definition: msg.h:89
msg_header_t ** msg_chain_head(msg_t const *msg)
Return head of the fragment chain.
Definition: msg_parser.c:1875
int msg_prepare(msg_t *msg)
Encode all message fragments.
Definition: msg_parser.c:1547
void msg_set_streaming(msg_t *msg, enum msg_streaming_status what)
Enable/disable streaming.
Definition: msg_parser.c:114
Extract headers for this message.
Definition: msg.h:133
int msg_has_error(msg_t const *msg)
Return true if message has parsing errors.
Definition: msg_parser.c:673
unsigned msg_extract_errors(msg_t const *msg)
Get error classification flags.
Definition: msg.c:405
int msg_is_complete(msg_t const *msg)
Return true if message is complete.
Definition: msg_parser.c:664
MSG_PUB_T msg_pub_t
Public protocol-specific message structure for accessing the message.
Definition: msg_types.h:81
unsigned msg_get_flags(msg_t const *msg, unsigned mask)
Get message flags.
Definition: msg_parser.c:90
int msg_extract(msg_t *msg)
Extract and parse a message from internal buffer.
Definition: msg_parser.c:850
Use multiple parts for message body.
Definition: msg.h:118
msg_t * msg_dup(msg_t const *original)
Deep copy a message.
Definition: msg_header_copy.c:456
Make messages threadsafe.
Definition: msg.h:125
int msg_is_prepared(msg_t const *msg)
Return true if message is prepared.
Definition: msg_parser.c:1574
This message is too large.
Definition: msg.h:148
Use canonic representation when printing.
Definition: msg.h:106
Use compact form when printing.
Definition: msg.h:104
Disable streaming.
Definition: msg.h:87
This message has parsing errors.
Definition: msg.h:146
msg_pub_t * msg_object(msg_t const *msg)
Retrieve public message structure.
Definition: msg.c:209
usize_t msg_maxsize(msg_t *msg, usize_t maxsize)
Set the maximum size of a message.
Definition: msg_parser.c:698
unsigned msg_mark_as_complete(msg_t *msg, unsigned mask)
Mark message as complete.
Definition: msg_parser.c:649
usize_t msg_size(msg_t const *msg)
Total size of message.
Definition: msg_parser.c:682
void msg_ref_destroy(msg_t *ref)
Destroy a reference to a message.
Definition: msg.c:182
Extract body for this message.
Definition: msg.h:135
Print comma-separated lists instead of separate headers.
Definition: msg.h:110
unsigned msg_set_flags(msg_t *msg, unsigned mask)
Set message flags.
Definition: msg_parser.c:96
Cache a copy of headers when parsing.
Definition: msg.h:108
void msg_unprepare(msg_t *msg)
Clear 'prepared' flag.
Definition: msg_parser.c:1568
int msg_serialize(msg_t *msg, msg_pub_t *pub)
Serialize headers into the fragment chain.
Definition: msg_parser.c:1904
Extract chunks for this message.
Definition: msg.h:137
Extract last component of this message.
Definition: msg.h:141
MSG_HDR_T msg_header_t
Any protocol-specific header object.
Definition: msg_types.h:87
msg_flg_parser
Flags used by parser.
Definition: msg.h:131
This message is truncated.
Definition: msg.h:150
Enable streaming - parser gives completed message fragments when they are ready to upper layers...
Definition: msg.h:122
msg_t * msg_copy(msg_t *original)
Copy a message shallowly.
Definition: msg_header_copy.c:380
Use mailbox format when parsing - in mailbox format message has no body unless Content-Length header ...
Definition: msg.h:115
msg_streaming_status
Streaming state of a msg_t object.
Definition: msg.h:85
unsigned msg_zap_flags(msg_t *msg, unsigned mask)
Clear message flags.
Definition: msg_parser.c:102
msg_pub_t * msg_public(msg_t const *msg, void *tag)
Retrieve public message structure of given type.
Definition: msg.c:231
This message has been completely extracted.
Definition: msg.h:143
msg_t * msg_make(msg_mclass_t const *mc, int flags, void const *data, ssize_t len)
Parse a message.
Definition: msg_parser_util.c:2019
Message object.
Definition: msg_internal.h:59
msg_mclass_t const * msg_mclass(msg_t const *msg)
Retrieve message class.
Definition: msg.c:251
void msg_unref(msg_t *msg)
Decrease the reference count.
Definition: msg.c:87
This message has timeout.
Definition: msg.h:152
Types for messages and common headers.
msg_t * msg_ref(msg_t *msg)
Increment the reference count.
Definition: msg.c:63
int msg_is_streaming(msg_t const *msg)
Test if streaming is in progress.
Definition: msg_parser.c:108
char * msg_as_string(su_home_t *home, msg_t *msg, msg_pub_t *pub, int flags, size_t *return_len)
Convert a message to a string.
Definition: msg_parser.c:1788
void msg_destroy(msg_t *msg)
Destroy a reference to a message.
Definition: msg.c:193
void msg_set_parent(msg_t *kid, msg_t *dad)
Set a message parent.
Definition: msg.c:162
msg_t * msg_create(msg_mclass_t const *mc, int flags)
Create a message.
Definition: msg.c:100
Factory object for protocol messages.
Definition: msg_mclass.h:96