58} __attribute__((packed));
68} __attribute__((packed));
88} __attribute__((packed));
233 res = ntohs(
event->event_len);
262 return ((iterator->
event_len <= (((
char *) iterator->
ie) - ((
char *) iterator->
event))) ? -1 : 0);
281 return str_payload ? str_payload->
str :
NULL;
291 return ntohs(
event->type);
296 const uint32_t *ie_val;
309 return str_payload ? str_payload->
str :
NULL;
352 payload_len =
sizeof(*str_payload) + strlen(
str);
355 strcpy(str_payload->
str,
str);
371 flags = htonl(flags);
376 const void *data,
size_t data_len)
380 unsigned int extra_len;
384 extra_len =
sizeof(*ie) + data_len;
398 (*event)->event_len = htons(event_len + extra_len);
414 "type '%u'!\n",
type);
426 memset(ie_value, 0,
sizeof(*ie_value));
440 ie_value->
payload.
str = va_arg(ap,
const char *);
445 void *data = va_arg(ap,
void *);
446 size_t datalen = va_arg(ap,
size_t);
470 event->type = htons(
type);
471 event->event_len = htons(
sizeof(*
event));
Prototypes for public functions only of internal interest,.
Asterisk main include file. File version handling, generic pbx functions.
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
#define ast_realloc(p, len)
A wrapper for realloc()
#define ast_calloc(num, len)
A wrapper for calloc()
#define ast_malloc(len)
A wrapper for malloc()
Standard Command Line Interface.
A set of macros to manage doubly-linked lists.
size_t ast_event_minimum_length(void)
Get the minimum length of an ast_event.
static uint16_t event_iterator_get_ie_raw_payload_len(struct ast_event_iterator *iterator)
size_t ast_event_get_size(const struct ast_event *event)
Get the size of an event.
const char * ast_event_get_ie_type_name(enum ast_event_ie_type ie_type)
Get the string representation of an information element type.
int ast_event_append_ie_bitflags(struct ast_event **event, enum ast_event_ie_type ie_type, uint32_t flags)
Append an information element that has a bitflags payload.
uint32_t ast_event_get_ie_uint(const struct ast_event *event, enum ast_event_ie_type ie_type)
Get the value of an information element that has an integer payload.
enum ast_event_ie_pltype ast_event_get_ie_pltype(enum ast_event_ie_type ie_type)
Get the payload type for a given information element type.
void ast_event_destroy(struct ast_event *event)
Destroy an event.
int ast_event_append_ie_str(struct ast_event **event, enum ast_event_ie_type ie_type, const char *str)
Append an information element that has a string payload.
const char * ast_event_get_ie_str(const struct ast_event *event, enum ast_event_ie_type ie_type)
Get the value of an information element that has a string payload.
const void * ast_event_get_ie_raw(const struct ast_event *event, enum ast_event_ie_type ie_type)
Get the value of an information element that has a raw payload.
static void * event_iterator_get_ie_raw(struct ast_event_iterator *iterator)
const char * ast_event_get_type_name(const struct ast_event *event)
Get the string representation of the type of the given event.
uint16_t ast_event_get_ie_raw_payload_len(const struct ast_event *event, enum ast_event_ie_type ie_type)
Get the length of the raw payload for a particular IE.
static const struct ie_map ie_maps[AST_EVENT_IE_TOTAL]
static const char *const event_names[AST_EVENT_TOTAL]
Event Names.
enum ast_event_ie_type ast_event_iterator_get_ie_type(struct ast_event_iterator *iterator)
Get the type of the current IE in the iterator instance.
int ast_event_iterator_next(struct ast_event_iterator *iterator)
Move iterator instance to next IE.
struct ast_event * ast_event_new(enum ast_event_type type,...)
Create a new event.
int ast_event_append_ie_raw(struct ast_event **event, enum ast_event_ie_type ie_type, const void *data, size_t data_len)
Append an information element that has a raw payload.
enum ast_event_type ast_event_get_type(const struct ast_event *event)
Get the type for an event.
int ast_event_iterator_init(struct ast_event_iterator *iterator, const struct ast_event *event)
Initialize an event iterator instance.
int ast_event_append_ie_uint(struct ast_event **event, enum ast_event_ie_type ie_type, uint32_t data)
Append an information element that has an integer payload.
const char * ast_event_iterator_get_ie_str(struct ast_event_iterator *iterator)
Get the value of the current IE in the iterator as a string payload.
int ast_event_append_eid(struct ast_event **event)
Append the global EID IE.
uint32_t ast_event_iterator_get_ie_uint(struct ast_event_iterator *iterator)
Get the value of the current IE in the iterator as an integer payload.
ast_event_ie_type
Event Information Element types.
@ AST_EVENT_IE_CEL_ACCTCODE
Channel Event AccountCode Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_EVENT_VERSION
@ AST_EVENT_IE_CEL_EXTRA
Channel Event extra data Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_CONTEXT
Channel Event context name Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_PEERACCT
Channel Event peeraccount Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_REMOTE_ADDR
@ AST_EVENT_IE_STATE
Generic State IE Used by AST_EVENT_DEVICE_STATE_CHANGE Payload type: UINT The actual state values dep...
@ AST_EVENT_IE_ATTEMPTED_TRANSPORT
@ AST_EVENT_IE_CONTEXT
Context IE Used by AST_EVENT_MWI Payload type: str.
@ AST_EVENT_IE_CEL_CIDRDNIS
Channel Event CID RDNIS field Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_EVENT_TIME
Channel Event Time (seconds) Used by: AST_EVENT_CEL Payload type: UINT.
@ AST_EVENT_IE_ACCOUNT_ID
@ AST_EVENT_IE_SESSION_ID
@ AST_EVENT_IE_UNIQUEID
Unique ID Used by: AST_EVENT_SUB, AST_EVENT_UNSUB Payload type: UINT.
@ AST_EVENT_IE_SECURITY_EVENT
@ AST_EVENT_IE_CEL_CHANNAME
Channel Event channel name Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_PRESENCE_STATE
@ AST_EVENT_IE_LOCAL_ADDR
@ AST_EVENT_IE_RECEIVED_HASH
@ AST_EVENT_IE_CEL_CIDANI
Channel Event CID ANI field Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_PRESENCE_MESSAGE
@ AST_EVENT_IE_DEVICE
Device Name Used by AST_EVENT_DEVICE_STATE_CHANGE Payload type: STR.
@ AST_EVENT_IE_CEL_CIDDNID
Channel Event CID dnid Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_AUTH_METHOD
@ AST_EVENT_IE_TOTAL
Must be the last IE value +1.
@ AST_EVENT_IE_PRESENCE_SUBTYPE
@ AST_EVENT_IE_PRESENCE_PROVIDER
@ AST_EVENT_IE_CEL_EXTEN
Channel Event extension name Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_EID
Entity ID Used by All events Payload type: RAW This IE indicates which server the event originated fr...
@ AST_EVENT_IE_CEL_CIDNAME
Channel Event CID name Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_AMAFLAGS
Channel Event AMA flags Used by: AST_EVENT_CEL Payload type: UINT.
@ AST_EVENT_IE_CEL_USEREVENT_NAME
Channel Event User Event Name Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_TENANTID
Channel Event TenantID Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_LINKEDID
Channel Event LinkedID Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_EVENT_TIME_USEC
Channel Event Time (micro-seconds) Used by: AST_EVENT_CEL Payload type: UINT.
@ AST_EVENT_IE_MAILBOX
Mailbox name.
@ AST_EVENT_IE_CEL_EVENT_TYPE
Channel Event Type Used by: AST_EVENT_CEL Payload type: UINT.
@ AST_EVENT_IE_EXISTS
Hint that someone cares that an IE exists Used by: AST_EVENT_SUB Payload type: UINT (ast_event_ie_typ...
@ AST_EVENT_IE_RECEIVED_CHALLENGE
@ AST_EVENT_IE_REQUEST_TYPE
@ AST_EVENT_IE_EXPECTED_RESPONSE
@ AST_EVENT_IE_CEL_UNIQUEID
Channel Event UniqueID Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CACHABLE
Event non-cacheability flag Used by: All events Payload type: UINT.
@ AST_EVENT_IE_EXPECTED_ADDR
@ AST_EVENT_IE_USING_PASSWORD
@ AST_EVENT_IE_EVENTTYPE
Event type Used by: AST_EVENT_SUB, AST_EVENT_UNSUB Payload type: UINT.
@ AST_EVENT_IE_CEL_APPNAME
Channel Event app name Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_APPDATA
Channel Event app args/data Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_SESSION_TV
@ AST_EVENT_IE_OLDMSGS
Number of Used by: AST_EVENT_MWI Payload type: UINT.
@ AST_EVENT_IE_REQUEST_PARAMS
@ AST_EVENT_IE_CEL_PEER
Channel Event Peer – for Things involving multiple channels, like BRIDGE Used by: AST_EVENT_CEL Paylo...
@ AST_EVENT_IE_CEL_CIDNUM
Channel Event CID num Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_USERFIELD
Channel Event Userfield Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_NEWMSGS
Number of new messages Used by: AST_EVENT_MWI Payload type: UINT.
@ AST_EVENT_DEVICE_STATE_CHANGE
@ AST_EVENT_NETWORK_CHANGE
@ AST_EVENT_PRESENCE_STATE
ast_event_ie_pltype
Payload types for event information elements.
@ AST_EVENT_IE_PLTYPE_RAW
@ AST_EVENT_IE_PLTYPE_UINT
@ AST_EVENT_IE_PLTYPE_BITFLAGS
@ AST_EVENT_IE_PLTYPE_EXISTS
@ AST_EVENT_IE_PLTYPE_STR
@ AST_EVENT_IE_PLTYPE_UNKNOWN
A set of macros to manage forward-linked lists.
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
#define AST_LIST_HEAD_NOLOCK_STATIC(name, type)
Defines a structure to be used to hold a list of specified type, statically initialized.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
Asterisk locking-related definitions:
static void * cleanup(void *unused)
static force_inline int attribute_pure ast_str_hash(const char *str)
Compute a hash value on a string.
Subscription event check list.
struct ast_ev_check_list::@350 ie_vals
The payload for a string information element.
char str[1]
The actual string, null terminated.
uint32_t hash
A hash calculated with ast_str_hash(), to speed up comparisons.
struct ast_event_ie_val::@346 entry
enum ast_event_ie_pltype ie_pltype
union ast_event_ie_val::@347 payload
enum ast_event_ie_type ie_type
An event information element.
unsigned char ie_payload[0]
enum ast_event_ie_type ie_type
supposed to be an opaque type
const struct ast_event * event
IE payload types and names.
enum ast_event_ie_pltype ie_pltype
An API for managing task processing threads that can be shared across modules.
Handle unaligned data access.
static unsigned int get_unaligned_uint32(const void *p)
struct ast_eid ast_eid_default
Global EID.