#include <errno.h>#include <sys/types.h>#include <netinet/in.h>#include <stdlib.h>#include "gwlib/gwlib.h"#include "wap_addr.h"#include "wap_events.h"Include dependency graph for wtp.h:

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

Go to the source code of this file.
|
|
|
|
|
|
|
|
|
|
|
Definition at line 82 of file wtp.h. 00082 {
00083 NUMBER_OF_ABORT_TYPES = 2,
00084 NUMBER_OF_ABORT_REASONS = 10,
00085 NUMBER_OF_TRANSACTION_CLASSES = 3
00086 };
|
|
|
Definition at line 93 of file wtp.h. 00093 {
00094 L_A_WITH_USER_ACK = 4,
00095 L_R_WITH_USER_ACK = 7,
00096 S_R_WITHOUT_USER_ACK = 3,
00097 S_R_WITH_USER_ACK = 4,
00098 G_R_WITHOUT_USER_ACK = 3,
00099 G_R_WITH_USER_ACK = 3,
00100 W_WITH_USER_ACK = 30
00101 };
|
|
|
Definition at line 107 of file wtp.h.
|
|
|
Definition at line 115 of file wtp.h. 00115 {
00116 ACKNOWLEDGEMENT = 0,
00117 TID_VERIFICATION = 1
00118 };
|
|
|
Definition at line 123 of file wtp.h.
|
|
|
Definition at line 131 of file wtp.h. 00131 {
00132 UNKNOWN = 0x00,
00133 PROTOERR = 0x01,
00134 INVALIDTID = 0x02,
00135 NOTIMPLEMENTEDCL2 = 0x03,
00136 NOTIMPLEMENTEDSAR = 0x04,
00137 NOTIMPLEMENTEDUACK = 0x05,
00138 WTPVERSIONZERO = 0x06,
00139 CAPTEMPEXCEEDED = 0x07,
00140 NORESPONSE = 0x08,
00141 MESSAGETOOLARGE = 0x09,
00142 NOTIMPLEMENTEDESAR = 0x0A
00143 };
|
|
|
Definition at line 148 of file wtp.h. 00148 {
00149 TRANSACTION_CLASS_0 = 0,
00150 TRANSACTION_CLASS_1 = 1,
00151 TRANSACTION_CLASS_2 = 2
00152 };
|
|
|
Definition at line 157 of file wtp.h. 00157 {
00158 PROVIDER_ACKNOWLEDGEMENT = 0,
00159 USER_ACKNOWLEDGEMENT = 1
00160 };
|
|
|
Definition at line 165 of file wtp.h. 00165 {
00166 INITIATOR_INDICATION = 0,
00167 RESPONDER_INDICATION = 1
00168 };
|
|
|
Definition at line 170 of file wtp.h. 00170 {
00171 TPI_ERROR = 0,
00172 TPI_INFO = 1,
00173 TPI_OPTION = 2,
00174 TPI_PSN = 3,
00175 TPI_SDU_BOUNDARY = 4,
00176 TPI_FRAME_BOUNDARY = 5
00177 };
|
|
|
Definition at line 156 of file wtp.c. References error(), event, RcvAbort, WAPEvent::RcvAck, RcvAck, RcvErrorPDU, WAPEvent::RcvInvoke, RcvInvoke, RcvNegativeAck, WAPEvent::RcvResult, RcvResult, RcvSegInvoke, WAPEvent::type, WAPEvent::u, and wap_event_dump(). Referenced by unpack_wdp_datagram_real(), wap_dispatch_datagram(), and wtp_event_dump(). 00157 {
00158
00159 switch(event->type){
00160
00161 case RcvInvoke:
00162 return event->u.RcvInvoke.tid < INITIATOR_TID_LIMIT;
00163
00164 case RcvSegInvoke:
00165 return event->u.RcvSegInvoke.tid < INITIATOR_TID_LIMIT;
00166
00167 case RcvResult:
00168 return event->u.RcvResult.tid < INITIATOR_TID_LIMIT;
00169
00170 case RcvAck:
00171 return event->u.RcvAck.tid < INITIATOR_TID_LIMIT;
00172
00173 case RcvNegativeAck:
00174 return event->u.RcvNegativeAck.tid < INITIATOR_TID_LIMIT;
00175
00176 case RcvAbort:
00177 return event->u.RcvAbort.tid < INITIATOR_TID_LIMIT;
00178
00179 case RcvErrorPDU:
00180 return event->u.RcvErrorPDU.tid < INITIATOR_TID_LIMIT;
00181
00182 default:
00183 error(1, "Received an erroneous PDU corresponding an event");
00184 wap_event_dump(event);
00185 return -1;
00186 }
00187 }
|
Here is the call graph for this function:

|
|
Definition at line 98 of file wtp.c. References concatenated_message(), data, event, gw_assert, GW_WARNING, gwlist_append(), gwlist_create, octstr_copy, octstr_delete(), octstr_destroy(), octstr_dump, octstr_duplicate, octstr_get_bits(), octstr_get_char(), octstr_len(), T_DUnitdata_Ind, WAPEvent::type, WAPEvent::u, unpack_wdp_datagram_real(), wap_event_assert(), wap_event_destroy(), wap_event_duplicate(), and warning(). Referenced by wap_dispatch_datagram(), and wtp_event_dump(). 00099 {
00100 List *events = NULL;
00101 WAPEvent *event = NULL;
00102 WAPEvent *subdgram = NULL;
00103 Octstr *data = NULL;
00104 long pdu_len;
00105
00106 gw_assert(datagram->type == T_DUnitdata_Ind);
00107
00108 events = gwlist_create();
00109
00110 if (concatenated_message(datagram->u.T_DUnitdata_Ind.user_data)) {
00111 data = octstr_duplicate(datagram->u.T_DUnitdata_Ind.user_data);
00112 octstr_delete(data, 0, 1);
00113
00114 while (octstr_len(data) != 0) {
00115
00116 if (octstr_get_bits(data, 0, 1) == 0) {
00117 pdu_len = octstr_get_char(data, 0);
00118 octstr_delete(data, 0, 1);
00119 } else {
00120 pdu_len = octstr_get_bits(data, 1, 15);
00121 octstr_delete(data, 0, 2);
00122 }
00123
00124 subdgram = wap_event_duplicate(datagram);
00125 octstr_destroy(subdgram->u.T_DUnitdata_Ind.user_data);
00126 subdgram->u.T_DUnitdata_Ind.user_data = octstr_copy(data, 0, pdu_len);
00127 wap_event_assert(subdgram);
00128 if ((event = unpack_wdp_datagram_real(subdgram)) != NULL) {
00129 wap_event_assert(event);
00130 gwlist_append(events, event);
00131 }
00132 octstr_delete(data, 0, pdu_len);
00133 wap_event_destroy(subdgram);
00134 }
00135
00136 octstr_destroy(data);
00137
00138 } else if ((event = unpack_wdp_datagram_real(datagram)) != NULL) {
00139 wap_event_assert(event);
00140 gwlist_append(events, event);
00141 } else {
00142 warning(0, "WTP: Dropping unhandled datagram data:");
00143 octstr_dump(datagram->u.T_DUnitdata_Ind.user_data, 0, GW_WARNING);
00144 }
00145
00146 return events;
00147 }
|
Here is the call graph for this function:
