|
Kannel: Open Source WAP and SMS gateway
svn-r5336
|
#include <errno.h>#include <stdlib.h>#include <stdio.h>#include <time.h>#include <string.h>#include <sys/time.h>#include <sys/types.h>#include <unistd.h>#include <signal.h>#include <fcntl.h>#include <assert.h>#include "gwlib/gwlib.h"#include "msg.h"#include "shared.h"#include "wap/wap.h"#include "wap/wtp.h"#include "wap/wtp_pdu.h"Go to the source code of this file.
Data Structures | |
| struct | _udpc |
Typedefs | |
| typedef struct _udpc | Udpc |
Enumerations | |
| enum | { CONNECTIONLESS_PORT = 9200, CONNECTION_ORIENTED_PORT = 9201, WTLS_CONNECTIONLESS_PORT = 9202, WTLS_CONNECTION_ORIENTED_PORT = 9203 } |
Functions | |
| static void | udpc_destroy (Udpc *udpc) |
| static WAPEvent * | wdp_msg2event (Msg *msg) |
| static void | wdp_event_dump (Msg *msg) |
| static void | wtp_event_dump (Msg *msg) |
| static void | dump (Msg *msg) |
| static void | udp_receiver (void *arg) |
| static int | send_udp (int fd, Msg *msg) |
| static void | udp_sender (void *arg) |
| static Udpc * | udpc_create (int port, char *interface_name, Octstr *map_addr) |
| static int | add_service (int port, char *interface_name, Octstr *map_addr) |
| static int | udp_start (Cfg *cfg) |
| static Udpc * | udpc_find_mapping (Msg *msg, int inbound) |
| static int | udp_addwdp_from_server (Msg *msg) |
| static int | udp_addwdp_from_client (Msg *msg) |
| static int | udp_shutdown (void) |
| static int | udp_die (void) |
| static void | wdp_router (void *arg) |
| static void | service_router (void *arg) |
| static void | help (void) |
| int | main (int argc, char **argv) |
Variables | |
| static volatile sig_atomic_t | udp_running |
| static List * | udpc_list |
| static Octstr * | interface_name = NULL |
| static Octstr * | wapgw |
| static int | verbose = 0 |
| static int | server_port = 0 |
| List * | incoming_wdp |
| List * | outgoing_wdp |
| List * | flow_threads |
| Counter * | incoming_wdp_counter |
| Counter * | outgoing_wdp_counter |
| anonymous enum |
| Enumerator | |
|---|---|
| CONNECTIONLESS_PORT | |
| CONNECTION_ORIENTED_PORT | |
| WTLS_CONNECTIONLESS_PORT | |
| WTLS_CONNECTION_ORIENTED_PORT | |
Definition at line 123 of file wapproxy.c.
|
static |
Definition at line 455 of file wapproxy.c.
References error(), gwlist_add_producer(), gwlist_append(), gwthread_create, interface_name, _udpc::outgoing_list, _udpc::receiver, udp_receiver(), udp_sender(), udpc_create(), udpc_destroy(), and udpc_list.
Referenced by udp_addwdp_from_client(), and udp_start().
|
static |
Definition at line 246 of file wapproxy.c.
References msg, msg_dump(), verbose, wdp_event_dump(), and wtp_event_dump().
Referenced by udp_receiver(), and udp_sender().
|
static |
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 736 of file wapproxy.c.
References cfg, CONNECTION_ORIENTED_PORT, counter_create(), counter_destroy(), debug(), error(), flow_threads, getopt(), gwlib_init(), gwlib_shutdown(), gwlist_add_producer(), gwlist_consume(), gwlist_create, gwlist_destroy(), gwlist_remove_producer(), gwthread_create, gwthread_sleep(), help(), incoming_wdp, incoming_wdp_counter, interface_name, log_set_output_level(), octstr_create, octstr_destroy(), optarg, optind, outgoing_wdp, outgoing_wdp_counter, panic, report_versions(), server_port, service_router(), udp_shutdown(), udp_start(), verbose, wapgw, and wdp_router().
|
static |
Definition at line 352 of file wapproxy.c.
References error(), msg, octstr_destroy(), udp_create_address(), and udp_sendto().
Referenced by udp_sender().
|
static |
Definition at line 691 of file wapproxy.c.
References flow_threads, gw_assert(), gwlist_add_producer(), gwlist_consume(), gwlist_remove_producer(), incoming_wdp, msg, udp_addwdp_from_client(), and udp_die().
Referenced by main().
|
static |
Definition at line 583 of file wapproxy.c.
References add_service(), CONNECTION_ORIENTED_PORT, gwlist_produce(), info(), interface_name, msg, octstr_destroy(), octstr_duplicate, octstr_get_cstr, _udpc::outgoing_list, panic, udp_create_address(), udp_get_ip(), udp_get_port(), udp_running, udpc_find_mapping(), and wapgw.
Referenced by service_router().
|
static |
Definition at line 532 of file wapproxy.c.
References gwlist_produce(), interface_name, _udpc::map_addr, msg, octstr_create, octstr_destroy(), octstr_duplicate, octstr_get_cstr, _udpc::outgoing_list, panic, server_port, udp_create_address(), udp_get_ip(), udp_get_port(), udp_running, and udpc_find_mapping().
Referenced by wdp_router().
|
static |
Definition at line 644 of file wapproxy.c.
References debug(), gwlist_consume(), gwlist_destroy(), gwlist_remove_producer(), _udpc::outgoing_list, udp_running, and udpc_list.
Referenced by service_router(), and wdp_router().
|
static |
Definition at line 285 of file wapproxy.c.
References _udpc::addr, counter_increase(), dump(), error(), _udpc::fd, flow_threads, gwlist_add_producer(), gwlist_produce(), gwlist_remove_producer(), gwthread_wakeup(), incoming_wdp, incoming_wdp_counter, info(), MAIN_THREAD_ID, _udpc::map_addr, msg, msg_create, octstr_compare(), octstr_destroy(), octstr_get_cstr, outgoing_wdp, outgoing_wdp_counter, read_available(), udp_get_ip(), udp_get_port(), and udp_recvfrom().
Referenced by add_service().
|
static |
Definition at line 367 of file wapproxy.c.
References counter_increase(), dump(), _udpc::fd, flow_threads, gwlist_add_producer(), gwlist_consume(), gwlist_remove_producer(), gwthread_join(), info(), msg, msg_destroy(), octstr_get_cstr, _udpc::outgoing_list, outgoing_wdp_counter, _udpc::receiver, send_udp(), and udpc_destroy().
Referenced by add_service().
|
static |
Definition at line 634 of file wapproxy.c.
References debug(), gwlist_remove_producer(), incoming_wdp, and udp_running.
Referenced by main().
|
static |
Definition at line 485 of file wapproxy.c.
References add_service(), debug(), gwlist_add_producer(), gwlist_create, incoming_wdp, interface_name, octstr_get_cstr, server_port, udp_running, and udpc_list.
Referenced by main().
Definition at line 404 of file wapproxy.c.
References _udpc::addr, debug(), error(), _udpc::fd, gwlist_create, interface_name, _udpc::map_addr, octstr_create, octstr_destroy(), octstr_get_cstr, _udpc::outgoing_list, udp_bind(), udp_create_address(), udp_get_ip(), and udp_get_port().
Referenced by add_service().
|
static |
Definition at line 440 of file wapproxy.c.
References _udpc::addr, _udpc::fd, gw_assert(), gwlist_destroy(), gwlist_len(), octstr_destroy(), and _udpc::outgoing_list.
Referenced by add_service(), and udp_sender().
Definition at line 502 of file wapproxy.c.
References _udpc::addr, gwlist_get(), gwlist_len(), gwlist_lock(), gwlist_unlock(), _udpc::map_addr, msg, octstr_compare(), udp_get_ip(), udp_get_port(), and udpc_list.
Referenced by udp_addwdp_from_client(), and udp_addwdp_from_server().
|
static |
Definition at line 172 of file wapproxy.c.
References msg, wap_event_destroy(), wap_event_dump(), and wdp_msg2event().
Referenced by dump().
Definition at line 148 of file wapproxy.c.
References CONNECTION_ORIENTED_PORT, gw_assert(), msg, octstr_duplicate, server_port, WAPEvent::u, wap_addr_tuple_create(), and wap_event_create.
Referenced by wdp_event_dump(), and wtp_event_dump().
|
static |
Definition at line 670 of file wapproxy.c.
References flow_threads, gw_assert(), gwlist_add_producer(), gwlist_consume(), gwlist_remove_producer(), msg, outgoing_wdp, udp_addwdp_from_server(), and udp_die().
Referenced by main().
|
static |
Definition at line 184 of file wapproxy.c.
References debug(), error(), gwlist_destroy(), gwlist_extract_first(), gwlist_len(), info(), msg, WAPEvent::type, wap_event_destroy(), wap_event_dump(), wap_event_name(), wdp_msg2event(), wtp_event_is_for_responder(), and wtp_unpack_wdp_datagram().
Referenced by dump().
| List* flow_threads |
Definition at line 118 of file wapproxy.c.
Referenced by bb_smscconn_killed(), bb_smscconn_ready(), boxc_sender(), main(), run_smsbox(), run_wapbox(), service_router(), sms_router(), sms_to_smsboxes(), smsboxc_run(), udp_receiver(), udp_sender(), wapboxc_run(), wdp_router(), and wdp_to_wapboxes().
| List* incoming_wdp |
Definition at line 116 of file wapproxy.c.
Referenced by main(), run_wapbox(), service_router(), udp_receiver(), udp_shutdown(), udp_start(), wapboxc_run(), and wdp_to_wapboxes().
| Counter* incoming_wdp_counter |
Definition at line 120 of file wapproxy.c.
Referenced by main(), and udp_receiver().
|
static |
Definition at line 111 of file wapproxy.c.
Referenced by add_service(), main(), make_server_socket(), udp_addwdp_from_client(), udp_addwdp_from_server(), udp_start(), and udpc_create().
| List* outgoing_wdp |
Definition at line 117 of file wapproxy.c.
Referenced by main(), run_wapbox(), udp_receiver(), wapbox_start(), wapboxc_run(), and wdp_router().
| Counter* outgoing_wdp_counter |
Definition at line 121 of file wapproxy.c.
Referenced by main(), udp_receiver(), and udp_sender().
|
static |
Definition at line 114 of file wapproxy.c.
Referenced by main(), udp_addwdp_from_server(), udp_start(), and wdp_msg2event().
|
static |
Definition at line 109 of file wapproxy.c.
Referenced by udp_addwdp_from_client(), udp_addwdp_from_server(), udp_die(), udp_shutdown(), and udp_start().
|
static |
Definition at line 110 of file wapproxy.c.
Referenced by add_service(), udp_die(), udp_start(), and udpc_find_mapping().
|
static |
Definition at line 113 of file wapproxy.c.
|
static |
Definition at line 112 of file wapproxy.c.
Referenced by main(), and udp_addwdp_from_client().