#include "gwlib/gwlib.h"#include "msg-decl.h"Include dependency graph for msg.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Data Structures | |
| struct | Msg |
| struct | split_parts |
Defines | |
| #define | MSG_PARAM_UNDEFINED -1 |
| #define | MSG(type, stmt) type, |
| #define | INTEGER(name) long name |
| #define | OCTSTR(name) Octstr *name |
| #define | UUID(name) uuid_t name |
| #define | VOID(name) void *name |
| #define | MSG(type, stmt) struct type stmt type; |
| #define | msg_create(type) gw_claim_area(msg_create_real((type), __FILE__, __LINE__, __func__)) |
| #define | msg_unpack(os) gw_claim_area(msg_unpack_real((os), __FILE__, __LINE__, __func__)) |
Enumerations | |
| enum | msg_type { type, heartbeat, admin, sms, ack, wdp_datagram, msg_type_count } |
| enum | { mo = 0, mt_reply = 1, mt_push = 2, report_mo = 3, report_mt = 4 } |
| enum | { cmd_shutdown = 0, cmd_suspend = 1, cmd_resume = 2, cmd_identify = 3, cmd_restart = 4 } |
| enum | ack_status_t { ack_success = 0, ack_failed = 1, ack_failed_tmp = 2, ack_buffered = 3 } |
Functions | |
| Msg * | msg_create_real (enum msg_type type, const char *file, long line, const char *func) |
| Msg * | msg_duplicate (Msg *msg) |
| enum msg_type | msg_type (Msg *msg) |
| void | msg_destroy (Msg *msg) |
| void | msg_destroy_item (void *msg) |
| void | msg_dump (Msg *msg, int level) |
| 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) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 177 of file msg.h. Referenced by main(), msg_unpack_wrapper(), read_from_bearerbox_real(), run_requests(), and smsbox_thread(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 100 of file msg.h. 00100 {
00101 mo = 0,
00102 mt_reply = 1,
00103 mt_push = 2,
00104 report_mo = 3,
00105 report_mt = 4
00106 };
|
|
|
Definition at line 109 of file msg.h. 00109 {
00110 cmd_shutdown = 0,
00111 cmd_suspend = 1,
00112 cmd_resume = 2,
00113 cmd_identify = 3,
00114 cmd_restart = 4
00115 };
|
|
|
Definition at line 118 of file msg.h. 00118 {
00119 ack_success = 0,
00120 ack_failed = 1, /* do not try again (e.g. no route) */
00121 ack_failed_tmp = 2, /* temporary failed, try again (e.g. queue full) */
00122 ack_buffered = 3
00123 } ack_status_t;
|
|
|
Definition at line 73 of file msg.h. Referenced by at2_send_one_message(), bb_alog_sms(), boxc_receiver(), boxc_sender(), boxc_sent_pop(), boxc_sent_push(), dispatch_into_queue(), main(), obey_request(), ois_submit_msg(), read_messages_from_bearerbox(), route_incoming_to_boxc(), sema_submit_msg(), send_message(), service_router(), sms_priority_compare(), sms_to_smsboxes(), smsc2_rout(), smscconn_usable(), smscenter_receive_msg(), store_file_load(), store_file_save_ack(), store_file_status(), store_spool_save(), store_to_dict(), udp_addwdp(), udp_addwdp_from_client(), udp_addwdp_from_server(), wdp_msg2event(), wdp_router(), and wdp_to_wapboxes(). 00073 {
00074 #define MSG(type, stmt) type,
00075 #include "msg-decl.h"
00076 msg_type_count
00077 };
|
|
||||||||||||||||||||
|
Definition at line 93 of file msg.c. References file. Referenced by msg_unpack_real(). 00095 {
00096 Msg *msg;
00097
00098 msg = gw_malloc_trace(sizeof(Msg), file, line, func);
00099
00100 msg->type = type;
00101 #define INTEGER(name) p->name = MSG_PARAM_UNDEFINED
00102 #define OCTSTR(name) p->name = NULL
00103 #define UUID(name) uuid_generate(p->name)
00104 #define VOID(name) p->name = NULL
00105 #define MSG(type, stmt) { struct type *p = &msg->type; stmt }
00106 #include "msg-decl.h"
00107
00108 return msg;
00109 }
|
|
|
|
Definition at line 147 of file msg.c. References msg_destroy(). Referenced by cimd2_destroy(), empty_msg_lists(), oisd_destroy(), smasi_destroy(), smpp_destroy(), smscconn_send(), and store_file_init(). 00148 {
00149 msg_destroy(msg);
00150 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 152 of file msg.c. References debug(), type_as_str(), and UUID_STR_LEN. Referenced by boxc_sent_pop(), check_concatenation(), dump(), handle_pdu(), main(), obey_request_thread(), print_msg(), and store_file_load(). 00153 {
00154 char buf[UUID_STR_LEN + 1];
00155
00156 debug("gw.msg", 0, "%*sMsg object at %p:", level, "", (void *) msg);
00157 debug("gw.msg", 0, "%*s type: %s", level, "", type_as_str(msg));
00158 #define INTEGER(name) \
00159 debug("gw.msg", 0, "%*s %s.%s: %ld", level, "", t, #name, (long) p->name)
00160 #define OCTSTR(name) \
00161 debug("gw.msg", 0, "%*s %s.%s:", level, "", t, #name); \
00162 octstr_dump(p->name, level + 1)
00163 #define UUID(name) \
00164 uuid_unparse(p->name, buf); \
00165 debug("gw.msg", 0 , "%*s %s.%s: %s", level, "", t, #name, buf)
00166 #define VOID(name) \
00167 debug("gw.msg", 0, "%*s %s.%s: %p", level, "", t, #name, p->name)
00168 #define MSG(tt, stmt) \
00169 if (tt == msg->type) \
00170 { char *t = #tt; struct tt *p = &msg->tt; stmt }
00171 #include "msg-decl.h"
00172 debug("gw.msg", 0, "Msg object ends.");
00173 }
|
Here is the call graph for this function:

|
|
Definition at line 111 of file msg.c. References msg_create. Referenced by add_msg_cb(), at2_add_msg_cb(), bb_smscconn_receive(), boxc_sent_push(), cgw_add_msg_cb(), check_concatenation(), cimd2_add_msg_cb(), clear_old_concat_parts(), httpsmsc_send(), main(), main_connection_loop(), oisd_add_msg_cb(), send_message(), send_msg_cb(), sms_split(), smsc2_rout(), smscconn_send(), soap_add_msg_cb(), store_to_dict(), wrapper_add_msg(), and wrapper_sender(). 00112 {
00113 Msg *new;
00114
00115 new = msg_create(msg->type);
00116
00117 #define INTEGER(name) p->name = q->name
00118 #define OCTSTR(name) \
00119 if (q->name == NULL) p->name = NULL; \
00120 else p->name = octstr_duplicate(q->name);
00121 #define UUID(name) uuid_copy(p->name, q->name)
00122 #define VOID(name) p->name = q->name
00123 #define MSG(type, stmt) { \
00124 struct type *p = &new->type; \
00125 struct type *q = &msg->type; \
00126 stmt }
00127 #include "msg-decl.h"
00128
00129 return new;
00130 }
|
|
|
Definition at line 181 of file msg.c. References append_integer(), octstr_create, and panic. Referenced by deliver_to_bearerbox_real(), init_bearerbox(), main(), send_msg(), send_pdu(), smsbox_thread(), and write_to_bearerbox_real(). 00182 {
00183 Octstr *os;
00184
00185 os = octstr_create("");
00186 append_integer(os, msg->type);
00187
00188 #define INTEGER(name) append_integer(os, p->name)
00189 #define OCTSTR(name) append_string(os, p->name)
00190 #define UUID(name) append_uuid(os, p->name)
00191 #define VOID(name)
00192 #define MSG(type, stmt) \
00193 case type: { struct type *p = &msg->type; stmt } break;
00194
00195 switch (msg->type) {
00196 #include "msg-decl.h"
00197 default:
00198 panic(0, "Internal error: unknown message type %d",
00199 msg->type);
00200 }
00201
00202 return os;
00203 }
|
Here is the call graph for this function:

|
|
Definition at line 176 of file msg.c. References msg_type(). Referenced by msg_type(). 00177 {
00178 return msg->type;
00179 }
|
Here is the call graph for this function:

|
||||||||||||||||||||
|
Definition at line 206 of file msg.c. References error(), file, msg_create_real(), msg_destroy(), panic, and parse_integer(). 00207 {
00208 Msg *msg;
00209 int off;
00210 long i;
00211
00212 msg = msg_create_real(0, file, line, func);
00213 if (msg == NULL)
00214 goto error;
00215
00216 off = 0;
00217
00218 if (parse_integer(&i, os, &off) == -1)
00219 goto error;
00220 msg->type = i;
00221
00222 #define INTEGER(name) \
00223 if (parse_integer(&(p->name), os, &off) == -1) goto error
00224 #define OCTSTR(name) \
00225 if (parse_string(&(p->name), os, &off) == -1) goto error
00226 #define UUID(name) \
00227 if (parse_uuid(p->name, os, &off) == -1) goto error
00228 #define VOID(name)
00229 #define MSG(type, stmt) \
00230 case type: { struct type *p = &(msg->type); stmt } break;
00231
00232 switch (msg->type) {
00233 #include "msg-decl.h"
00234 default:
00235 panic(0, "Internal error: unknown message type: %d",
00236 msg->type);
00237 }
00238
00239 return msg;
00240
00241 error:
00242 if (msg != NULL) msg_destroy(msg);
00243 error(0, "Msg packet was invalid.");
00244 return NULL;
00245 }
|
Here is the call graph for this function:

|
|
Definition at line 253 of file msg.c. References msg_unpack. Referenced by init_bearerbox(), and main(). 00254 {
00255 return msg_unpack(os);
00256 }
|