Kannel: Open Source WAP and SMS gateway
svn-r5336
|
#include <errno.h>
#include <stdlib.h>
#include <sys/types.h>
#include <netinet/in.h>
#include "msg.h"
#include "gwlib/gwlib.h"
#include "msg-decl.h"
Go to the source code of this file.
Macros | |
#define | INTEGER(name) p->name = MSG_PARAM_UNDEFINED; |
#define | OCTSTR(name) p->name = NULL; |
#define | UUID(name) uuid_generate(p->name); |
#define | VOID(name) p->name = NULL; |
#define | MSG(type, stmt) { struct type *p = &msg->type; stmt } |
#define | INTEGER(name) p->name = q->name; |
#define | OCTSTR(name) |
#define | UUID(name) uuid_copy(p->name, q->name); |
#define | VOID(name) p->name = q->name; |
#define | MSG(type, stmt) |
#define | INTEGER(name) p->name = 0; |
#define | OCTSTR(name) octstr_destroy(p->name); |
#define | UUID(name) uuid_clear(p->name); |
#define | VOID(name) |
#define | MSG(type, stmt) { struct type *p = &msg->type; stmt } |
#define | INTEGER(name) debug("gw.msg", 0, "%*s %s.%s: %ld", level, "", t, #name, (long) p->name); |
#define | OCTSTR(name) |
#define | UUID(name) |
#define | VOID(name) debug("gw.msg", 0, "%*s %s.%s: %p", level, "", t, #name, p->name); |
#define | MSG(tt, stmt) |
#define | INTEGER(name) append_integer(os, p->name); |
#define | OCTSTR(name) append_string(os, p->name); |
#define | UUID(name) append_uuid(os, p->name); |
#define | VOID(name) |
#define | MSG(type, stmt) case type: { struct type *p = &msg->type; stmt } break; |
#define | INTEGER(name) if (parse_integer(&(p->name), os, &off) == -1) goto error; |
#define | OCTSTR(name) if (parse_string(&(p->name), os, &off) == -1) goto error; |
#define | UUID(name) if (parse_uuid(p->name, os, &off) == -1) goto error; |
#define | VOID(name) |
#define | MSG(type, stmt) case type: { struct type *p = &(msg->type); stmt } break; |
#define | MSG(t, stmt) case t: return #t; |
Functions | |
static void | append_integer (Octstr *os, long i) |
static void | append_string (Octstr *os, Octstr *field) |
static void | append_uuid (Octstr *os, uuid_t id) |
static int | parse_integer (long *i, Octstr *packed, int *off) |
static int | parse_string (Octstr **os, Octstr *packed, int *off) |
static int | parse_uuid (uuid_t id, Octstr *packed, int *off) |
static char * | type_as_str (Msg *msg) |
Msg * | msg_create_real (enum msg_type type, const char *file, long line, const char *func) |
Msg * | msg_duplicate (Msg *msg) |
void | msg_destroy (Msg *msg) |
void | msg_destroy_item (void *msg) |
void | msg_dump (Msg *msg, int level) |
enum msg_type | msg_type (Msg *msg) |
Octstr * | msg_pack (Msg *msg) |
Msg * | msg_unpack_real (Octstr *os, const char *file, long line, const char *func) |
Msg * | msg_unpack_wrapper (Octstr *os) |
#define INTEGER | ( | name | ) | p->name = MSG_PARAM_UNDEFINED; |
#define INTEGER | ( | name | ) | append_integer(os, p->name); |
#define INTEGER | ( | name | ) | if (parse_integer(&(p->name), os, &off) == -1) goto error; |
#define MSG | ( | tt, | |
stmt | |||
) |
#define MSG | ( | t, | |
stmt | |||
) | case t: return #t; |
#define OCTSTR | ( | name | ) |
#define OCTSTR | ( | name | ) | octstr_destroy(p->name); |
#define OCTSTR | ( | name | ) |
#define OCTSTR | ( | name | ) | append_string(os, p->name); |
#define OCTSTR | ( | name | ) | if (parse_string(&(p->name), os, &off) == -1) goto error; |
#define UUID | ( | name | ) | uuid_generate(p->name); |
#define UUID | ( | name | ) | uuid_clear(p->name); |
#define UUID | ( | name | ) |
#define UUID | ( | name | ) | append_uuid(os, p->name); |
#define UUID | ( | name | ) | if (parse_uuid(p->name, os, &off) == -1) goto error; |
#define VOID | ( | name | ) |
#define VOID | ( | name | ) |
#define VOID | ( | name | ) |
|
static |
Definition at line 267 of file msg.c.
References encode_network_long(), and octstr_append_data().
Referenced by append_string(), append_uuid(), and msg_pack().
Definition at line 275 of file msg.c.
References append_integer(), octstr_insert(), and octstr_len().
Definition at line 285 of file msg.c.
References append_integer(), octstr_append_cstr(), UUID_STR_LEN, and uuid_unparse().
void msg_destroy | ( | Msg * | msg | ) |
Definition at line 132 of file msg.c.
References msg.
Referenced by bb_remove_message(), bb_smscconn_receive(), bb_smscconn_receive_internal(), bb_smscconn_send_failed(), bb_smscconn_sent(), bearerbox_to_smpp(), bearerbox_to_smsbox(), bearerbox_to_sql(), boxc_receiver(), boxc_sender(), boxc_sent_pop(), catenate_msg(), cimd2_accept_message(), concat_handling_check_and_handle(), concat_handling_clear_old_parts(), data_sm_to_msg(), deliver_sms_to_queue(), deliver_to_bearerbox_real(), destroy_concatMsg(), dispatch_datagram(), dispatch_into_queue(), dlr_spool_add(), dlr_spool_get(), emi_receive_msg(), empty_msg_lists(), generic_receive_sms(), handle_pdu(), handle_split(), http_queue_thread(), identify_to_bearerbox(), main(), main_connection_loop(), msg_destroy_item(), msg_to_bb(), msg_to_pdu(), msg_unpack_real(), obey_request_thread(), ois_deliver_sm_invoke(), oisd_accept_message(), pdu_to_msg(), read_messages_from_bearerbox(), retry_consumer_thread(), run_batch(), run_requests(), send_message(), send_pdu(), smpp_msg_destroy(), sms_receive(), sms_router(), sms_split(), smsbox_req_handle(), smsbox_req_sendota(), smsbox_sendota_post(), smsbox_thread(), smsbox_to_bearerbox(), smsc2_rout(), sql_list(), sql_single(), status_cb(), store_file_load(), store_file_save_ack(), store_spool_save_ack(), store_to_dict(), timer_consumer_thread(), udp_sender(), url_result_thread(), wdp_to_wapboxes(), wrapper_sender(), and write_to_bearerbox_real().
void msg_destroy_item | ( | void * | msg | ) |
Definition at line 147 of file msg.c.
References msg, and msg_destroy().
Referenced by boxc_create(), cimd2_destroy(), empty_msg_lists(), handle_pdu(), msg_to_pdu(), oisd_destroy(), run_batch(), smasi_destroy(), smpp_destroy(), smscconn_send(), sql_list(), and store_file_init().
void msg_dump | ( | Msg * | msg, |
int | level | ||
) |
Definition at line 152 of file msg.c.
References debug(), msg, type_as_str(), and UUID_STR_LEN.
Referenced by bearerbox_to_smpp(), boxc_sent_pop(), concat_handling_check_and_handle(), dump(), handle_pdu(), main(), obey_request_thread(), print_msg(), read_messages_from_bearerbox(), send_message(), and store_file_load().
Definition at line 111 of file msg.c.
References msg, and msg_create.
Referenced by add_msg_cb(), at2_add_msg_cb(), bb_smscconn_receive_internal(), bearerbox_to_smsbox(), boxc_sent_push(), catenate_msg(), cgw_add_msg_cb(), cimd2_add_msg_cb(), concat_handling_check_and_handle(), concat_handling_clear_old_parts(), generic_receive_sms(), handle_pdu(), httpsmsc_send(), main(), main_connection_loop(), msg_cb(), oisd_add_msg_cb(), run_batch(), send_message(), send_msg_cb(), sms_split(), smsbox_to_bearerbox(), smsc2_rout(), smscconn_send(), soap_add_msg_cb(), store_to_dict(), wrapper_add_msg(), and wrapper_sender().
Definition at line 181 of file msg.c.
References append_integer(), msg, octstr_create, and panic.
Referenced by deliver_to_bearerbox_real(), init_bearerbox(), init_smppbox(), main(), send_msg(), send_pdu(), smsbox_thread(), and write_to_bearerbox_real().
Definition at line 206 of file msg.c.
References error(), file, msg, msg_create_real(), msg_destroy(), and parse_integer().
Definition at line 256 of file msg.c.
References msg_unpack.
Referenced by init_bearerbox(), init_smppbox(), and main().
|
static |
Definition at line 294 of file msg.c.
References decode_network_long(), error(), gw_assert(), octstr_get_many_chars(), and octstr_len().
Referenced by msg_unpack_real(), and parse_string().
Definition at line 311 of file msg.c.
References octstr_copy, and parse_integer().
Referenced by parse_uuid().
Definition at line 334 of file msg.c.
References octstr_destroy(), octstr_get_cstr, parse_string(), and uuid_parse().
|
static |