aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2009-01-13 06:54:06 +0000
committerGuy Harris <guy@alum.mit.edu>2009-01-13 06:54:06 +0000
commita2f9627d095350be7bb94d7bad7b84fc85c01ada (patch)
tree696137ebd44ff9a5607601fdcdb813f8e14a0a99 /plugins
parent144f4d7c0a511cceb58cf0471b9d392182ac097b (diff)
Fix the URL for the RLM stuff at Cisco.
Add some heuristics to the RLM LAPD-over-UDP dissector, so as not to misdissect as many packets. Fetch the LAPD dissector handle only once. Change some Boolean arguments to gboolean from int. svn path=/trunk/; revision=27217
Diffstat (limited to 'plugins')
-rw-r--r--plugins/rlm/packet-rlm.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/plugins/rlm/packet-rlm.c b/plugins/rlm/packet-rlm.c
index ce98977efa..db05bab821 100644
--- a/plugins/rlm/packet-rlm.c
+++ b/plugins/rlm/packet-rlm.c
@@ -28,7 +28,7 @@
* many redundant NASes. I don't know much about the format, but you
* can read about the feature here:
*
- * http://www.cisco.com/univercd/cc/td/doc/product/software/ios120/120newft/120t/120t3/rlm_123.htm
+ * http://www.cisco.com/en/US/docs/ios/12_0t/12_0t3/feature/guide/rlm_123.html
*
* RLM runs on a UDP port (default 3000) between the MGC and the NAS.
* On port N+1 (default 3001), a Q.931/LAPD/UDP connection is maintained.
@@ -57,6 +57,7 @@
#include <glib.h>
#include <epan/packet.h>
+#include <epan/xdlc.h>
/* Initialize the protocol and registered fields */
static int proto_rlm = -1;
@@ -86,6 +87,7 @@ static gint ett_rlm = -1;
Maybe this isn't the best place for it, but RLM goes hand in hand
with Q.931 traffic on a higher port.
*/
+static dissector_handle_t lapd_handle;
static gboolean
dissect_udp_lapd(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree) {
@@ -95,7 +97,20 @@ dissect_udp_lapd(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree) {
|| pinfo->destport != pinfo->srcport)
return FALSE;
- call_dissector(find_dissector("lapd"), tvb, pinfo, tree);
+ /*
+ * XXX - check for a valid LAPD address field.
+ */
+
+ /*
+ * OK, check whether the control field looks valid.
+ */
+ if (!check_xdlc_control(tvb, 2, NULL, NULL, FALSE, FALSE))
+ return FALSE;
+
+ /*
+ * Loooks OK - call the LAPD dissector.
+ */
+ call_dissector(lapd_handle, tvb, pinfo, tree);
return TRUE;
}
@@ -175,6 +190,11 @@ dissect_rlm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void
proto_reg_handoff_rlm(void)
{
+ /*
+ * Find a handle for the LAPD dissector.
+ */
+ lapd_handle = find_dissector("lapd");
+
heur_dissector_add("udp", dissect_rlm, proto_rlm);
heur_dissector_add("udp", dissect_udp_lapd, proto_get_id_by_filter_name("lapd"));
}