summaryrefslogtreecommitdiff
path: root/print-radius.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix indentationFrancois-Xavier Le Bail2014-11-071-1/+1
|
* Radius: update Packet Type Codes and Attribute Types with RFC/IANA namesFrancois-Xavier Le Bail2014-11-061-99/+99
|
* Added support for RADIUS Change of Authorization messagesHerwin Weststrate2014-10-101-0/+15
| | | | Defined in RFC 5176
* Added RFC4675 attributes to RADIUS dissectorHerwin Weststrate2014-10-091-4/+40
|
* Clean up tag printing.Guy Harris2014-09-081-10/+14
| | | | | | | Always show the tag as "Tag[XXX]" and always put a space between that and the rest of the value, with no comma. If the tag is present but unused, always show it as "Tag[Unused]".
* Print square brackets around the tag value in RADIUS stringsHerwin Weststrate2014-09-011-1/+1
| | | | | | | | | | | Before, VLAN attributes that had a tag 1 looked like this: Tunnel Medium Attribute (65), length: 6, Value: Tag[1]802 Tunnel Private Group Attribute (81), length: 4, Value: Tag 14 With the Tunnel-Medium-Type attribute (65), it is clear where the tag ends and the value begins. With this patch, the value for a string type (like Tunnel-Private-Group-Id) looks similar: Tunnel Private Group Attribute (81), length: 4, Value: Tag[1]4
* Added support to print radius attribute CUIHerwin Weststrate2014-05-021-1/+1
| | | | Or Chargeable User Identity, specified in RFC 4372
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-10/+10
| | | | | | | | | And, as we require at least autoconf 2.61, and as autoconf 2.61 and later have AC_TYPE_UINTn_T and AC_TYPE_INTn_T macros, we use them to define the uintN_t and intN_t macros if the system doesn't define them for us. This lets us get rid of bitypes.h as well.
* Netdissectify the to-name resolution routines.Guy Harris2014-04-041-2/+2
| | | | | | | | Have them take a netdissect_options * argument, and get the "no name resolution" flag from it. Move the declaration of dnaddr_string to addrtoname.h, along with the other XXX-to-string routines.
* NDOize Frame Relay, LMP and RADIUS decodersDenis Ovsienko2014-03-181-122/+122
|
* remove tcpdump's own CVS keywordsDenis Ovsienko2014-01-031-5/+0
| | | | | | Remove lots of $Header's and a few $Id's that all belong to the former CVS repository of tcpdump itself. These keywords have been frozen since the migration to git in late 2008.
* ndo-ize print-ascii: hex_print_with_offset()Michael Richardson2014-01-011-1/+1
|
* whitespace changesMichael Richardson2014-01-011-1/+1
|
* make consistent use of the "tstr" idiomDenis Ovsienko2013-12-261-11/+13
| | | | | | | | For each decoder that has more than one instance of truncation signaling and prints the same string in each instance make sure that the string is declared as "static const char tstr[]" right after the initial includes block. Where necessary, replace fputs(s, stdout) with equivalent printf("%s", s).
* justify declarations of struct tok arraysDenis Ovsienko2013-09-241-1/+1
| | | | | | Make sure all of them are declared const and most of them -- static. Proper declaration of token arrays is a common review point for new code that is based on existing decoders. Thus fix the issue at its root.
* Don't set the length of the attributes based on the snapshot length,guy2005-09-261-67/+94
| | | | | | | | | | | | | | | | | | | just add some additional TCHECK/TCHECK2 bounds checks to the code that dissects attributes and let that handle the snapshot length checks. Do the length check once per attribute, rather than doing a single check up front. Use TCHECK/TCHECK2 and TTEST/TTEST2, so that we print "too short" indications. Make the "too short" indications all look the same. Rename "radius_attr_print()" to "radius_attrs_print()" to make it clearer that it has a loop to print all attributes, rather than just printing one attribute. As per Steiner Haug, the length of a vendor-specific attribute includes the type and length bytes, so subtract two from the length to get the length of the attribute's data.
* From Rick Jones: the first argument to "print_unknown_data()" is aguy2004-07-211-3/+3
| | | | | | "const u_char *", not a "const char *". Clean up a comment.
* fixed confusion around OUI and SMI valueshannes2004-01-251-2/+2
|
* from Jonathan Heusser <jonny@drugphish.ch>: bugfix missing boundary checkshannes2004-01-251-4/+11
|
* bugfix from Jonathan Heusser <jonny@drugphish.ch>hannes2004-01-071-2/+2
| | | | | | | | | | | The first critical piece of code is found in print-isakmp.c:332. The function rawprint() does not check its arguments thus it's easy for an attacker to pass a big 'len' or a bogus 'loc' leading to a segmentation fault in the for loop. The second bug is located in print-radius.c:471. The for loop of print_attr_string() is written in an unsafe manner. 'length' and 'data' should be checked.
* hexdump attribute data if -vv flaghannes2003-12-151-1/+5
|
* -rework the radius decoder for a decent multiline outputhannes2003-11-261-209/+223
| | | | | | -add print_vendor_attr() for dissecting vendor proprietary attributes -add global oui.h oui.c files containing vendor IDs/Name tok2str() table developers should use this file for resolving OUIs
* Have the configure script arrange that the Makefile define _U_guy2003-11-161-4/+4
| | | | | | | | | | appropriately, and that GNUmakefile and the MSVC++ project file define it apppriately, as we do with libpcap, rather than defining it in "interface.h". Undo the rcsid-shuffling and addition of extra #includes, as we no longer need to arrange that "interface.h" be included before using _U_ in an RCS ID or copyright.
* From Neil Spring:guy2003-11-151-4/+4
| | | | | | | | | | | use "_U_" in the definitions of "rcsid[]", to eliminate complaints about those variables being unused; move the definitions after the include of "interface.h", or add an include of "interface.h", so that "_U_" is defined. Include "config.h" before including "tcpdump-stdinc.h" in "missing/datalinks.c".
* The "__attribute__((packed))" tag on structures causes some files not toguy2002-12-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | compile with Sun C, as "interface.h" isn't being included before the structures are being declared. Furthermore, in the files that Sun C *can* compile, it doesn't cause Sun C to generate code that's safe with unaligned accesses, as "__attribute__" is defined as a do-nothing macro with compilers that don't support it. Therefore, we get rid of that tag on the structures to which it was added, and instead use "EXTRACT_16BIT()" and "EXTRACT_32BIT()" to fetch 16-bit and 32-bit big-endian quantities from packets. We also fix some other references to multi-byte quantities to get rid of code that tries to do unaligned loads on platforms that don't support them. We also throw in a hack that makes those macros use "__attribute__((packed))" on structures containing only one 16-bit or 32-bit integer to get the compiler to generate unaligned-safe code rather than doing it by hand. (GCC on SPARC produces the same code that doing it by hand does; I don't know if GCC on any other big-endian strict-alignment processor generates better code for that case. On little-endian processors, as "ntohs()" and "ntohl()" might be functions, that might actually produce worse code.) Fix some places to use "%u" rather than "%d" to print unsigned quantities.
* Mark an argument as unused, to squelch compiler warnings.guy2002-11-101-2/+2
|
* put __attribute__((packed)) to packet headers. s/u_short/u_int16_t/ and soitojun2002-11-091-3/+3
| | | | forth while i'm here
* Add a few more GCC warnings on GCC >= 2 for ".devel" builds.guy2002-09-051-18/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Neil T. Spring: fixes for many of those warnings: addrtoname.c, configure.in: Linux needs netinet/ether.h for ether_ntohost print-*.c: change char *foo = "bar" to const char *foo = "bar" to appease -Wwrite-strings; should affect no run-time behavior. print-*.c: make some variables unsigned. print-bgp.c: plen ('prefix len') is unsigned, no reason to validate by comparing to zero. print-cnfp.c, print-rx.c: use intoa, provided by addrtoname, instead of inet_ntoa. print-domain.c: unsigned int l; (l=foo()) < 0 is guaranteed to be false, so check for (u_int)-1, which represents failure, explicitly. print-isakmp.c: complete initialization of attrmap objects. print-lwres.c: "if(x); print foo;" seemed much more likely to be intended to be "if(x) { print foo; }". print-smb.c: complete initialization of some structures. In addition, add some fixes for the signed vs. unsigned comparison warnings: extract.h: cast the result of the byte-extraction-and-combining, as, at least for the 16-bit version, C's integral promotions will turn "u_int16_t" into "int" if there are other "int"s nearby. print-*.c: make some more variables unsigned, or add casts to an unsigned type of signed values known not to be negative, or add casts to "int" of unsigned values known to fit in an "int", and make other changes needed to handle the aforementioned variables now being unsigned. print-isakmp.c: clean up the handling of error/status indicators in notify messages. print-ppp.c: get rid of a check that an unsigned quantity is >= 0. print-radius.c: clean up some of the bounds checking. print-smb.c: extract the word count into a "u_int" to avoid the aforementioned problems with C's integral promotions. print-snmp.c: change a check that an unsigned variable is >= 0 to a check that it's != 0. Also, fix some formats to use "%u" rather than "%d" for unsigned quantities.
* Get rid of some unnecessary includes (<time.h>, <netdb.h>, and <ctype.h>guy2002-08-061-5/+1
| | | | | are included by <tcpdump-stdinc.h>, so we don't have to include them explicitly; <errno.h> isn't needed by print routines).
* Added support for Win32, based on WinPcap.risso2002-08-011-5/+3
|
* Don't try to print entries before the first one in subtypes.fenner2002-07-031-2/+3
| | | | Submitted by: Anonymous sourceforge user (req ID 576536)
* whitespace cleanupitojun2002-06-111-67/+67
|
* Include <time.h>, if possible, to declare "ctime()".guy2002-04-201-1/+5
|
* copyright clarification.itojun2001-10-221-1/+22
|
* From Kelly Carmichael <kcarmich@ipapp.com>: remove a bogus increment ofguy2001-07-151-2/+1
| | | | | | | | the packet data pointer from the code to print a 32-bit RADIUS numerical attribute value (the increment made sense for TUNNEL_TYPE and TUNNEL_MEDIUM attributes, which have an 8-bit tag and 24-bit value, and the increment skips over the tag after printing it; however, for other attributes, with a 32-bit value, it's bogus).
* avoid strcpyitojun2001-06-251-2/+2
|
* Don't use "sizeof()" to find the minimum RADIUS packet length (although,guy2001-06-181-6/+25
| | | | | | | | | | | | | | | as it's a multiple of 4, it's probably not a problem on the most common offender here, GCC-on-ARM). Hand to the code that dissects RADIUS attributes, as the length of the attributes, min(payload length, captured payload length, length from header) minus the size of the fixed-length fields in the RADIUS packet. When printing RADIUS attributes, quit if we find one with a zero length, rather than looping infinitely.
* Patches from Michael Madore <mmadore@turbolinux.com> to includeguy2001-03-191-1/+3
| | | | | <string.h> in "print-cip.c" and "print-radius.c" to properly declare "memcmp()" and "strcpy()".
* Update Alfredo Andres's e-mail address, as per his request.guy2000-12-181-2/+2
|
* Don't print the value of a RADIUS attribute if the length is less thanguy2000-12-031-9/+58
| | | | | | | | | | | | | | | or equal to 2 (the length includes the two bytes of type and length). Don't print the values of RADIUS attributes that are supposed to be of a particular length if they have a different length. Don't use the result of "ctime()", unmodified, when printing an attribute value; the string "ctime()" supplies includes a newline, which we need to remove. The "PRINT_HEX()" macro expands into code that modifies its first argument; always set the variable in question to the appropriate value before calling the macro.
* Get rid of some includes, and use "u_int8_t" and "u_int16_t" in packetguy2000-10-101-18/+25
| | | | | | | | | | | | | | | | | | | layout definitions, as per Alfredo Andrés's suggestion. Don't use expressions with side effects inside EXTRACT macros - the arguments of those macros are used more than once, so the side-effects (incrementing the pointer) occurs more than once, and they occur in a sequence that may not be the same for all compilers. When printing a UNIX time value, extract the value into a "time_t" variable, and then pass a pointer to that variable to "ctime()", don't cast the result of "EXTRACT_32BITS()" to a pointer. Also, when printing the result of "ctime()", print only the first 24 characters, so that the newline at the end isn't printed. Cast the first argument passed to "radius_attr_print()", and the argument passed to the print function for an attribute, to "u_char *", not "char *", as those routines expect a "u_char *".
* Get rid of unnecessary includes, and use tcpdump's "ip.h" and "udp.h"guy2000-10-081-12/+5
| | | | | | | | rather than the OS's <netinet/ip.h> and <netinet/udp.h>. As per Bill Fenner's suggestion, print single-byte 2-digit hex values with "%02X" rather than manually pulling the nibbles out of the byte and converting them.
* RADIUS support, from Alfredo Andres Omella (aandres@mfom.es).guy2000-10-061-0/+789