diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-07-08 04:23:28 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-07-08 04:23:28 +0000 |
commit | 53d2a96094c69fbe8cc7bb9e0f9ff3be2a68a522 (patch) | |
tree | b1d812d2db0d3c9d97ce25a48db15b8da2a79a52 | |
parent | e578a22f4c25d628b4c134ddc4f70349aab3925b (diff) | |
download | wireshark-53d2a96094c69fbe8cc7bb9e0f9ff3be2a68a522.tar.gz wireshark-53d2a96094c69fbe8cc7bb9e0f9ff3be2a68a522.tar.bz2 wireshark-53d2a96094c69fbe8cc7bb9e0f9ff3be2a68a522.zip |
Added Johan's RADIUS dissector, finally. I modified it to fit in with the
new proto_tree routines. I also removed the check for lex and yacc from
wiretap's configure script. The IP dissector now uses
proto_register_field_array().
svn path=/trunk/; revision=348
-rw-r--r-- | AUTHORS | 4 | ||||
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | Makefile.in | 29 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | doc/ethereal.pod | 2 | ||||
-rw-r--r-- | ethereal.c | 3 | ||||
-rw-r--r-- | packet-ip.c | 59 | ||||
-rw-r--r-- | packet-radius.c | 589 | ||||
-rw-r--r-- | packet-udp.c | 11 | ||||
-rw-r--r-- | packet.h | 4 | ||||
-rw-r--r-- | wiretap/Makefile.in | 2 | ||||
-rw-r--r-- | wiretap/aclocal.m4 | 9 | ||||
-rw-r--r-- | wiretap/config.h.in | 3 | ||||
-rwxr-xr-x | wiretap/configure | 423 | ||||
-rw-r--r-- | wiretap/configure.in | 4 |
15 files changed, 750 insertions, 399 deletions
@@ -109,6 +109,10 @@ Jason Lango <jal@netapp.com> { RTSP, SDP } +Johan Feyaerts <Johan.Feyaerts@siemens.atea.be> { + RADIUS +} + Alain Magloire <alainm@rcsm.ece.mcgill.ca> was kind enough to give his permission to use his version of snprintf.c. diff --git a/Makefile.am b/Makefile.am index e1a979325b..1e49358e8b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -70,6 +70,7 @@ ethereal_SOURCES = \ packet-ppp.c \ packet-pppoe.c \ packet-pptp.c \ + packet-radius.c\ packet-raw.c \ packet-rip.c \ packet-rip.h \ @@ -106,6 +107,8 @@ ethereal_SOURCES = \ util.h EXTRA_ethereal_SOURCES = \ + dfilter-grammar.c \ + dfilter-grammar.h \ packet-snmp.c \ snprintf.c \ snprintf.h \ diff --git a/Makefile.in b/Makefile.in index 51fdb8b92d..3aa2321523 100644 --- a/Makefile.in +++ b/Makefile.in @@ -85,10 +85,10 @@ sysconf_DATA = manuf YFLAGS = -d -ethereal_SOURCES = alignment.h capture.c capture.h column.c column.h config.h dfilter-grammar.y dfilter.c dfilter.h display.c display.h ethereal.c ethereal.h ethertype.c etypes.h file.c file.h filter.c filter.h follow.c follow.h gtkpacket.c gtkpacket.h menu.c menu.h packet-aarp.c packet-arp.c packet-atalk.c packet-bootp.c packet-cdp.c packet-data.c packet-dns.c packet-dns.h packet-eth.c packet-fddi.c packet-ftp.c packet-giop.c packet-gre.c packet-http.c packet-icmpv6.c packet-ip.c packet-ip.h packet-ipsec.c packet-ipv6.c packet-ipv6.h packet-ipx.c packet-ipx.h packet-isakmp.c packet-llc.c packet-lpd.c packet-nbipx.c packet-nbns.c packet-ncp.c packet-ncp.h packet-nntp.c packet-null.c packet-osi.c packet-ospf.c packet-ospf.h packet-pop.c packet-ppp.c packet-pppoe.c packet-pptp.c packet-raw.c packet-rip.c packet-rip.h packet-rsvp.c packet-rsvp.h packet-rtsp.c packet-sdp.c packet-smb.c packet-tcp.c packet-telnet.c packet-tftp.c packet-tr.c packet-trmac.c packet-udp.c packet-vines.c packet-vines.h packet.c packet.h prefs.c prefs.h print.c print.h proto.c proto.h ps.c ps.h resolv.c resolv.h smb.h timestamp.h util.c summary.c summary.h util.h +ethereal_SOURCES = alignment.h capture.c capture.h column.c column.h config.h dfilter-grammar.y dfilter.c dfilter.h display.c display.h ethereal.c ethereal.h ethertype.c etypes.h file.c file.h filter.c filter.h follow.c follow.h gtkpacket.c gtkpacket.h menu.c menu.h packet-aarp.c packet-arp.c packet-atalk.c packet-bootp.c packet-cdp.c packet-data.c packet-dns.c packet-dns.h packet-eth.c packet-fddi.c packet-ftp.c packet-giop.c packet-gre.c packet-http.c packet-icmpv6.c packet-ip.c packet-ip.h packet-ipsec.c packet-ipv6.c packet-ipv6.h packet-ipx.c packet-ipx.h packet-isakmp.c packet-llc.c packet-lpd.c packet-nbipx.c packet-nbns.c packet-ncp.c packet-ncp.h packet-nntp.c packet-null.c packet-osi.c packet-ospf.c packet-ospf.h packet-pop.c packet-ppp.c packet-pppoe.c packet-pptp.c packet-radius.c packet-raw.c packet-rip.c packet-rip.h packet-rsvp.c packet-rsvp.h packet-rtsp.c packet-sdp.c packet-smb.c packet-tcp.c packet-telnet.c packet-tftp.c packet-tr.c packet-trmac.c packet-udp.c packet-vines.c packet-vines.h packet.c packet.h prefs.c prefs.h print.c print.h proto.c proto.h ps.c ps.h resolv.c resolv.h smb.h timestamp.h util.c summary.c summary.h util.h -EXTRA_ethereal_SOURCES = packet-snmp.c snprintf.c snprintf.h snprintf-imp.h strerror.c strerror.h +EXTRA_ethereal_SOURCES = dfilter-grammar.c dfilter-grammar.h packet-snmp.c snprintf.c snprintf.h snprintf-imp.h strerror.c strerror.h ethereal_DEPENDENCIES = @SNMP_O@ @SNPRINTF_O@ @STRERROR_O@ wiretap/libwiretap.a @@ -120,11 +120,11 @@ packet-ftp.o packet-giop.o packet-gre.o packet-http.o packet-icmpv6.o \ packet-ip.o packet-ipsec.o packet-ipv6.o packet-ipx.o packet-isakmp.o \ packet-llc.o packet-lpd.o packet-nbipx.o packet-nbns.o packet-ncp.o \ packet-nntp.o packet-null.o packet-osi.o packet-ospf.o packet-pop.o \ -packet-ppp.o packet-pppoe.o packet-pptp.o packet-raw.o packet-rip.o \ -packet-rsvp.o packet-rtsp.o packet-sdp.o packet-smb.o packet-tcp.o \ -packet-telnet.o packet-tftp.o packet-tr.o packet-trmac.o packet-udp.o \ -packet-vines.o packet.o prefs.o print.o proto.o ps.o resolv.o util.o \ -summary.o +packet-ppp.o packet-pppoe.o packet-pptp.o packet-radius.o packet-raw.o \ +packet-rip.o packet-rsvp.o packet-rtsp.o packet-sdp.o packet-smb.o \ +packet-tcp.o packet-telnet.o packet-tftp.o packet-tr.o packet-trmac.o \ +packet-udp.o packet-vines.o packet.o prefs.o print.o proto.o ps.o \ +resolv.o util.o summary.o ethereal_LDFLAGS = CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -160,13 +160,14 @@ DEP_FILES = .deps/capture.P .deps/column.P .deps/dfilter-grammar.P \ .deps/packet-ncp.P .deps/packet-nntp.P .deps/packet-null.P \ .deps/packet-osi.P .deps/packet-ospf.P .deps/packet-pop.P \ .deps/packet-ppp.P .deps/packet-pppoe.P .deps/packet-pptp.P \ -.deps/packet-raw.P .deps/packet-rip.P .deps/packet-rsvp.P \ -.deps/packet-rtsp.P .deps/packet-sdp.P .deps/packet-smb.P \ -.deps/packet-snmp.P .deps/packet-tcp.P .deps/packet-telnet.P \ -.deps/packet-tftp.P .deps/packet-tr.P .deps/packet-trmac.P \ -.deps/packet-udp.P .deps/packet-vines.P .deps/packet.P .deps/prefs.P \ -.deps/print.P .deps/proto.P .deps/ps.P .deps/resolv.P .deps/snprintf.P \ -.deps/strerror.P .deps/summary.P .deps/util.P +.deps/packet-radius.P .deps/packet-raw.P .deps/packet-rip.P \ +.deps/packet-rsvp.P .deps/packet-rtsp.P .deps/packet-sdp.P \ +.deps/packet-smb.P .deps/packet-snmp.P .deps/packet-tcp.P \ +.deps/packet-telnet.P .deps/packet-tftp.P .deps/packet-tr.P \ +.deps/packet-trmac.P .deps/packet-udp.P .deps/packet-vines.P \ +.deps/packet.P .deps/prefs.P .deps/print.P .deps/proto.P .deps/ps.P \ +.deps/resolv.P .deps/snprintf.P .deps/strerror.P .deps/summary.P \ +.deps/util.P SOURCES = $(ethereal_SOURCES) $(EXTRA_ethereal_SOURCES) OBJECTS = $(ethereal_OBJECTS) @@ -1,3 +1,7 @@ +Overview of changes in Ethereal 0.7.0: +* Addition of RTSP and SDP dissectors (Jason) +* New proto_tree and display filter system (Gilbert) + Overview of changes in Ethereal 0.6.3: * Capture dialogue window data bug-fix (Guy) * PPPoE (PPP over Ethernet) added (Jeff Jahr) diff --git a/doc/ethereal.pod b/doc/ethereal.pod index 0ac1050934..0f8790adef 100644 --- a/doc/ethereal.pod +++ b/doc/ethereal.pod @@ -378,6 +378,8 @@ B<http://ethereal.zing.org>. Brad Robel-Forrest <bradr@watchguard.com> Ashok Narayanan <ashokn@cisco.com> Aaron Hillegass <aaron@classmax.com> + Jason Lango <jal@netapp.com> + Johan Feyaerts <Johan.Feyaerts@siemens.atea.be> Alain Magloire <alainm@rcsm.ece.mcgill.ca> was kind enough to give his permission to use his version of snprintf.c. diff --git a/ethereal.c b/ethereal.c index 7ec795133e..d4f498f116 100644 --- a/ethereal.c +++ b/ethereal.c @@ -1,6 +1,6 @@ /* ethereal.c * - * $Id: ethereal.c,v 1.49 1999/07/07 23:54:12 guy Exp $ + * $Id: ethereal.c,v 1.50 1999/07/08 04:23:02 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -150,6 +150,7 @@ about_ethereal( GtkWidget *w, gpointer data ) { "Ashok Narayanan <ashokn@cisco.com>\n" "Aaron Hillegass <aaron@classmax.com>\n" "Jason Lango <jal@netapp.com>\n" + "Johan Feyaerts <Johan.Feyaerts@siemens.atea.be>\n" "\nSee http://ethereal.zing.org for more information", VERSION, comp_info_str); diff --git a/packet-ip.c b/packet-ip.c index 3d7585ff84..74a1d80307 100644 --- a/packet-ip.c +++ b/packet-ip.c @@ -1,7 +1,7 @@ /* packet-ip.c * Routines for IP and miscellaneous IP protocol packet disassembly * - * $Id: packet-ip.c,v 1.27 1999/07/07 22:51:44 gram Exp $ + * $Id: packet-ip.c,v 1.28 1999/07/08 04:23:03 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -1066,49 +1066,16 @@ dissect_igmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { void proto_register_ip(void) { - proto_ip = proto_register_protocol ( - /* name */ "Internet Protocol", - /* abbrev */ "ip" ); - - hf_ip_version = proto_register_field ( - /* name */ "Version", - /* abbrev */ "ip.version", - /* ftype */ FT_UINT8, - /* parent */ proto_ip, - /* vals[] */ NULL ); - - hf_ip_hdr_len = proto_register_field ( - /* name */ "Header Length", - /* abbrev */ "ip.hdr_len", - /* ftype */ FT_UINT8, - /* parent */ proto_ip, - /* vals[] */ NULL ); - - hf_ip_tos = proto_register_field ( - /* name */ "Type of Service", - /* abbrev */ "ip.tos", - /* ftype */ FT_UINT8, - /* parent */ proto_ip, - /* vals[] */ NULL ); - - hf_ip_tos_precedence = proto_register_field ( - /* name */ "Precedence", - /* abbrev */ "ip.tos_precedence", - /* ftype */ FT_VALS_UINT8, - /* parent */ proto_ip, - /* vals[] */ VALS(precedence_vals) ); - - hf_ip_dst = proto_register_field ( - /* name */ "Destination", - /* abbrev */ "ip.dst", - /* ftype */ FT_IPv4, - /* parent */ proto_ip, - /* vals[] */ NULL ); - - hf_ip_src = proto_register_field ( - /* name */ "Source", - /* abbrev */ "ip.src", - /* ftype */ FT_IPv4, - /* parent */ proto_ip, - /* vals[] */ NULL ); + const hf_register_info hf[] = { + { "Version", "ip.version", &hf_ip_version, FT_UINT8, NULL }, + { "Header Length", "ip.hdr_len", &hf_ip_hdr_len, FT_UINT8, NULL }, + { "Type of Service", "ip.tos", &hf_ip_tos, FT_UINT8, NULL }, + { "Precedence", "ip.tos_precedence", + &hf_ip_tos_precedence, FT_VALS_UINT8, VALS(precedence_vals) }, + { "Destination", "ip.dst", &hf_ip_dst, FT_IPv4, NULL }, + { "Source", "ip.src", &hf_ip_src, FT_IPv4, NULL } + }; + + proto_ip = proto_register_protocol ("Internet Protocol", "ip"); + proto_register_field_array(proto_ip, hf, array_length(hf)); } diff --git a/packet-radius.c b/packet-radius.c new file mode 100644 index 0000000000..88ee67774f --- /dev/null +++ b/packet-radius.c @@ -0,0 +1,589 @@ +/* packet-radius.c + * Routines for RADIUS packet disassembly + * + * $Id: packet-radius.c,v 1.1 1999/07/08 04:23:04 gram Exp $ + * + * Ethereal - Network traffic analyzer + * By Johan Feyaerts + * Copyright 1999 Johan Feyaerts + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif + +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <ctype.h> +#include <glib.h> +#include "packet.h" +#include "resolv.h" + +typedef struct _e_radiushdr { + guint8 rh_code; + guint8 rh_ident; + guint16 rh_pktlength; +} e_radiushdr; + +typedef struct _e_avphdr { + guint8 avp_type; + guint8 avp_length; +} e_avphdr; + +typedef struct _value_value_pair { + guint16 val1; + guint16 val2; +} value_value_pair; + +#define RADIUS_ACCESS_REQUEST 1 +#define RADIUS_ACCESS_ACCEPT 2 +#define RADIUS_ACCESS_REJECT 3 +#define RADIUS_ACCOUNTING_REQUEST 4 +#define RADIUS_ACCOUNTING_RESPONSE 5 +#define RADIUS_ACCESS_CHALLENGE 11 +#define RADIUS_STATUS_SERVER 12 +#define RADIUS_STATUS_CLIENT 13 +#define RADIUS_RESERVED 255 + +#define RD_TP_USER_NAME 1 +#define RD_TP_USER_PASSWORD 2 +#define RD_TP_CHAP_PASSWORD 3 +#define RD_TP_NAS_IP_ADDRESS 4 +#define RD_TP_NAS_PORT 5 +#define RD_TP_SERVICE_TYPE 6 +#define RD_TP_FRAMED_PROTOCOL 7 +#define RD_TP_FRAMED_IP_ADDRESS 8 +#define RD_TP_FRAMED_IP_NETMASK 9 +#define RD_TP_FRAMED_ROUTING 10 +#define RD_TP_FILTER_ID 11 +#define RD_TP_FRAMED_MTU 12 +#define RD_TP_FRAMED_COMPRESSION 13 +#define RD_TP_LOGIN_IP_HOST 14 +#define RD_TP_LOGIN_SERVICE 15 +#define RD_TP_LOGIN_TCP_PORT 16 +#define RD_TP_UNASSIGNED 17 +#define RD_TP_REPLY_MESSAGE 18 +#define RD_TP_CALLBACK_NUMBER 19 +#define RD_TP_CALLBACK_ID 20 +#define RD_TP_UNASSIGNED2 21 +#define RD_TP_FRAMED_ROUTE 22 +#define RD_TP_FRAMED_IPX_NETWORK 23 +#define RD_TP_STATE 24 +#define RD_TP_CLASS 25 +#define RD_TP_VENDOR_SPECIFIC 26 +#define RD_TP_SESSION_TIMEOUT 27 +#define RD_TP_IDLE_TIMEOUT 28 +#define RD_TP_TERMINATING_ACTION 29 +#define RD_TP_CALLED_STATION_ID 30 +#define RD_TP_CALLING_STATION_ID 31 +#define RD_TP_NAS_IDENTIFIER 32 +#define RD_TP_PROXY_STATE 33 +#define RD_TP_LOGIN_LAT_SERVICE 34 +#define RD_TP_LOGIN_LAT_NODE 35 +#define RD_TP_LOGIN_LAT_GROUP 36 +#define RD_TP_FRAMED_APPLETALK_LINK 37 +#define RD_TP_FRAMED_APPLETALK_NETWORK 38 +#define RD_TP_FRAMED_APPLETALK_ZONE 39 +#define RD_TP_ACCT_STATUS_TYPE 40 +#define RD_TP_ACCT_DELAY_TIME 41 +#define RD_TP_ACCT_INPUT_OCTETS 42 +#define RD_TP_ACCT_OUTPUT_OCTETS 43 +#define RD_TP_ACCT_SESSION_ID 44 +#define RD_TP_ACCT_AUTHENTIC 45 +#define RD_TP_ACCT_SESSION_TIME 46 +#define RD_TP_ACCT_INPUT_PACKETS 47 +#define RD_TP_ACCT_OUTPUT_PACKETS 48 +#define RD_TP_ACCT_TERMINATE_CAUSE 49 +#define RD_TP_ACCT_MULTI_SESSION_ID 50 +#define RD_TP_ACCT_LINK_COUNT 51 +#define RD_TP_CHAP_CHALLENGE 60 +#define RD_TP_NAS_PORT_TYPE 61 +#define RD_TP_PORT_LIMIT 62 +#define RD_TP_LOGIN_LAT_PORT 63 + + +#define AUTHENTICATOR_LENGTH 16 +#define RD_HDR_LENGTH 4 + + +#define RADIUS_STRING 1 +#define RADIUS_BINSTRING 2 +#define RADIUS_INTEGER4 3 +#define RADIUS_IP_ADDRESS 4 +#define RADIUS_SERVICE_TYPE 5 +#define RADIUS_FRAMED_PROTOCOL 6 +#define RADIUS_FRAMED_ROUTING 7 +#define RADIUS_FRAMED_COMPRESSION 8 +#define RADIUS_LOGIN_SERVICE 9 +#define RADIUS_UNKNOWN 10 +#define RADIUS_IPX_ADDRESS 11 +#define RADIUS_TERMINATING_ACTION 12 +#define RADIUS_ACCOUNTING_STATUS_TYPE 13 +#define RADIUS_ACCT_AUTHENTIC 14 +#define RADIUS_ACCT_TERMINATE_CAUSE 15 +#define RADIUS_NAS_PORT_TYPE 16 + +static value_string radius_vals[] = { + {RADIUS_ACCESS_REQUEST, "Access Request"}, + {RADIUS_ACCESS_ACCEPT, "Access Accept"}, + {RADIUS_ACCESS_REJECT, "Access Reject"}, + {RADIUS_ACCOUNTING_REQUEST, "Accounting Request"}, + {RADIUS_ACCOUNTING_RESPONSE, "Accounting Response"}, + {RADIUS_ACCESS_CHALLENGE, "Accounting challenge"}, + {RADIUS_STATUS_SERVER, "StatusServer"}, + {RADIUS_STATUS_CLIENT, "StatusClient"}, + {RADIUS_RESERVED, "Reserved"}, +{0, NULL}}; + +static value_string radius_service_type_vals[]= +{{1, "Login"}, +{2, "Framed"}, +{3, "Callback Login"}, +{4, "Callback Framed"}, +{5, "Outbound"}, +{6, "Administrative"}, +{7, "NAS Prompt"}, +{8, "Authenticate Only"}, +{9, "Callback NAS Prompt"}, +{10, "Call Check"}, +{0,NULL}}; + +static value_string radius_framed_protocol_vals[]= +{{1, "PPP"}, +{2, "SLIP"}, +{3, "Appletalk Remote Access Protocol (ARAP)"}, +{4, "Gandalf proprietary Singlelink/Multilink Protocol"}, +{5, "Xylogics proprietary IPX/SLIP"}, +{6, "X.75 Synchronous"}, +{0,NULL}}; + +static value_string radius_framed_routing_vals[]= +{{1, "Send Routing Packets"}, +{2, "Listen for routing packets"}, +{3, "Send and Listen"}, +{0,"None"}, +{0,NULL}}; + +static value_string radius_framed_compression_vals[]= +{{1, "VJ TCP/IP Header Compression"}, +{2, "IPX Header Compression"}, +{3, "Stac-LZS compression"}, +{0, "None"}, +{0,NULL}}; + +static value_string radius_login_service_vals[]= +{{1, "Rlogin"}, +{2, "TCP Clear"}, +{3, "Portmaster"}, +{4, "LAT"}, +{5, "X.25-PAD"}, +{6, "X.25T3POS"}, +{8, "TCP Clear Quit"}, +{0, "Telnet"}, +{0,NULL}}; + +static value_string radius_terminating_action_vals[]= +{{1, "RADIUS-Request"}, +{0, "Default"}, +{0,NULL}}; + +static value_string radius_accounting_status_type_vals[]= +{{1, "Start"}, +{2, "Stop"}, +{7,"Accounting-On"}, +{8,"Accounting-Off"}, +{0,NULL}}; + +static value_string radius_accounting_authentication_vals[]= +{{1, "Radius"}, +{2, "Local"}, +{7,"Remote"}, +{0,NULL}}; + +static value_string radius_acct_terminate_cause_vals[]= +{{1, "User Request"}, +{2, "Lost Carrier"}, +{3,"Lost Service"}, +{4, "Idle Timeout"}, +{5,"Session Timeout"}, +{6, "Admin Reset"}, +{7, "Admin Reboot"}, +{8, "Port Error"}, +{9, "NAS Error"}, +{10, "NAS Request"}, +{11,"NAS Reboot"}, +{12, "Port Unneeded"}, +{13, "Port Preempted"}, +{14,"Port Suspended"}, +{15,"Service Unavailable"}, +{16,"Callback"}, +{17, "User Error"}, +{18,"Host Request"}, +{0,NULL}}; + +static value_string radius_nas_port_type_vals[]= +{{0, "Async"}, +{1, "Sync"}, +{2,"ISDN Sync"}, +{3, "ISDN Async V.120"}, +{4,"ISDN Async V.110"}, +{5, "Virtual"}, +{6, "PIAFS"}, +{7, "HDLC Clear Channel"}, +{8, "X.25"}, +{9,"X.75"}, +{10, "G.3 Fax"}, +{11,"SDSL"}, +{12, "ADSL-CAP"}, +{13, "ADSL-DMT"}, +{14,"IDSL - ISDN"}, +{0,NULL}}; + +static value_value_pair radius_printinfo[] = { +{ RD_TP_USER_NAME, RADIUS_STRING }, +{ RD_TP_USER_PASSWORD,RADIUS_BINSTRING }, +{ RD_TP_CHAP_PASSWORD, RADIUS_BINSTRING }, +{ RD_TP_NAS_IP_ADDRESS, RADIUS_IP_ADDRESS }, +{ RD_TP_NAS_PORT, RADIUS_INTEGER4}, +{ RD_TP_SERVICE_TYPE, RADIUS_SERVICE_TYPE}, +{ RD_TP_FRAMED_PROTOCOL, RADIUS_FRAMED_PROTOCOL}, +{ RD_TP_FRAMED_IP_ADDRESS, RADIUS_IP_ADDRESS}, +{ RD_TP_FRAMED_IP_NETMASK, RADIUS_IP_ADDRESS}, +{ RD_TP_FRAMED_ROUTING, RADIUS_FRAMED_ROUTING}, +{ RD_TP_FILTER_ID, RADIUS_STRING}, +{ RD_TP_FRAMED_MTU, RADIUS_INTEGER4}, +{ RD_TP_FRAMED_COMPRESSION, RADIUS_FRAMED_COMPRESSION}, +{ RD_TP_LOGIN_IP_HOST, RADIUS_IP_ADDRESS}, +{ RD_TP_LOGIN_SERVICE, RADIUS_LOGIN_SERVICE}, +{ RD_TP_LOGIN_TCP_PORT, RADIUS_INTEGER4}, +{ RD_TP_UNASSIGNED, RADIUS_UNKNOWN}, +{ RD_TP_REPLY_MESSAGE, RADIUS_STRING}, +{ RD_TP_CALLBACK_NUMBER, RADIUS_BINSTRING}, +{ RD_TP_CALLBACK_ID, RADIUS_BINSTRING}, +{ RD_TP_UNASSIGNED2, RADIUS_UNKNOWN}, +{ RD_TP_FRAMED_ROUTE, RADIUS_STRING}, +{ RD_TP_FRAMED_IPX_NETWORK, RADIUS_IPX_ADDRESS}, +{ RD_TP_STATE, RADIUS_BINSTRING}, +{ RD_TP_CLASS, RADIUS_BINSTRING}, +{ RD_TP_VENDOR_SPECIFIC, RADIUS_BINSTRING}, +{ RD_TP_SESSION_TIMEOUT, RADIUS_INTEGER4}, +{ RD_TP_IDLE_TIMEOUT, RADIUS_INTEGER4}, +{ RD_TP_TERMINATING_ACTION, RADIUS_TERMINATING_ACTION}, +{ RD_TP_CALLED_STATION_ID, RADIUS_BINSTRING}, +{ RD_TP_CALLING_STATION_ID, RADIUS_BINSTRING}, +{ RD_TP_NAS_IDENTIFIER, RADIUS_BINSTRING}, +{ RD_TP_PROXY_STATE, RADIUS_BINSTRING}, +{ RD_TP_LOGIN_LAT_SERVICE, RADIUS_BINSTRING}, +{ RD_TP_LOGIN_LAT_NODE, RADIUS_BINSTRING}, +{ RD_TP_LOGIN_LAT_GROUP, RADIUS_BINSTRING}, +{ RD_TP_FRAMED_APPLETALK_LINK, RADIUS_INTEGER4}, +{ RD_TP_FRAMED_APPLETALK_NETWORK, RADIUS_INTEGER4}, +{ RD_TP_FRAMED_APPLETALK_ZONE, RADIUS_BINSTRING}, +{ RD_TP_ACCT_STATUS_TYPE, RADIUS_ACCOUNTING_STATUS_TYPE}, +{ RD_TP_ACCT_DELAY_TIME, RADIUS_INTEGER4}, +{ RD_TP_ACCT_INPUT_OCTETS, RADIUS_INTEGER4}, +{ RD_TP_ACCT_OUTPUT_OCTETS, RADIUS_INTEGER4}, +{ RD_TP_ACCT_SESSION_ID, RADIUS_STRING}, +{ RD_TP_ACCT_AUTHENTIC, RADIUS_ACCT_AUTHENTIC}, +{ RD_TP_ACCT_SESSION_TIME, RADIUS_INTEGER4}, +{ RD_TP_ACCT_INPUT_PACKETS, RADIUS_INTEGER4}, +{ RD_TP_ACCT_OUTPUT_PACKETS, RADIUS_INTEGER4}, +{ RD_TP_ACCT_TERMINATE_CAUSE, RADIUS_ACCT_TERMINATE_CAUSE}, +{ RD_TP_ACCT_MULTI_SESSION_ID, RADIUS_STRING}, +{ RD_TP_ACCT_LINK_COUNT, RADIUS_INTEGER4}, +{ RD_TP_CHAP_CHALLENGE, RADIUS_BINSTRING}, +{ RD_TP_NAS_PORT_TYPE, RADIUS_NAS_PORT_TYPE}, +{ RD_TP_PORT_LIMIT, RADIUS_INTEGER4}, +{ RD_TP_LOGIN_LAT_PORT, RADIUS_BINSTRING}, +{0,0}, +}; + +static value_string radius_attrib_type_vals[] = { +{ RD_TP_USER_NAME, "User Name"}, +{ RD_TP_USER_PASSWORD, "User Password"}, +{ RD_TP_CHAP_PASSWORD, "Chap Password"}, +{ RD_TP_NAS_IP_ADDRESS, "NAS IP Address"}, +{ RD_TP_NAS_PORT, "NAS Port"}, +{ RD_TP_SERVICE_TYPE, "Service Type"}, +{ RD_TP_FRAMED_PROTOCOL, "Framed Protocol"}, +{ RD_TP_FRAMED_IP_ADDRESS, "Framed IP Address"}, +{ RD_TP_FRAMED_IP_NETMASK, "Framed IP Netmask"}, +{ RD_TP_FRAMED_ROUTING, "Framed Routing"}, +{ RD_TP_FILTER_ID, "Filter Id"}, +{ RD_TP_FRAMED_MTU, "Framed MTU"}, +{ RD_TP_FRAMED_COMPRESSION, "Framed Compression"}, +{ RD_TP_LOGIN_IP_HOST, "Login IP Host"}, +{ RD_TP_LOGIN_SERVICE, "Login Service"}, +{ RD_TP_LOGIN_TCP_PORT, "Login TCP Port"}, +{ RD_TP_UNASSIGNED, "Unassigned"}, +{ RD_TP_REPLY_MESSAGE, "Reply Message"}, +{ RD_TP_CALLBACK_NUMBER, "Callback Number"}, +{ RD_TP_CALLBACK_ID, "Callback Id"}, +{ RD_TP_UNASSIGNED2, "Unassigned"}, +{ RD_TP_FRAMED_ROUTE, "Framed Route"}, +{ RD_TP_FRAMED_IPX_NETWORK, "Framed IPX network"}, +{ RD_TP_STATE, "State"}, +{ RD_TP_CLASS, "Class"}, +{ RD_TP_VENDOR_SPECIFIC, "Vendor Specific" }, +{ RD_TP_SESSION_TIMEOUT, "Session Timeout"}, +{ RD_TP_IDLE_TIMEOUT, "Idle Timeout"}, +{ RD_TP_TERMINATING_ACTION, "Terminating Action"}, +{ RD_TP_CALLED_STATION_ID, "Called Station Id"}, +{ RD_TP_CALLING_STATION_ID, "Calling Station Id"}, +{ RD_TP_NAS_IDENTIFIER, "NAS identifier"}, +{ RD_TP_PROXY_STATE, "Proxy State"}, +{ RD_TP_LOGIN_LAT_SERVICE, "Login LAT Service"}, +{ RD_TP_LOGIN_LAT_NODE, "Login LAT Node"}, +{ RD_TP_LOGIN_LAT_GROUP, "Login LAT Group"}, +{ RD_TP_FRAMED_APPLETALK_LINK, "Framed Appletalk Link"}, +{ RD_TP_FRAMED_APPLETALK_NETWORK, "Framed Appletalk Network"}, +{ RD_TP_FRAMED_APPLETALK_ZONE, "Framed Appletalk Zone"}, +{ RD_TP_ACCT_STATUS_TYPE, "Acct Status Type"}, +{ RD_TP_ACCT_DELAY_TIME, "Acct Delay Time"}, +{ RD_TP_ACCT_INPUT_OCTETS, "Acct Input Octets"}, +{ RD_TP_ACCT_OUTPUT_OCTETS, "Acct Output Octets"}, +{ RD_TP_ACCT_SESSION_ID, "Acct Session Id"}, +{ RD_TP_ACCT_AUTHENTIC, "Acct Authentic"}, +{ RD_TP_ACCT_SESSION_TIME, "Acct Session Time"}, +{ RD_TP_ACCT_INPUT_PACKETS, "Acct Input Packets"}, +{ RD_TP_ACCT_OUTPUT_PACKETS, "Acct Output Packets"}, +{ RD_TP_ACCT_TERMINATE_CAUSE, "Acct Terminate Cause"}, +{ RD_TP_ACCT_MULTI_SESSION_ID, "Acct Multi Session Id"}, +{ RD_TP_ACCT_LINK_COUNT, "Acct Link Count"}, +{ RD_TP_CHAP_CHALLENGE, "Chap Challenge"}, +{ RD_TP_NAS_PORT_TYPE, "NAS Port Type"}, +{ RD_TP_PORT_LIMIT, "Port Limit"}, +{ RD_TP_LOGIN_LAT_PORT, "Login LAT Port"}, +{0,NULL}, +}; + +guint32 match_numval(guint32 val, const value_value_pair *vs) +{ + guint32 i = 0; + + while (vs[i].val1) { + if (vs[i].val1 == val) + return(vs[i].val2); + i++; + } + + return(0); +} + +static gchar textbuffer[2000]; + +gchar *rdconvertbufftostr(guint8 length,const guint8 *pd) +{ +/*converts the raw buffer into printable text */ +guint32 i; +guint32 totlen=0; + + textbuffer[0]='"'; + textbuffer[1]=0; + totlen=1; + for (i=0; i < (guint32)length; i++) + { + if( isalnum((int)pd[i])||ispunct((int)pd[i]) + ||((int)pd[i]==' ')) { + textbuffer[totlen]=(gchar)pd[i]; + totlen++; + } + else + { + sprintf(&(textbuffer[totlen]), "\\%03u", pd[i]); + totlen=totlen+strlen(&(textbuffer[totlen])); + } + } + textbuffer[totlen]='"'; + textbuffer[totlen+1]=0; + return textbuffer; +} + +gchar *rd_value_to_str(e_avphdr *avph,const u_char *pd, int offset) +{ +int print_type; +gchar *result; +guint32 intval; +value_string *valstrarr; +/* prints the values of the attribute value pairs into a text buffer */ + print_type=match_numval(avph->avp_type,radius_printinfo); + intval=pntohl(&(pd[offset+2])); + switch(print_type) + { + case( RADIUS_STRING ): + case( RADIUS_BINSTRING ): + +result=rdconvertbufftostr(avph->avp_length-2,&(pd[offset+2])); + break; + case( RADIUS_INTEGER4 ): + sprintf(textbuffer,"%u", intval); + result=textbuffer; + break; + case( RADIUS_IP_ADDRESS ): + sprintf(textbuffer,"%u.%u.%u.%u",(guint8)pd[offset+2], + (guint8)pd[offset+3],(guint8)pd[offset+4], + (guint8)pd[offset+5]); + result=textbuffer; + break; + case( RADIUS_SERVICE_TYPE ): + valstrarr=radius_service_type_vals; + result=match_strval(intval,valstrarr); + break; + case( RADIUS_FRAMED_PROTOCOL ): + valstrarr= radius_framed_protocol_vals; + result=match_strval(intval,valstrarr); + break; + case( RADIUS_FRAMED_ROUTING ): + valstrarr=radius_framed_routing_vals; + result=match_strval(intval,valstrarr); + break; + case( RADIUS_FRAMED_COMPRESSION ): + valstrarr=radius_framed_compression_vals; + result=match_strval(intval,valstrarr); + break; + case( RADIUS_LOGIN_SERVICE ): + valstrarr=radius_login_service_vals; + result=match_strval(intval,valstrarr); + break; + case( RADIUS_IPX_ADDRESS ): + sprintf(textbuffer,"%u:%u:%u:%u",(guint8)pd[offset+2], + (guint8)pd[offset+3],(guint8)pd[offset+4], + (guint8)pd[offset+5]); + result=textbuffer; + case( RADIUS_TERMINATING_ACTION ): + valstrarr=radius_terminating_action_vals; + result=match_strval(intval,valstrarr); + break; + case( RADIUS_ACCOUNTING_STATUS_TYPE ): + valstrarr=radius_accounting_status_type_vals; + result=match_strval(intval,valstrarr); + break; + case( RADIUS_ACCT_AUTHENTIC ): + valstrarr=radius_accounting_authentication_vals; + result=match_strval(intval,valstrarr); + break; + case( RADIUS_ACCT_TERMINATE_CAUSE ): + valstrarr=radius_acct_terminate_cause_vals; + result=match_strval(intval,valstrarr); + break; + case( RADIUS_NAS_PORT_TYPE ): + valstrarr=radius_nas_port_type_vals; + result=match_strval(intval,valstrarr); + break; + case( RADIUS_UNKNOWN ): + default: + result="Unknown Value Type"; + break; + } + if (result == NULL) result="Unknown Value"; + return result; +} + + +void dissect_attribute_value_pairs(const u_char *pd, int offset, frame_data +*fd, proto_tree *tree, int avplength) +{ +/* adds the attribute value pairs to the tree */ + e_avphdr avph; + gchar *avptpstrval; + gchar *valstr; + if (avplength==0) + { + proto_tree_add_text(tree,offset,0,"No Attribute Value Pairs +Found"); + return; + } + while (avplength > 0 ) + { + memcpy(&avph,&pd[offset],sizeof(e_avphdr)); + avplength=avplength-avph.avp_length; + avptpstrval=match_strval(avph.avp_type, radius_attrib_type_vals); + if (avptpstrval == NULL) avptpstrval="Unknown Type"; + valstr=rd_value_to_str(&avph, pd, offset); + proto_tree_add_text(tree,offset,avph.avp_length, + "t:%s(%d) l:%d, value:%s", + avptpstrval,avph.avp_type,avph.avp_length,valstr); + offset=offset+avph.avp_length; + } +} +void dissect_radius(const u_char *pd, int offset, frame_data *fd, +proto_tree +*tree) +{ + proto_tree *radius_tree,*avptree; + proto_item *ti,*avptf; + int rhlength; + int rhcode; + int rhident; + int avplength,hdrlength, offsetavp; + e_radiushdr rh; + + gchar *codestrval; + + memcpy(&rh,&pd[offset],sizeof(e_radiushdr)); + + + rhcode= (int)rh.rh_code; + rhident= (int)rh.rh_ident; + rhlength= (int)ntohs(rh.rh_pktlength); + codestrval= match_strval(rhcode,radius_vals); + if (check_col(fd, COL_PROTOCOL)) + col_add_str(fd, COL_PROTOCOL, "RADIUS"); + if (check_col(fd, COL_INFO) && codestrval !=NULL) + { + col_add_fstr(fd,COL_INFO,codestrval); + } + + if (tree) + { + + ti = proto_tree_add_text(tree, offset, rhlength, "RADIUS"); + + radius_tree = proto_item_add_subtree(ti, ETT_RADIUS); + proto_tree_add_text(radius_tree, offset, 1, + "Packet code:0x%01x (%s)",rhcode, codestrval); + proto_tree_add_text(radius_tree, offset+1, 1, + "Packet identifier: 0x%01x (%d)", rhident, rhident); + proto_tree_add_text(radius_tree, offset+2, 2, + "Packet length: 0x%02x (%d)", rhlength,rhlength); + proto_tree_add_text(radius_tree, offset+4, AUTHENTICATOR_LENGTH, + "Authenticator"); + hdrlength=RD_HDR_LENGTH+AUTHENTICATOR_LENGTH; + avplength= rhlength - hdrlength; + + offsetavp=offset+hdrlength; + + + /* list the attribute value pairs */ + avptf = proto_tree_add_text(radius_tree, + offset+hdrlength,avplength, + "Attribute value pairs"); + avptree = proto_item_add_subtree(avptf, ETT_RADIUS_AVP); + if (avptree !=NULL) + { + dissect_attribute_value_pairs( pd, + offsetavp,fd,avptree,avplength); + } + } +} diff --git a/packet-udp.c b/packet-udp.c index f020984bbb..1797409ea5 100644 --- a/packet-udp.c +++ b/packet-udp.c @@ -1,7 +1,7 @@ /* packet-udp.c * Routines for UDP packet disassembly * - * $Id: packet-udp.c,v 1.19 1999/07/07 22:51:57 gram Exp $ + * $Id: packet-udp.c,v 1.20 1999/07/08 04:23:04 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -67,6 +67,10 @@ typedef struct _e_udphdr { #define UDP_PORT_ISAKMP 500 #define UDP_PORT_RIP 520 #define UDP_PORT_VINES 573 +#define UDP_PORT_RADIUS 1645 +#define UDP_PORT_RADIUS_NEW 1812 +#define UDP_PORT_RADACCT 1646 +#define UDP_PORT_RADACCT_NEW 1813 struct hash_struct { @@ -232,6 +236,11 @@ dissect_udp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { /* This is the first point of call, but it adds a dynamic call */ udp_hash_add(MAX(uh_sport, uh_dport), dissect_tftp); /* Add to table */ dissect_tftp(pd, offset, fd, tree); + } else if (PORT_IS(UDP_PORT_RADIUS) || + PORT_IS(UDP_PORT_RADACCT) || + PORT_IS(UDP_PORT_RADIUS_NEW) || + PORT_IS(UDP_PORT_RADACCT_NEW) ) { + dissect_radius(pd, offset, fd, tree); } else { /* OK, find a routine in the table, else use the default */ @@ -1,7 +1,7 @@ /* packet.h * Definitions for packet disassembly structures and routines * - * $Id: packet.h,v 1.65 1999/07/07 22:51:58 gram Exp $ + * $Id: packet.h,v 1.66 1999/07/08 04:23:04 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -285,6 +285,8 @@ enum { ETT_RSVP_ADSPEC_SUBTREE3, ETT_RTSP, ETT_SDP, + ETT_RADIUS, + ETT_RADIUS_AVP, NUM_TREE_TYPES /* last item number plus one */ }; diff --git a/wiretap/Makefile.in b/wiretap/Makefile.in index ac64d08b57..701e55d21b 100644 --- a/wiretap/Makefile.in +++ b/wiretap/Makefile.in @@ -65,12 +65,10 @@ GLIB_LIBS = @GLIB_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ -LEX = @LEX@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ VERSION = @VERSION@ -YACC = @YACC@ noinst_LIBRARIES = libwiretap.a diff --git a/wiretap/aclocal.m4 b/wiretap/aclocal.m4 index 6b96f7217a..ffc2db8608 100644 --- a/wiretap/aclocal.m4 +++ b/wiretap/aclocal.m4 @@ -324,15 +324,6 @@ for am_file in <<$1>>; do done<<>>dnl>>) changequote([,]))]) - -dnl AM_PROG_LEX -dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT -AC_DEFUN(AM_PROG_LEX, -[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1) -AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex") -AC_PROG_LEX -AC_DECL_YYTEXT]) - # Configure paths for GTK+ # Owen Taylor 97-11-3 diff --git a/wiretap/config.h.in b/wiretap/config.h.in index 4486b95254..8dde405558 100644 --- a/wiretap/config.h.in +++ b/wiretap/config.h.in @@ -3,9 +3,6 @@ /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS -/* Define if lex declares yytext as a char * by default, not a char[]. */ -#undef YYTEXT_POINTER - #undef HAVE_GLIB10 /* Define if you have the <unistd.h> header file. */ diff --git a/wiretap/configure b/wiretap/configure index 5f52b5ff45..a74407d1de 100755 --- a/wiretap/configure +++ b/wiretap/configure @@ -1042,301 +1042,10 @@ else echo "$ac_t""no" 1>&6 fi -for ac_prog in 'bison -y' byacc -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1051: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$YACC"; then - ac_cv_prog_YACC="$YACC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_YACC="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -YACC="$ac_cv_prog_YACC" -if test -n "$YACC"; then - echo "$ac_t""$YACC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -test -n "$YACC" && break -done -test -n "$YACC" || YACC="yacc" - -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1082: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext <<EOF -#line 1097 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1103: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext <<EOF -#line 1114 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext <<EOF -#line 1131 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - -missing_dir=`cd $ac_aux_dir && pwd` -for ac_prog in flex lex -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1167: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$LEX"; then - ac_cv_prog_LEX="$LEX" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LEX="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -LEX="$ac_cv_prog_LEX" -if test -n "$LEX"; then - echo "$ac_t""$LEX" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -test -n "$LEX" && break -done -test -n "$LEX" || LEX=""$missing_dir/missing flex"" - -# Extract the first word of "flex", so it can be a program name with args. -set dummy flex; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1200: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$LEX"; then - ac_cv_prog_LEX="$LEX" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LEX="flex" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex" -fi -fi -LEX="$ac_cv_prog_LEX" -if test -n "$LEX"; then - echo "$ac_t""$LEX" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$LEXLIB" -then - case "$LEX" in - flex*) ac_lib=fl ;; - *) ac_lib=l ;; - esac - echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:1234: checking for yywrap in -l$ac_lib" >&5 -ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-l$ac_lib $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1242 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap(); - -int main() { -yywrap() -; return 0; } -EOF -if { (eval echo configure:1253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LEXLIB="-l$ac_lib" -else - echo "$ac_t""no" 1>&6 -fi - -fi - -echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:1276: checking lex output file root" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # The minimal lex program is just a single line: %%. But some broken lexes -# (Solaris, I think it was) want two %% lines, so accommodate them. -echo '%% -%%' | $LEX -if test -f lex.yy.c; then - ac_cv_prog_lex_root=lex.yy -elif test -f lexyy.c; then - ac_cv_prog_lex_root=lexyy -else - { echo "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; } -fi -fi - -echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 -LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root - -echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:1297: checking whether yytext is a pointer" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # POSIX says lex can declare yytext either as a pointer or an array; the -# default is implementation-dependent. Figure out which it is, since -# not all implementations provide the %pointer and %array declarations. -ac_cv_prog_lex_yytext_pointer=no -echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c -ac_save_LIBS="$LIBS" -LIBS="$LIBS $LEXLIB" -cat > conftest.$ac_ext <<EOF -#line 1309 "configure" -#include "confdefs.h" -`cat $LEX_OUTPUT_ROOT.c` -int main() { - -; return 0; } -EOF -if { (eval echo configure:1316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_prog_lex_yytext_pointer=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* -LIBS="$ac_save_LIBS" -rm -f "${LEX_OUTPUT_ROOT}.c" - -fi - -echo "$ac_t""$ac_cv_prog_lex_yytext_pointer" 1>&6 -if test $ac_cv_prog_lex_yytext_pointer = yes; then - cat >> confdefs.h <<\EOF -#define YYTEXT_POINTER 1 -EOF - -fi - # If we're running gcc, add '-Wall' to CFLAGS. echo $ac_n "checking to see if we can add '-Wall' to CFLAGS""... $ac_c" 1>&6 -echo "configure:1340: checking to see if we can add '-Wall' to CFLAGS" >&5 +echo "configure:1049: checking to see if we can add '-Wall' to CFLAGS" >&5 if test x$GCC != x ; then CFLAGS="-Wall $CFLAGS" echo "$ac_t""yes" 1>&6 @@ -1398,7 +1107,7 @@ fi # Extract the first word of "glib-config", so it can be a program name with args. set dummy glib-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1402: checking for $ac_word" >&5 +echo "configure:1111: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GLIB_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1433,7 +1142,7 @@ fi min_glib_version=1.1.0 echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6 -echo "configure:1437: checking for GLIB - version >= $min_glib_version" >&5 +echo "configure:1146: checking for GLIB - version >= $min_glib_version" >&5 no_glib="" if test "$GLIB_CONFIG" = "no" ; then no_glib=yes @@ -1456,7 +1165,7 @@ echo "configure:1437: checking for GLIB - version >= $min_glib_version" >&5 echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext <<EOF -#line 1460 "configure" +#line 1169 "configure" #include "confdefs.h" #include <glib.h> @@ -1532,7 +1241,7 @@ main () } EOF -if { (eval echo configure:1536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1566,7 +1275,7 @@ fi CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" cat > conftest.$ac_ext <<EOF -#line 1570 "configure" +#line 1279 "configure" #include "confdefs.h" #include <glib.h> @@ -1576,7 +1285,7 @@ int main() { return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ; return 0; } EOF -if { (eval echo configure:1580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" @@ -1666,7 +1375,7 @@ fi # Extract the first word of "gtk-config", so it can be a program name with args. set dummy gtk-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1670: checking for $ac_word" >&5 +echo "configure:1379: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1701,7 +1410,7 @@ fi min_gtk_version=1.0.0 echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 -echo "configure:1705: checking for GTK - version >= $min_gtk_version" >&5 +echo "configure:1414: checking for GTK - version >= $min_gtk_version" >&5 no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes @@ -1724,7 +1433,7 @@ echo "configure:1705: checking for GTK - version >= $min_gtk_version" >&5 echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext <<EOF -#line 1728 "configure" +#line 1437 "configure" #include "confdefs.h" #include <gtk/gtk.h> @@ -1802,7 +1511,7 @@ main () } EOF -if { (eval echo configure:1806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1836,7 +1545,7 @@ fi CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat > conftest.$ac_ext <<EOF -#line 1840 "configure" +#line 1549 "configure" #include "confdefs.h" #include <gtk/gtk.h> @@ -1846,7 +1555,7 @@ int main() { return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } EOF -if { (eval echo configure:1850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK or finding the wrong" @@ -1890,13 +1599,93 @@ EOF fi +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1604: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext <<EOF +#line 1619 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext <<EOF +#line 1636 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1642: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext <<EOF +#line 1653 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1659: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1895: checking for ANSI C header files" >&5 +echo "configure:1684: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1900 "configure" +#line 1689 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -1904,7 +1693,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1921,7 +1710,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 1925 "configure" +#line 1714 "configure" #include "confdefs.h" #include <string.h> EOF @@ -1939,7 +1728,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 1943 "configure" +#line 1732 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -1960,7 +1749,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 1964 "configure" +#line 1753 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1971,7 +1760,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1998,17 +1787,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2002: checking for $ac_hdr" >&5 +echo "configure:1791: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2007 "configure" +#line 1796 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1801: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2181,17 +1970,13 @@ s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@CC@%$CC%g s%@RANLIB@%$RANLIB%g -s%@YACC@%$YACC%g -s%@LEX@%$LEX%g -s%@LEXLIB@%$LEXLIB%g -s%@CPP@%$CPP%g -s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g s%@GLIB_CONFIG@%$GLIB_CONFIG%g s%@GLIB_CFLAGS@%$GLIB_CFLAGS%g s%@GLIB_LIBS@%$GLIB_LIBS%g s%@GTK_CONFIG@%$GTK_CONFIG%g s%@GTK_CFLAGS@%$GTK_CFLAGS%g s%@GTK_LIBS@%$GTK_LIBS%g +s%@CPP@%$CPP%g CEOF EOF diff --git a/wiretap/configure.in b/wiretap/configure.in index 15b9e90e37..c2ecd2279c 100644 --- a/wiretap/configure.in +++ b/wiretap/configure.in @@ -1,4 +1,4 @@ -# $Id: configure.in,v 1.10 1999/07/07 22:52:53 gram Exp $ +# $Id: configure.in,v 1.11 1999/07/08 04:23:28 gram Exp $ dnl Process this file with autoconf to produce a configure script. AC_INIT(wtap.c) AM_INIT_AUTOMAKE(libwtap.a, 0.0.0) @@ -7,8 +7,6 @@ AM_CONFIG_HEADER(config.h) dnl Checks for programs. AC_PROG_CC AC_PROG_RANLIB -AC_PROG_YACC -AM_PROG_LEX # If we're running gcc, add '-Wall' to CFLAGS. AC_MSG_CHECKING(to see if we can add '-Wall' to CFLAGS) |