aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/ulp
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2014-03-13 14:46:42 +0100
committerAnders Broman <a.broman58@gmail.com>2014-03-13 15:19:11 +0000
commitb1a05d5517d5da0e84f21c72c78c77a5e735bb86 (patch)
tree085d8bad3f51a7309fa60e2be4de5200c20506ad /asn1/ulp
parent73618c8d1c82ad64a6f6e885fbc72367082d1b26 (diff)
ULP: add UDP transport
and fix indent (use 2 spaces) Change-Id: I558616e3030a55a845cd4ba31ac32f08bdf8376d Reviewed-on: https://code.wireshark.org/review/634 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'asn1/ulp')
-rw-r--r--asn1/ulp/packet-ulp-template.c70
1 files changed, 40 insertions, 30 deletions
diff --git a/asn1/ulp/packet-ulp-template.c b/asn1/ulp/packet-ulp-template.c
index 40d9d751af..56fb0b930a 100644
--- a/asn1/ulp/packet-ulp-template.c
+++ b/asn1/ulp/packet-ulp-template.c
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * ref OMA-TS-ULP-V1_0-20060127-C
+ * ref OMA-TS-ULP-V2_0-20100806-D
* http://www.openmobilealliance.org
*/
@@ -48,7 +48,8 @@ static dissector_handle_t lpp_handle;
* oma-ulp 7275/tcp OMA UserPlane Location
* oma-ulp 7275/udp OMA UserPlane Location
*/
-static guint gbl_ulp_port = 7275;
+static guint gbl_ulp_tcp_port = 7275;
+static guint gbl_ulp_udp_port = 7275;
/* Initialize the protocol and registered fields */
static int proto_ulp = -1;
@@ -74,16 +75,16 @@ static gint ett_ulp = -1;
static guint
get_ulp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
{
- /* PDU length = Message length */
- return tvb_get_ntohs(tvb,offset);
+ /* PDU length = Message length */
+ return tvb_get_ntohs(tvb,offset);
}
static int
dissect_ulp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
- tcp_dissect_pdus(tvb, pinfo, tree, ulp_desegment, ULP_HEADER_SIZE,
- get_ulp_pdu_len, dissect_ULP_PDU_PDU, data);
- return tvb_length(tvb);
+ tcp_dissect_pdus(tvb, pinfo, tree, ulp_desegment, ULP_HEADER_SIZE,
+ get_ulp_pdu_len, dissect_ULP_PDU_PDU, data);
+ return tvb_length(tvb);
}
void proto_reg_handoff_ulp(void);
@@ -99,7 +100,7 @@ void proto_register_ulp(void) {
/* List of subtrees */
static gint *ett[] = {
- &ett_ulp,
+ &ett_ulp,
#include "packet-ulp-ettarr.c"
};
@@ -117,17 +118,22 @@ void proto_register_ulp(void) {
ulp_module = prefs_register_protocol(proto_ulp,proto_reg_handoff_ulp);
prefs_register_bool_preference(ulp_module, "desegment_ulp_messages",
- "Reassemble ULP messages spanning multiple TCP segments",
- "Whether the ULP dissector should reassemble messages spanning multiple TCP segments."
- " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
- &ulp_desegment);
+ "Reassemble ULP messages spanning multiple TCP segments",
+ "Whether the ULP dissector should reassemble messages spanning multiple TCP segments."
+ " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
+ &ulp_desegment);
/* Register a configuration option for port */
prefs_register_uint_preference(ulp_module, "tcp.port",
"ULP TCP Port",
- "Set the TCP port for ULP messages(IANA registered port is 7275)",
+ "Set the TCP port for ULP messages (IANA registered port is 7275)",
10,
- &gbl_ulp_port);
+ &gbl_ulp_tcp_port);
+ prefs_register_uint_preference(ulp_module, "udp.port",
+ "ULP UDP Port",
+ "Set the UDP port for ULP messages (IANA registered port is 7275)",
+ 10,
+ &gbl_ulp_udp_port);
}
@@ -136,21 +142,25 @@ void proto_register_ulp(void) {
void
proto_reg_handoff_ulp(void)
{
- static gboolean initialized = FALSE;
- static dissector_handle_t ulp_handle;
- static guint local_ulp_port;
-
- if (!initialized) {
- ulp_handle = find_dissector("ulp");
- dissector_add_string("media_type","application/oma-supl-ulp", ulp_handle);
- rrlp_handle = find_dissector("rrlp");
- lpp_handle = find_dissector("lpp");
- initialized = TRUE;
- } else {
- dissector_delete_uint("tcp.port", local_ulp_port, ulp_handle);
- }
-
- local_ulp_port = gbl_ulp_port;
- dissector_add_uint("tcp.port", gbl_ulp_port, ulp_handle);
+ static gboolean initialized = FALSE;
+ static dissector_handle_t ulp_tcp_handle, ulp_udp_handle;
+ static guint local_ulp_tcp_port, local_ulp_udp_port;
+
+ if (!initialized) {
+ ulp_tcp_handle = find_dissector("ulp");
+ dissector_add_string("media_type","application/oma-supl-ulp", ulp_tcp_handle);
+ ulp_udp_handle = new_create_dissector_handle(dissect_ULP_PDU_PDU, proto_ulp);
+ rrlp_handle = find_dissector("rrlp");
+ lpp_handle = find_dissector("lpp");
+ initialized = TRUE;
+ } else {
+ dissector_delete_uint("tcp.port", local_ulp_tcp_port, ulp_tcp_handle);
+ dissector_delete_uint("udp.port", local_ulp_udp_port, ulp_udp_handle);
+ }
+
+ local_ulp_tcp_port = gbl_ulp_tcp_port;
+ dissector_add_uint("tcp.port", gbl_ulp_tcp_port, ulp_tcp_handle);
+ local_ulp_udp_port = gbl_ulp_udp_port;
+ dissector_add_uint("udp.port", gbl_ulp_udp_port, ulp_udp_handle);
}