freeradius.git
12 years agoInclude header file for mach_task_self
Alan T. DeKok [Sat, 24 Dec 2011 14:57:43 +0000 (09:57 -0500)]
Include header file for mach_task_self

12 years agoFix compiler warnings
Alan T. DeKok [Sat, 24 Dec 2011 14:56:45 +0000 (09:56 -0500)]
Fix compiler warnings

12 years agoInclude header file for prototypes
Alan T. DeKok [Sat, 24 Dec 2011 14:53:35 +0000 (09:53 -0500)]
Include header file for prototypes

12 years agoCasts to remove compiler warnings
Alan T. DeKok [Sat, 24 Dec 2011 14:43:12 +0000 (09:43 -0500)]
Casts to remove compiler warnings

12 years agoUse new dict_valnamebyattr function
Alan T. DeKok [Fri, 23 Dec 2011 14:34:39 +0000 (09:34 -0500)]
Use new dict_valnamebyattr function

12 years agoUse new dict_valnamebyattr function
Alan T. DeKok [Fri, 23 Dec 2011 14:26:23 +0000 (09:26 -0500)]
Use new dict_valnamebyattr function

12 years agoUse new dict_valnamebyattr function
Alan T. DeKok [Fri, 23 Dec 2011 14:26:23 +0000 (09:26 -0500)]
Use new dict_valnamebyattr function

12 years agoRemove unused variable
Alan T. DeKok [Fri, 23 Dec 2011 14:26:09 +0000 (09:26 -0500)]
Remove unused variable

12 years agoAdded new method to get name of enum from values
Alan T. DeKok [Fri, 23 Dec 2011 14:15:53 +0000 (09:15 -0500)]
Added new method to get name of enum from values

This is simpler than having duplicate code throughout the
source.

12 years agoInitialize authentication vector.
Alan T. DeKok [Tue, 20 Dec 2011 14:38:22 +0000 (09:38 -0500)]
Initialize authentication vector.

Otherwise proxied packets can have a zero authentication
vector.

12 years agoNote that "hashsize=0" is a bad idea
Alan T. DeKok [Tue, 20 Dec 2011 13:14:40 +0000 (08:14 -0500)]
Note that "hashsize=0" is a bad idea

12 years agoUse "last_found" in a thread-safe manner
Alan T. DeKok [Mon, 19 Dec 2011 20:44:37 +0000 (15:44 -0500)]
Use "last_found" in a thread-safe manner

It's a thread-local variable, not a variable global to the
configuration.

Note also that much of the rest of the module is poor.
Re-reading the files for every packet is HORRIBLE.  It causes
more threading issues.
Fixed-size hash tables are similarly poor practice.

12 years agoAs posted to the list
Alan T. DeKok [Fri, 16 Dec 2011 18:40:22 +0000 (13:40 -0500)]
As posted to the list

12 years agoAccount for EAP header and EAP-MSCHAPv2 opcode
Alan T. DeKok [Tue, 13 Dec 2011 20:07:07 +0000 (21:07 +0100)]
Account for EAP header and EAP-MSCHAPv2 opcode

Found by Matt Dayman.

12 years agoAdded "log { use_utc = yes/no }" configuration
Alan T. DeKok [Thu, 8 Dec 2011 13:48:55 +0000 (14:48 +0100)]
Added "log { use_utc = yes/no }" configuration

12 years agoMore strlen fixes
Alan T. DeKok [Sun, 4 Dec 2011 09:00:57 +0000 (10:00 +0100)]
More strlen fixes

12 years agoMore strlen fixes
Alan T. DeKok [Sun, 4 Dec 2011 08:59:50 +0000 (09:59 +0100)]
More strlen fixes

12 years agoFixed bad strlen
Alan T. DeKok [Sun, 4 Dec 2011 08:53:52 +0000 (09:53 +0100)]
Fixed bad strlen

12 years agoMore strlen fixes
Alan T. DeKok [Fri, 2 Dec 2011 16:53:11 +0000 (17:53 +0100)]
More strlen fixes

12 years agoReplace strlen with more efficient check
Alan T. DeKok [Fri, 2 Dec 2011 16:52:11 +0000 (17:52 +0100)]
Replace strlen with more efficient check

12 years agoReplace strlen with simpler check
Alan T. DeKok [Fri, 2 Dec 2011 16:48:33 +0000 (17:48 +0100)]
Replace strlen with simpler check

12 years agoPerl clone should be called sequentially, not in parallel.
Alan T. DeKok [Thu, 1 Dec 2011 13:21:03 +0000 (14:21 +0100)]
Perl clone should be called sequentially, not in parallel.

Adding a mutex fixes this.

Patch from Eike Dehling

12 years agoPrint out real password, not username
Alan T. DeKok [Tue, 29 Nov 2011 19:40:39 +0000 (20:40 +0100)]
Print out real password, not username

12 years agoAdded rad_calloc to mirror rad_malloc
Alan T. DeKok [Fri, 2 Dec 2011 16:43:33 +0000 (17:43 +0100)]
Added rad_calloc to mirror rad_malloc

12 years agoMove timers to macro
Alan T. DeKok [Tue, 29 Nov 2011 14:15:31 +0000 (15:15 +0100)]
Move timers to macro

So that we can change them later with minimal pain.
And so it's obvious which things are state machine changes,
and which are other logic

12 years agoClean up regex code
Alan T. DeKok [Tue, 29 Nov 2011 11:15:52 +0000 (12:15 +0100)]
Clean up regex code

Convert it to use pairmake_xlat, which is better.
Better ifdef's for regex support.
boot-time check for invalid regular expressions

12 years agoMove do_xlat=1 code to pairmake_xlat()
Alan T. DeKok [Tue, 29 Nov 2011 10:56:25 +0000 (11:56 +0100)]
Move do_xlat=1 code to pairmake_xlat()

This abstracts the xlat code (i.e. integer type needs string)
so that it's easier to fix it later.

12 years agoAdd "tests" target
Alan T. DeKok [Tue, 29 Nov 2011 10:47:13 +0000 (11:47 +0100)]
Add "tests" target

12 years agoPartial revert of b14fc9d3d97811
Alan T. DeKok [Tue, 29 Nov 2011 10:34:04 +0000 (11:34 +0100)]
Partial revert of b14fc9d3d97811

It turns out that there is just too much code which
rewuires writing to vp->vp_strvalue.  The regex comparisons,
xlat expansions, etc.  all require the ability to write
strings to integer-type attributes.

We'll see if there's a better way to fix this in the future.

12 years agoFixed mutex issues
Alan T. DeKok [Tue, 29 Nov 2011 09:04:32 +0000 (10:04 +0100)]
Fixed mutex issues

12 years agoFixed typo
Alan T. DeKok [Mon, 28 Nov 2011 19:24:21 +0000 (20:24 +0100)]
Fixed typo

12 years agoMore lvalue -> vp_* changes
Alan T. DeKok [Mon, 28 Nov 2011 17:50:04 +0000 (18:50 +0100)]
More lvalue -> vp_* changes

12 years agoClarify names
Alan T. DeKok [Mon, 28 Nov 2011 13:06:47 +0000 (14:06 +0100)]
Clarify names

12 years agoWrap state machine functions in STATE_MACHINE_DECL
Alan T. DeKok [Mon, 28 Nov 2011 12:59:34 +0000 (13:59 +0100)]
Wrap state machine functions in STATE_MACHINE_DECL

This makes it clearer which functions are for the state machine
and which aren't.  It also lets us later change the state machine
by changing (ideally) only one macro.

12 years agoBetter fix for previous debian bug
Alan T. DeKok [Mon, 28 Nov 2011 12:44:46 +0000 (13:44 +0100)]
Better fix for previous debian bug

12 years agonitialize data pointer before setting it
Alan T. DeKok [Mon, 28 Nov 2011 12:36:22 +0000 (13:36 +0100)]
nitialize data pointer before setting it

So that if there's an error setting it, we can free it without
the system blowing up.

Closes Debian bug #606450

12 years agoRemove old text
Alan T. DeKok [Sun, 27 Nov 2011 09:03:43 +0000 (10:03 +0100)]
Remove old text

Because it confuses people who don't read eap.conf, or
the rest of the file.

12 years agoAdded internal fr_connection_find()
Alan T. DeKok [Mon, 28 Nov 2011 11:18:50 +0000 (12:18 +0100)]
Added internal fr_connection_find()

To avoid duplicate code

12 years agoMinor reformatting
Alan T. DeKok [Mon, 28 Nov 2011 10:45:04 +0000 (11:45 +0100)]
Minor reformatting

12 years agoMinor reformatting for 80-col widths
Alan T. DeKok [Mon, 28 Nov 2011 10:44:43 +0000 (11:44 +0100)]
Minor reformatting for 80-col widths

12 years agoClean up examples
Alan T. DeKok [Sun, 27 Nov 2011 09:21:43 +0000 (10:21 +0100)]
Clean up examples

12 years agoRearrange packet list code
Alan T. DeKok [Sat, 26 Nov 2011 15:08:52 +0000 (16:08 +0100)]
Rearrange packet list code

yank no longer returns a pointer.  No one was using it, so that
work was unnecessary.

Re-arrange the code in fr_packet_cmp() so that fewer comparisons
are necessary to disambiiguate packets.

Remove workaround for bug #35 in packet_entry_cmp().  It is
no longer necessary.

The result is a somewhat faster on in-memory performance tests.
But the callgrind output stil lshows large blocks of time
spent handling the packet lists.  Those could be optimized
some more.

12 years agoPass sizeof buffer to cf_expand_variables
Alan T. DeKok [Fri, 25 Nov 2011 14:22:36 +0000 (15:22 +0100)]
Pass sizeof buffer to cf_expand_variables

12 years agoUpdated version output
Alan T. DeKok [Fri, 25 Nov 2011 12:04:53 +0000 (13:04 +0100)]
Updated version output

Moved compilation flags output from debug messages.  It shouldn't
be there.  Move it to version.c, and made it print out the
detailed list of supported functionality when using "-xv"

12 years agoMore quiet builds
Alan T. DeKok [Thu, 24 Nov 2011 08:28:24 +0000 (09:28 +0100)]
More quiet builds

12 years agoIgnore local cache directory
Alan T. DeKok [Thu, 24 Nov 2011 07:56:05 +0000 (08:56 +0100)]
Ignore local cache directory

12 years agoIgnore tar files, sig files, patches
Alan T. DeKok [Thu, 24 Nov 2011 07:55:15 +0000 (08:55 +0100)]
Ignore tar files, sig files, patches

12 years agoIgnore the doxygen _build directory
Alan T. DeKok [Thu, 24 Nov 2011 07:53:32 +0000 (08:53 +0100)]
Ignore the doxygen _build directory

12 years agoNote removal of functionality
Alan T. DeKok [Wed, 23 Nov 2011 13:32:27 +0000 (14:32 +0100)]
Note removal of functionality

12 years agoRe-arrange structure to remove padding
Alan T. DeKok [Wed, 23 Nov 2011 13:31:54 +0000 (14:31 +0100)]
Re-arrange structure to remove padding

This saves 8 bytes per VP on a 64-bit machine.  That adds up...

12 years agoNow that no one uses lvalue, delete it.
Alan T. DeKok [Tue, 22 Nov 2011 17:29:31 +0000 (18:29 +0100)]
Now that no one uses lvalue, delete it.

This shrinks the size of the VALUE_PAIR structure by 256 bytes,
which is very nice.

12 years agoDon't use lvalue, use the correct struct name
Alan T. DeKok [Tue, 22 Nov 2011 17:29:06 +0000 (18:29 +0100)]
Don't use lvalue, use the correct struct name

In preparation for removing lvalue.

12 years agoShrink the size of the VALUE_PAIR structure
Alan T. DeKok [Tue, 22 Nov 2011 16:49:02 +0000 (17:49 +0100)]
Shrink the size of the VALUE_PAIR structure

Now that we're not writing strings to integer attributes,
we can dynamically change the size of the VALUE_PAIR.
It should be large enough to contain it's necessary fields,
and *only* enough of the VALUE_PAIR_DATA structure to contain
the type-specific data.  This means we save 250 bytes
of memory for every integer / date / ipaddr VALUE_PAIR.

12 years agoRemoved "addport" functionality.
Alan T. DeKok [Tue, 22 Nov 2011 13:44:55 +0000 (14:44 +0100)]
Removed "addport" functionality.

It was always a terrible hack.  There should be better ways
to do it, like actually tracking IP addresses.

12 years agoNo need to sprintf "%s"
Alan T. DeKok [Tue, 22 Nov 2011 13:39:38 +0000 (14:39 +0100)]
No need to sprintf "%s"

Use strlcpy instead

12 years agoNo need to cast to IPv6
Alan T. DeKok [Tue, 22 Nov 2011 13:33:29 +0000 (14:33 +0100)]
No need to cast to IPv6

because we can reference the struct element directly.

12 years agoManually pull rlm_securid from the v2.1.x branch
Alan T. DeKok [Tue, 22 Nov 2011 09:46:16 +0000 (10:46 +0100)]
Manually pull rlm_securid from the v2.1.x branch

With minor changes for the 3.0 API

12 years agoCorrect typo in error message
Alan T. DeKok [Mon, 21 Nov 2011 16:47:27 +0000 (17:47 +0100)]
Correct typo in error message

ascend secret is "encrypt=3", not "encrypt=2"

12 years agoUpdate for 3.0 API
Alan T. DeKok [Sun, 20 Nov 2011 16:44:55 +0000 (17:44 +0100)]
Update for 3.0 API

We do lookups on attr+vendor, not just attr

12 years agoCorrect references
Alan T. DeKok [Sun, 20 Nov 2011 16:37:19 +0000 (17:37 +0100)]
Correct references

../foo instead of foo

12 years agosurface RFC822 subject alt name
Luke Howard [Sat, 19 Nov 2011 03:32:07 +0000 (14:32 +1100)]
surface RFC822 subject alt name

12 years agoDocument net admin capabilities
Alan T. DeKok [Fri, 18 Nov 2011 14:24:02 +0000 (15:24 +0100)]
Document net admin capabilities

So that the server can set arp table entries as non-root

12 years agoFix typo in listen.c
Arran Cudbard-Bell [Fri, 18 Nov 2011 23:06:12 +0000 (00:06 +0100)]
Fix typo in listen.c

12 years agoFixed compilation break + use of uninitialized value
Renaud Métrich [Fri, 18 Nov 2011 08:37:37 +0000 (09:37 +0100)]
Fixed compilation break + use of uninitialized value

12 years agoBuild without UDPFROMTO
Alan T. DeKok [Thu, 17 Nov 2011 16:26:40 +0000 (17:26 +0100)]
Build without UDPFROMTO

If it's defined, we do more sanity checks.  If it's not
defined, we might behave weirdly if DHCP servers on the network
are broken

12 years agoAdded DHCP relay functions
Alan T. DeKok [Thu, 17 Nov 2011 14:04:25 +0000 (15:04 +0100)]
Added DHCP relay functions

For processing client request > server and server reply -> client

The code is unused for now, but will be used shortly

12 years agoAdded sample virtual server for DHCP relaying
Alan T. DeKok [Thu, 17 Nov 2011 14:03:01 +0000 (15:03 +0100)]
Added sample virtual server for DHCP relaying

12 years agoAdded fr_dhcp_add_arp_entry
Alan T. DeKok [Thu, 17 Nov 2011 13:36:46 +0000 (14:36 +0100)]
Added fr_dhcp_add_arp_entry

This will later be used for the updated DHCP code

12 years agoEnsure struct is initialized
Alan T. DeKok [Thu, 17 Nov 2011 16:06:04 +0000 (17:06 +0100)]
Ensure struct is initialized

12 years agoAdded copyright to dictionaries
Alan T. DeKok [Thu, 17 Nov 2011 11:06:12 +0000 (12:06 +0100)]
Added copyright to dictionaries

For ones which are only in v3.0

12 years agoInclude copyright lines
Alan T. DeKok [Thu, 17 Nov 2011 11:00:42 +0000 (12:00 +0100)]
Include copyright lines

This is for people who can't be bothered to give attribution
where it's due.  The dictionary files we have here give authors,
origins, web pages, etc. where possible.  It's only reasonable
for others to do the same.

Sadly, that's asking too much of some people.  So we've added
explicit copyright statements so that people have no excuse.

12 years agoAdded minor debug message
Alan T. DeKok [Fri, 11 Nov 2011 08:26:15 +0000 (09:26 +0100)]
Added minor debug message

12 years agoClean up for 3.0
Alan T. DeKok [Sun, 13 Nov 2011 12:02:21 +0000 (13:02 +0100)]
Clean up for 3.0

Use new connection pool API.  Document it.
Use a more consistent module configuration

Less code, and it does more

12 years agoSet fr_log_fp when using '-l'
Alan T. DeKok [Fri, 11 Nov 2011 13:01:14 +0000 (14:01 +0100)]
Set fr_log_fp when using '-l'

So that we can get debugging from libfreeradius-radius

12 years agoDEBUG -> RDEBUG
Alan T. DeKok [Fri, 11 Nov 2011 12:58:50 +0000 (13:58 +0100)]
DEBUG -> RDEBUG

12 years agoEnable generation of interactive SVG diagrams
Arran Cudbard-Bell [Sun, 13 Nov 2011 00:10:28 +0000 (01:10 +0100)]
Enable generation of interactive SVG diagrams

Update Doxyfile to latest version

12 years agoTurn on DOT rendering of Class diagrams
Arran Cudbard-Bell [Sat, 12 Nov 2011 23:19:59 +0000 (00:19 +0100)]
Turn on DOT rendering of Class diagrams

12 years agoAdd certificate files to .gitignore
Arran Cudbard-Bell [Sat, 12 Nov 2011 23:13:37 +0000 (00:13 +0100)]
Add certificate files to .gitignore

12 years agoAdd .gitignore to ignore generated doxygen files
Arran Cudbard-Bell [Sat, 12 Nov 2011 23:09:38 +0000 (00:09 +0100)]
Add .gitignore to ignore generated doxygen files

12 years agoMerge pull request #34 from arr2036/valuepair_lists
Arran Cudbard-Bell [Sat, 12 Nov 2011 19:16:15 +0000 (11:16 -0800)]
Merge pull request #34 from arr2036/valuepair_lists

Valuepair lists

12 years agoPrevent radius_list_name matching on tags, assume string without preceeding colon...
Arran Cudbard-Bell [Fri, 11 Nov 2011 12:50:40 +0000 (13:50 +0100)]
Prevent radius_list_name matching on tags, assume string without preceeding colon and that starts with a lowercase letter is a list

12 years agoFixup doxygen comments
Arran Cudbard-Bell [Thu, 10 Nov 2011 19:19:21 +0000 (20:19 +0100)]
Fixup doxygen comments

12 years agoDeduplicate attribute name resolution code between valuepair.c and evaluate.c
Arran Cudbard-Bell [Thu, 10 Nov 2011 19:08:48 +0000 (20:08 +0100)]
Deduplicate attribute name resolution code between valuepair.c and evaluate.c

12 years agoMore reformatting
Alan T. DeKok [Wed, 9 Nov 2011 20:56:48 +0000 (21:56 +0100)]
More reformatting

12 years agoMore minor reformatting
Alan T. DeKok [Wed, 9 Nov 2011 20:56:48 +0000 (21:56 +0100)]
More minor reformatting

12 years agoFixup doxygen comments in exec.c
Arran Cudbard-Bell [Wed, 9 Nov 2011 13:01:14 +0000 (14:01 +0100)]
Fixup doxygen comments in exec.c

12 years agoMark section_type_value as external (holds string names of the various sections)
Arran Cudbard-Bell [Tue, 8 Nov 2011 14:52:56 +0000 (15:52 +0100)]
Mark section_type_value as external (holds string names of the various sections)

12 years agoConvert bare enums into types, in C they don't do anything, but it does help make...
Arran Cudbard-Bell [Tue, 8 Nov 2011 14:40:24 +0000 (15:40 +0100)]
Convert bare enums into types, in C they don't do anything, but it does help make the code self documenting

12 years agoUpdated the NAI document
Alan T. DeKok [Mon, 7 Nov 2011 15:19:29 +0000 (16:19 +0100)]
Updated the NAI document

12 years agoAdded new APIs to add / del a connection
Alan T. DeKok [Sun, 6 Nov 2011 15:48:01 +0000 (16:48 +0100)]
Added new APIs to add / del a connection

So that servers which accept client connections can add
connections to the pool.  And clients can delete connections
from the pool if there is an error with the connection.

Also made it a bit more forgiving.  If there is not any
"pool" config, use defaults.

12 years agoQuiet compile warnings
Alan T. DeKok [Sun, 6 Nov 2011 14:53:35 +0000 (15:53 +0100)]
Quiet compile warnings

12 years agoMake fr_tokens available from token.h or libradius.h
Arran Cudbard-Bell [Mon, 7 Nov 2011 13:57:12 +0000 (14:57 +0100)]
Make fr_tokens available from token.h or libradius.h

12 years agoAdded support for triggers
Alan T. DeKok [Sun, 6 Nov 2011 10:17:41 +0000 (11:17 +0100)]
Added support for triggers

start/stop connection pool
open/close individual connection

12 years agoPrint WARNING if we fall below "min" connections
Alan T. DeKok [Sun, 6 Nov 2011 10:02:44 +0000 (11:02 +0100)]
Print WARNING if we fall below "min" connections

We want to close idle sessions, sessions with max lifetime
or max uses.  BUT we want to enforce "min".  The code will
currently close a connection, notice "num < min", and spawn
a new one.  We warn the user that this is happening, so that
they can fix their configuration.

12 years agoRemoved unused variable
Alan T. DeKok [Sun, 6 Nov 2011 09:55:54 +0000 (10:55 +0100)]
Removed unused variable

12 years agoWe're freeing the connection, so don't use this->next
Alan T. DeKok [Sun, 6 Nov 2011 09:53:11 +0000 (10:53 +0100)]
We're freeing the connection, so don't use this->next

use this = next instead

12 years agoDon't unlock the mutex. We didn't lock it
Alan T. DeKok [Sun, 6 Nov 2011 09:52:51 +0000 (10:52 +0100)]
Don't unlock the mutex.  We didn't lock it

12 years agoInitialize "last_used" when spawning a new connection
Alan T. DeKok [Sun, 6 Nov 2011 09:21:52 +0000 (10:21 +0100)]
Initialize "last_used" when spawning a new connection

12 years agoAdd cleanup_delay configuration item with a default of five seconds
Arran Cudbard-Bell [Sun, 6 Nov 2011 01:17:29 +0000 (02:17 +0100)]
Add cleanup_delay configuration item with a default of five seconds
without this we always end up cleaning up start-spare connections
on the first few requests.

12 years agomy_request should initially be set to request
Arran Cudbard-Bell [Fri, 4 Nov 2011 16:12:13 +0000 (17:12 +0100)]
my_request should initially be set to request