#include "gwlib/gwlib.h"#include "smasi_pdu.def"Include dependency graph for smasi_pdu.h:

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

Go to the source code of this file.
|
|
Definition at line 90 of file smasi_pdu.h. |
|
|
Definition at line 90 of file smasi_pdu.h. |
|
|
Definition at line 124 of file smasi_pdu.h. |
|
|
Definition at line 123 of file smasi_pdu.h. |
|
|
Definition at line 127 of file smasi_pdu.h. |
|
|
Definition at line 125 of file smasi_pdu.h. |
|
|
Definition at line 130 of file smasi_pdu.h. |
|
|
Definition at line 126 of file smasi_pdu.h. |
|
|
Definition at line 131 of file smasi_pdu.h. |
|
|
Definition at line 129 of file smasi_pdu.h. |
|
|
Definition at line 128 of file smasi_pdu.h. |
|
|
Definition at line 112 of file smasi_pdu.h. Referenced by get_dest_addr_npi(), and get_source_addr_npi(). |
|
|
Definition at line 117 of file smasi_pdu.h. |
|
|
Definition at line 118 of file smasi_pdu.h. |
|
|
Definition at line 115 of file smasi_pdu.h. |
|
|
Definition at line 116 of file smasi_pdu.h. |
|
|
Definition at line 114 of file smasi_pdu.h. |
|
|
Definition at line 111 of file smasi_pdu.h. |
|
|
Definition at line 113 of file smasi_pdu.h. |
|
|
Definition at line 108 of file smasi_pdu.h. |
|
|
Definition at line 107 of file smasi_pdu.h. Referenced by convert_addr_from_pdu(), and get_originator_type(). |
|
|
Definition at line 109 of file smasi_pdu.h. |
|
|
Definition at line 103 of file smasi_pdu.h. Referenced by convert_addr_from_pdu(), get_dest_addr_ton(), get_originator_type(), and get_source_addr_ton(). |
|
|
Definition at line 104 of file smasi_pdu.h. |
|
|
Definition at line 105 of file smasi_pdu.h. |
|
|
Definition at line 106 of file smasi_pdu.h. |
|
|
Definition at line 102 of file smasi_pdu.h. |
|
|
Definition at line 89 of file smasi_pdu.h. |
|
|
Definition at line 89 of file smasi_pdu.h. |
|
|
Definition at line 91 of file smasi_pdu.h. |
|
|
Definition at line 91 of file smasi_pdu.h. |
|
|
Definition at line 73 of file smasi_pdu.h. |
|
|
Definition at line 83 of file smasi_pdu.h. |
|
|
Definition at line 75 of file smasi_pdu.h. 00075 {
00076 #define NONTERMINATED(name)
00077 #define COMATERMINATED(name)
00078 #define PDU(name, id, fields) name = id,
00079 #include "smasi_pdu.def"
00080 SMASI_PDU_DUMMY_TYPE
00081 };
|
|
|
Definition at line 132 of file smasi_pdu.c. References pdu, SMASI_PDU::type, and warning(). Referenced by handle_pdu(), msg_to_pdu(), open_connection(), send_enquire_link(), send_logoff(), and smasi_pdu_unpack(). 00133 {
00134 SMASI_PDU *pdu;
00135
00136 pdu = gw_malloc(sizeof(*pdu));
00137 pdu->type = type;
00138
00139 switch (type) {
00140 #define NONTERMINATED(name) p->name = NULL;
00141 #define COMATERMINATED(name) p->name = NULL;
00142 #define PDU(name, id, fields) \
00143 case id: { \
00144 struct name *p = &pdu->u.name; \
00145 pdu->type_name = #name; \
00146 pdu->needs_hyphen = (id < SMASI_HYPHEN_ID ? 1 : 0); \
00147 fields \
00148 } break;
00149 #include "smasi_pdu.def"
00150 default:
00151 warning(0, "Unknown SMASI_PDU type, internal error.");
00152 gw_free(pdu);
00153 return NULL;
00154 }
00155
00156 return pdu;
00157 }
|
Here is the call graph for this function:

|
|
Definition at line 160 of file smasi_pdu.c. References error(), pdu, and SMASI_PDU::type. Referenced by handle_pdu(), open_connection(), send_enquire_link(), send_logoff(), send_messages(), and smasi_thread(). 00161 {
00162 if (pdu == NULL)
00163 return;
00164
00165 switch (pdu->type) {
00166 #define NONTERMINATED(name) octstr_destroy(p->name);
00167 #define COMATERMINATED(name) octstr_destroy(p->name);
00168 #define PDU(name, id, fields) \
00169 case id: { struct name *p = &pdu->u.name; fields } break;
00170 #include "smasi_pdu.def"
00171 default:
00172 error(0, "Unknown SMASI_PDU type, internal error while destroying.");
00173 }
00174 gw_free(pdu);
00175 }
|
Here is the call graph for this function:

|
|
Definition at line 280 of file smasi_pdu.c. References debug(), pdu, and warning(). Referenced by dump_pdu(). 00281 {
00282 debug("sms.smasi", 0, "SMASI PDU %p dump:", (void *) pdu);
00283 debug("sms.smasi", 0, " type_name: %s", pdu->type_name);
00284 switch (pdu->type) {
00285 #define NONTERMINATED(name) p = *(&p);
00286 #define COMATERMINATED(name) \
00287 octstr_dump_short(p->name, 2, #name);
00288 #define PDU(name, id, fields) \
00289 case id: { struct name *p = &pdu->u.name; fields } break;
00290 #include "smasi_pdu.def"
00291 default:
00292 warning(0, "Unknown SMASI_PDU type, internal error.");
00293 break;
00294 }
00295 debug("sms.smasi", 0, "SMASI PDU dump ends.");
00296 }
|
Here is the call graph for this function:

|
|
|
|
|
Definition at line 178 of file smasi_pdu.c. References error(), SMASI_PDU::needs_hyphen, octstr_append_char(), octstr_append_cstr(), octstr_create, octstr_destroy(), octstr_insert(), pdu, SMASI_PDU::type, and SMASI_PDU::type_name. Referenced by send_enquire_link(), send_logoff(), and send_pdu(). 00179 {
00180 Octstr *os;
00181 Octstr *temp;
00182
00183 os = octstr_create("");
00184
00185 /*
00186 * Fix lengths of octet string fields.
00187 */
00188 switch (pdu->type) {
00189 #define NONTERMINATED(name) p = *(&p);
00190 #define COMATERMINATED(name) p = *(&p);
00191 #define PDU(name, id, fields) \
00192 case id: { struct name *p = &pdu->u.name; fields } break;
00193 #include "smasi_pdu.def"
00194 default:
00195 error(0, "Unknown SMASI_PDU type, internal error while packing.");
00196 }
00197
00198 switch (pdu->type) {
00199 #define NONTERMINATED(name) p = *(&p);
00200 #define COMATERMINATED(name) \
00201 if (p->name != NULL) { octstr_append_cstr(os, #name); \
00202 octstr_append_char(os, '='); \
00203 octstr_append(os, p->name); \
00204 octstr_append_char(os, ','); }
00205 #define PDU(name, id, fields) \
00206 case id: { struct name *p = &pdu->u.name; fields } break;
00207 #include "smasi_pdu.def"
00208 default:
00209 error(0, "Unknown SMASI_PDU type, internal error while packing.");
00210 }
00211
00212 octstr_append_char(os, '\n');
00213 temp = pdu->needs_hyphen ? octstr_create("!") : octstr_create("");
00214 octstr_append_cstr(temp, pdu->type_name);
00215 octstr_append_char(temp, ':');
00216 octstr_insert(os, temp, 0);
00217 octstr_destroy(temp);
00218
00219 return os;
00220 }
|
Here is the call graph for this function:

|
|
Definition at line 299 of file smasi_pdu.c. References conn_read_line(). Referenced by read_pdu(). 00300 {
00301 Octstr *line;
00302
00303 line = conn_read_line(conn); /* read one line */
00304 return line;
00305 }
|
Here is the call graph for this function:

|
|
Definition at line 223 of file smasi_pdu.c. References decode_type(), octstr_destroy(), octstr_get_cstr, pdu, skip_until_after_colon(), smasi_pdu_create(), type, and warning(). Referenced by read_pdu(). 00224 {
00225 SMASI_PDU *pdu;
00226 char *type_name;
00227 Octstr *temp;
00228 long pos;
00229 unsigned long type = 0;
00230
00231 /* extract the PDU type identifier */
00232 temp = decode_type(data_without_len);
00233 type_name = (temp ? octstr_get_cstr(temp) : "");
00234
00235 if (strcmp(type_name, "dummy") == 0) type = 0;
00236 #define NONTERMINATED(name) p = *(&p);
00237 #define COMATERMINATED(name) p = *(&p);
00238 #define PDU(name, id, fields) \
00239 else if (strcmp(type_name, #name) == 0) type = id;
00240 #include "smasi_pdu.def"
00241 else warning(0, "unknown SMASI PDU type");
00242
00243 pdu = smasi_pdu_create(type);
00244 if (pdu == NULL) return NULL;
00245
00246 pos = 0;
00247 skip_until_after_colon(data_without_len, &pos);
00248
00249 switch (type) {
00250 #define NONTERMINATED(name) p = *(&p);
00251 #define COMATERMINATED(name) \
00252 if (octstr_str_compare(field_name, #name) == 0 && field_value != NULL) \
00253 p->name = octstr_duplicate(field_value);
00254 #define PDU(name, id, fields) \
00255 case id: { \
00256 Octstr * field_name = NULL; \
00257 Octstr * field_value = NULL; \
00258 struct name *p = &pdu->u.name; \
00259 while (pos < octstr_len(data_without_len)) { \
00260 field_name = copy_until_assign(data_without_len, &pos); \
00261 if (field_name == NULL) break; \
00262 field_value = copy_until_coma(data_without_len, &pos); \
00263 if (field_value == NULL) continue; \
00264 fields \
00265 octstr_destroy(field_name); \
00266 octstr_destroy(field_value); \
00267 } \
00268 } break;
00269 #include "smasi_pdu.def"
00270 default:
00271 warning(0, "Unknown SMASI_PDU type, internal error while unpacking.");
00272 }
00273
00274 octstr_destroy(temp);
00275
00276 return pdu;
00277 }
|
Here is the call graph for this function:
