+++ /dev/null
- The files in this directory are placed under the LGPL, as given
-in the LICENSE file in this directory.
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/*
- * $Id$
+/** Structures and prototypes for this utility library
*
* @file src/lib/util/base.h
- * @brief Structures and prototypes for the radius library.
*
* @copyright 1999-2014 The FreeRADIUS server project
*/
-/*
- * Compiler hinting macros. Included here for 3rd party consumers
- * of libradius.h.
- *
- * @note Defines RCSIDH.
- */
#include <freeradius-devel/build.h>
RCSIDH(libradius_h, "$Id$")
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-/**
- * @file lib/util/base64.c
+/** Encode/decode binary data using printable characters
*
* @see RFC 3548 <http://www.ietf.org/rfc/rfc3548.txt>.
*
- * @brief Encode/decode binary data using printable characters.
+ * @file src/lib/util/base64.c
* @author Simon Josefsson.
*/
RCSID("$Id$")
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Encode and decode data in base64 format
*
- * @file lib/util/base64.h
- * @brief Encode and decode data in base64 format.
+ * @file src/lib/util/base64.h
*
* @author Simon Josefsson
* @copyright 2004, 2005, 2006 Free Software Foundation, Inc.
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Functions to iterate over a sets and subsets of items
*
- * @file lib/util/cursor.c
- * @brief Functions to iterate over a sets and subsets of items.
+ * @file src/lib/util/cursor.c
*
* @note Do not modify collections of items pointed to by a cursor
* with none fr_cursor_* functions over the lifetime of that cursor.
#include <stddef.h>
#include <freeradius-devel/build.h>
-/**
- * $Id$
+/** Functions to iterate over a sets and subsets of items
*
- * @file lib/util/cursor.h
- * @brief Generic linked list cursor.
+ * @file src/lib/util/cursor.h
*
* @copyright 2016 The FreeRADIUS server project
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/debug.c
- * @brief Various functions to aid in debugging
+/** Functions to help with debugging
+ *
+ * @file src/lib/util/debug.c
*
* @copyright 2013 The FreeRADIUS server project
* @copyright 2013 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/*
- * $Id$
+/** Debugging function definitions and structures
*
- * @file lib/util/debug.h
- * @brief Debugging function definitions and structures.
+ * @file src/lib/util/debug.h
*
* @copyright 2015-2017 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/dict.c
- * @brief Functions to parse FreeRADIUS dictionary file(s).
+/** Multi-protocol AVP dictionary API
+ *
+ * @file src/lib/util/dict.c
*
* @copyright 2000,2006 The FreeRADIUS server project
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Multi-protocol AVP dictionary API
*
- * @file lib/util/dict.h
- * @brief Multi-protocol attribute dictionary API.
+ * @file src/lib/util/dict.h
*
* @copyright 2015 The FreeRADIUS server project
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Doubly linked list implementation
*
- * @file util/dlist.h
- * @brief Doubly linked list implementation
+ * @file src/lib/util/dlist.h
*
* @copyright 2016 Alan DeKok <aland@freeradius.org>
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/event.c
- * @brief Non-thread-safe event handling specific to FreeRADIUS
+/** Wrapper around libkqueue to make managing events easier
*
- * @note By non-thread-safe we mean multiple threads can't insert/delete events concurrently
- * into the same event list without synchronization.
+ * Non-thread-safe event handling specific to FreeRADIUS.
+ *
+ * By non-thread-safe we mean multiple threads can't insert/delete
+ * events concurrently into the same event list without synchronization.
+ *
+ * @file src/lib/util/event.c
*
* @copyright 2007-2016 The FreeRADIUS server project
* @copyright 2016 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Wrapper around libkqueue to make managing events easier
*
- * @file lib/util/event.h
- * @brief A simple event queue.
+ * @file src/lib/util/event.h
*
* @copyright 2007 The FreeRADIUS server project
* @copyright 2007 Alan DeKok <aland@deployingradius.com>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/fifo.c
- * @brief Non-thread-safe fifo (FIFO) implementation.
+/** Non-thread-safe fifo (FIFO) implementation
+ *
+ * @file src/lib/util/fifo.c
*
* @copyright 2005,2006 The FreeRADIUS server project
* @copyright 2005 Alan DeKok <aland@ox.org>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/filters.c
- * @brief Routines to parse Ascend's filter attributes.
+/** Routines to parse Ascend's filter attributes
+ *
+ * @file src/lib/util/filters.c
*
* @copyright 2003,2006 The FreeRADIUS server project
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/fring.c
- * @brief Implementation of a circular buffer with fixed element size.
+/** Implementation of a circular buffer with fixed element size
*
* This offers similar functionality to ring_buffer.c, but uses a fixed
* element size, and expects all elements to be talloced.
*
+ * @file src/lib/util/fring.c
+ *
* @copyright 2013 The FreeRADIUS server project
* @copyright 2013 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/*
- * $Id$
+/** Simple ring buffer with fixed element sizes
*
- * @file lib/util/fring_buffer.h
- * @brief Simple ring buffer with fixed element sizes.
+ * @file src/lib/util/fring_buffer.h
*
* @copyright 2015-2017 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/getaddrinfo.c
- * @brief Replacement getaddrinfo functions.
+/** Replacement getaddrinfo functions
*
* These functions are defined and used only if the configure
* cannot detect the standard getaddrinfo(), freeaddrinfo(),
* FIXME: getaddrinfo() & getnameinfo() should
* return all IPv4 addresses provided by DNS lookup.
*
+ * @file src/lib/util/getaddrinfo.c
+ *
* @copyright 2016 The FreeRADIUS server project
*/
RCSID("$Id$")
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/hash.c
- * @brief Resizable hash tables.
+/** Resizable hash tables
*
- * The weird "reverse" function is based on an idea from
- * "Split-Ordered Lists - Lock-free Resizable Hash Tables", with
- * modifications so that they're not lock-free. :(
+ * The weird "reverse" function is based on an idea from
+ * "Split-Ordered Lists - Lock-free Resizable Hash Tables", with
+ * modifications so that they're not lock-free. :(
*
- * However, the split-order idea allows a fast & easy splitting of the
- * hash bucket chain when the hash table is resized. Without it, we'd
- * have to check & update the pointers for every node in the buck chain,
- * rather than being able to move 1/2 of the entries in the chain with
- * one update.
+ * However, the split-order idea allows a fast & easy splitting of the
+ * hash bucket chain when the hash table is resized. Without it, we'd
+ * have to check & update the pointers for every node in the buck chain,
+ * rather than being able to move 1/2 of the entries in the chain with
+ * one update.
+ *
+ * @file src/lib/util/hash.c
*
* @copyright 2005,2006 The FreeRADIUS server project
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Structures and prototypes for resizable hash tables
*
- * @file lib/util/hash.h
- * @brief Structures and prototypes for fast hashing.
+ * @file src/lib/util/hash.h
*
* @copyright 2005,2006 The FreeRADIUS server project
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/heap.c
- * @brief Basic heap
+/** Functions for a basic binary heaps
+ *
+ * @file src/lib/util/heap.c
+ *
* @copyright 2005,2006 The FreeRADIUS server project
*/
RCSID("$Id$")
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Structures and prototypes for binary heaps
*
- * @file lib/util/heap.h
- * @brief Structures and prototypes for binary heaps.
+ * @file src/lib/util/heap.h
*
* @copyright 2007 Alan DeKok
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/hmacmd5.c
- * @brief MD5 HMAC not dependent on OpenSSL.
+/** MD5 HMAC not dependent on OpenSSL
+ *
+ * @file src/lib/util/hmacmd5.c
*
* @note New code that needs fast or incremental HMACs should use the OpenSSL EVP_* HMAC
* interface instead, as that can take advantage of acceleration instructions provided
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/hmacsha1.c
- * @brief SHA1 HMAC not dependent on OpenSSL.
+/** SHA1 HMAC not dependent on OpenSSL
*
* @note New code that needs fast or incremental HMACs should use the OpenSSL EVP_* HMAC
* interface instead, as that can take advantage of acceleration instructions provided
* by various CPUs (and provides an incremental hashing interface).
*
- * Adapted from hmacmd5.c (HMAC-MD5).
+ * Adapted from hmacmd5.c (HMAC-MD5). Test cases from RFC2202.
*
- * Test cases from RFC2202.
+ * @file src/lib/util/hmacsha1.c
*
* @author Michael Richardson <mcr@sandelman.ottawa.on.ca>
*
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
- * @file inet.c
- * @brief Functions to parse, print, mask and retrieve IP addresses
+/** Functions for parsing, printing, masking and retrieving IP addresses
+ *
+ * @file src/lib/util/inet.c
*
* @author Arran Cudbard-Bell <a.cudbardb@freeradius.org>
* @copyright 2015 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-/**
- * $Id$
+/** Structures and functions for parsing, printing, masking and retrieving IP addresses
*
- * @file lib/util/inet.h
- * @brief Structures and functions for parsing, printing, masking and retrieving IP addresses.
+ * @file src/lib/util/inet.h
*
* @author Arran Cudbard-Bell <a.cudbardb@freeradius.org>
* @copyright 2015 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
-/**
- * $Id$
- * @file inet.c
- * @brief Bob Jenkin's random number generator
+/** Bob Jenkin's random number generator
*
* Bob's random number generator, ISAAC. Public Domain.
*
* http://burtleburtle.net/bob/rand/isaac.html
*
+ * @file src/lib/util/isaac.c
+ *
* @author Bob Jenkins.
*/
RCSID("$Id$")
#include <freeradius-devel/util/base.h>
#define RANDSIZL (8) /* I recommend 8 for crypto, 4 for simulations */
-#define RANDSIZ (1<<RANDSIZL)
+#define RANDSIZ (1 << RANDSIZL)
-#define ind(mm,x) ((mm)[(x>>2)&(RANDSIZ-1)])
-#define rngstep(mix,a,b,mm,m,m2,r,x) \
+#define ind(mm,x) ((mm)[(x >> 2) &(RANDSIZ-1)])
+#define rngstep(mix, a, b, mm, m, m2, r, x) \
{ \
- x = *m; \
- a = ((a^(mix)) + *(m2++)) & 0xffffffff; \
- *(m++) = y = (ind(mm,x) + a + b) & 0xffffffff; \
- *(r++) = b = (ind(mm,y>>RANDSIZL) + x) & 0xffffffff; \
+ x = *m; \
+ a = ((a^(mix)) + *(m2++)) & 0xffffffff; \
+ *(m++) = y = (ind(mm, x) + a + b) & 0xffffffff; \
+ *(r++) = b = (ind(mm, y >> RANDSIZL) + x) & 0xffffffff; \
}
void fr_isaac(fr_randctx *ctx)
{
- register uint32_t a,b,x,y,*m,*mm,*m2,*r,*mend;
- mm=ctx->randmem; r=ctx->randrsl;
- a = ctx->randa; b = (ctx->randb + (++ctx->randc)) & 0xffffffff;
- for (m = mm, mend = m2 = m+(RANDSIZ/2); m<mend; )
- {
- rngstep( a<<13, a, b, mm, m, m2, r, x);
- rngstep( a>>6 , a, b, mm, m, m2, r, x);
- rngstep( a<<2 , a, b, mm, m, m2, r, x);
- rngstep( a>>16, a, b, mm, m, m2, r, x);
- }
- for (m2 = mm; m2<mend; )
- {
- rngstep( a<<13, a, b, mm, m, m2, r, x);
- rngstep( a>>6 , a, b, mm, m, m2, r, x);
- rngstep( a<<2 , a, b, mm, m, m2, r, x);
- rngstep( a>>16, a, b, mm, m, m2, r, x);
- }
- ctx->randb = b; ctx->randa = a;
+ register uint32_t a, b, x, y, *m, *mm, *m2, *r, *mend;
+
+ mm = ctx->randmem;
+ r = ctx->randrsl;
+ a = ctx->randa;
+ b = (ctx->randb + (++ctx->randc)) & 0xffffffff;
+
+ for (m = mm, mend = m2 = m + (RANDSIZ / 2); m < mend; ) {
+ rngstep(a << 13, a, b, mm, m, m2, r, x);
+ rngstep(a >> 6 , a, b, mm, m, m2, r, x);
+ rngstep(a << 2 , a, b, mm, m, m2, r, x);
+ rngstep(a >> 16, a, b, mm, m, m2, r, x);
+ }
+ for (m2 = mm; m2 < mend; ) {
+ rngstep(a << 13, a, b, mm, m, m2, r, x);
+ rngstep(a >> 6 , a, b, mm, m, m2, r, x);
+ rngstep(a << 2 , a, b, mm, m, m2, r, x);
+ rngstep(a >> 16, a, b, mm, m, m2, r, x);
+ }
+ ctx->randb = b;
+ ctx->randa = a;
}
#define mix(a,b,c,d,e,f,g,h) \
{ \
- a^=b<<11; d+=a; b+=c; \
- b^=c>>2; e+=b; c+=d; \
- c^=d<<8; f+=c; d+=e; \
- d^=e>>16; g+=d; e+=f; \
- e^=f<<10; h+=e; f+=g; \
- f^=g>>4; a+=f; g+=h; \
- g^=h<<8; b+=g; h+=a; \
- h^=a>>9; c+=h; a+=b; \
+ a ^= b << 11; d += a; b += c; \
+ b ^= c >> 2; e += b; c += d; \
+ c ^= d << 8; f += c; d += e; \
+ d ^= e >> 16; g += d; e += f; \
+ e ^= f << 10; h += e; f += g; \
+ f ^= g >> 4; a += f; g += h; \
+ g ^= h << 8; b += g; h += a; \
+ h ^= a >> 9; c += h; a += b; \
}
/* if (flag==1), then use the contents of randrsl[] to initialize mm[]. */
void fr_randinit(fr_randctx *ctx, int flag)
{
- int i;
- uint32_t a,b,c,d,e,f,g,h;
- uint32_t *m,*r;
- ctx->randa = ctx->randb = ctx->randc = 0;
- m=ctx->randmem;
- r=ctx->randrsl;
- a=b=c=d=e=f=g=h=0x9e3779b9; /* the golden ratio */
-
- for (i=0; i<4; ++i) { /* scramble it */
- mix(a,b,c,d,e,f,g,h);
- }
-
- if (flag) {
- /* initialize using the contents of r[] as the seed */
- for (i=0; i<RANDSIZ; i+=8) {
- a+=r[i ]; b+=r[i+1]; c+=r[i+2]; d+=r[i+3];
- e+=r[i+4]; f+=r[i+5]; g+=r[i+6]; h+=r[i+7];
- mix(a,b,c,d,e,f,g,h);
- m[i ]=a; m[i+1]=b; m[i+2]=c; m[i+3]=d;
- m[i+4]=e; m[i+5]=f; m[i+6]=g; m[i+7]=h;
- }
- /* do a second pass to make all of the seed affect all of m */
- for (i=0; i<RANDSIZ; i+=8) {
- a+=m[i ]; b+=m[i+1]; c+=m[i+2]; d+=m[i+3];
- e+=m[i+4]; f+=m[i+5]; g+=m[i+6]; h+=m[i+7];
- mix(a,b,c,d,e,f,g,h);
- m[i ]=a; m[i+1]=b; m[i+2]=c; m[i+3]=d;
- m[i+4]=e; m[i+5]=f; m[i+6]=g; m[i+7]=h;
- }
- } else {
- for (i=0; i<RANDSIZ; i+=8) {
- /* fill in mm[] with messy stuff */
- mix(a,b,c,d,e,f,g,h);
- m[i ]=a; m[i+1]=b; m[i+2]=c; m[i+3]=d;
- m[i+4]=e; m[i+5]=f; m[i+6]=g; m[i+7]=h;
- }
- }
-
- fr_isaac(ctx); /* fill in the first set of results */
- ctx->randcnt=RANDSIZ; /* prepare to use the first set of results */
+ int i;
+ uint32_t a, b, c, d, e, f, g, h;
+ uint32_t *m, *r;
+
+ ctx->randa = ctx->randb = ctx->randc = 0;
+ m = ctx->randmem;
+ r = ctx->randrsl;
+ a = b = c = d = e = f = g = h = 0x9e3779b9; /* the golden ratio */
+
+ /* scramble it */
+ for (i = 0; i < 4; ++i) mix(a, b, c, d, e, f, g, h);
+
+ if (flag) {
+ /* initialize using the contents of r[] as the seed */
+ for (i = 0; i < RANDSIZ; i += 8) {
+ a += r[i ]; b += r[i + 1]; c +=r [i + 2]; d += r[i + 3];
+ e += r[i + 4]; f += r[i + 5]; g +=r [i + 6]; h += r[i + 7];
+ mix(a, b, c, d, e, f, g, h);
+ m[i ] = a; m[i + 1] = b; m[i + 2] = c; m[i + 3] = d;
+ m[i + 4] = e; m[i + 5] = f; m[i + 6] = g; m[i + 7] = h;
+ }
+ /* do a second pass to make all of the seed affect all of m */
+ for (i = 0; i < RANDSIZ; i += 8) {
+ a += m[i ]; b += m[i + 1]; c += m[i + 2]; d += m[i + 3];
+ e += m[i + 4]; f += m[i + 5]; g += m[i + 6]; h += m[i + 7];
+ mix(a, b, c, d, e, f, g, h);
+ m[i ] = a; m[i + 1] = b; m[i + 2] = c; m[i + 3] = d;
+ m[i + 4] = e; m[i + 5] = f; m[i + 6] = g; m[i + 7] = h;
+ }
+ } else {
+ for (i = 0; i < RANDSIZ; i += 8) {
+ /* fill in mm[] with messy stuff */
+ mix(a, b, c, d, e, f, g, h);
+ m[i ] = a; m[i + 1] = b; m[i + 2] = c; m[i + 3] = d;
+ m[i + 4] = e; m[i + 5] = f; m[i + 6] = g; m[i + 7] = h;
+ }
+ }
+
+ fr_isaac(ctx); /* fill in the first set of results */
+ ctx->randcnt = RANDSIZ; /* prepare to use the first set of results */
}
*/
int main()
{
- uint32_t i,j;
- fr_randctx ctx;
-
- ctx.randa = ctx.randb = ctx.randc = (uint32_t)0;
-
- for (i=0; i<256; ++i) ctx.randrsl[i]=(uint32_t)0;
- fr_randinit(&ctx, 1);
- for (i=0; i<2; ++i) {
- fr_isaac(&ctx);
- for (j=0; j<256; ++j) {
- printf("%.8lx",ctx.randrsl[j]);
- if ((j&7)==7) printf("\n");
- }
- }
+ uint32_t i,j;
+ fr_randctx ctx;
+
+ ctx.randa = ctx.randb = ctx.randc = (uint32_t)0;
+
+ for (i = 0; i < 256; ++i) ctx.randrsl[i] = (uint32_t)0;
+
+ fr_randinit(&ctx, 1);
+ for (i = 0; i < 2; ++i) {
+ fr_isaac(&ctx);
+ for (j = 0; j < 256; ++j) {
+ printf("%.8lx",ctx.randrsl[j]);
+ if ((j & 7) == 7) printf("\n");
+ }
+ }
}
#endif
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/log.c
- * @brief Support functions for logging in FreeRADIUS libraries.
+/** Support functions for logging in FreeRADIUS libraries
+ *
+ * @file src/lib/util/log.c
*
* @copyright 2003,2006 The FreeRADIUS server project
*/
#include <freeradius-devel/util/token.h>
-/**
- * $Id$
+/** libfreeradius logging functions
*
- * @file lib/util/log.h
- * @brief libfreeradius logging functions
+ * @file src/lib/util/log.h
*
* @copyright 2016 The FreeRADIUS server project
*/
-
extern FILE *fr_log_fp;
/*
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Integration with the leak sanitizer interface
*
- * @file lib/util/lsan.h
- * @brief Integration with the leak sanitizer interface
+ * @file src/lib/util/lsan.h
*
* @copyright 2018 The FreeRADIUS server project
*/
-/**
- * $Id$
+/** A local MD4 implementation
*
* @note license is LGPL, but largely derived from a public domain source.
*
- * @file md4.c
- * @brief md4 digest functions.
+ * @file src/lib/util/md4.c
*/
RCSID("$Id$")
#pragma once
-/**
- * $Id$
+/** Structures and prototypes for our local MD4 implementation
*
* @note license is LGPL, but largely derived from a public domain source.
*
- * @file lib/util/md4.h
+ * @file src/lib/util/md4.h
* @brief Structures and prototypes for md4.
*/
RCSIDH(md4_h, "$Id$")
-/**
- * $Id$
+/** A local MD5 implementation
*
* @note license is LGPL, but largely derived from a public domain source.
*
- * @file md5.c
- * @brief md5 digest functions.
+ * @file src/lib/util/md5.c
*/
-
RCSID("$Id$")
#include <freeradius-devel/util/base.h>
#pragma once
-/**
- * $Id$
+/** Structures and prototypes for our local MD5 implementation
*
* @note license is LGPL, but largely derived from a public domain source.
*
- * @file lib/util/md5.h
- * @brief Structures and prototypes for md5.
+ * @file src/lib/util/md5.h
*/
RCSIDH(md5_h, "$Id$")
/*
- * mem.c RADIUS_PACKET alloc/free
- *
- * Version: $Id$
- *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/** RADIUS_PACKET alloc/free functions
+ *
+ * @file src/lib/util/mem.c
*
* @copyright 2000,2006 The FreeRADIUS server project
*/
-
RCSID("$Id$")
#include <freeradius-devel/util/base.h>
/*
- * misc.c Various miscellaneous functions.
- *
- * Version: $Id$
- *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/** Various miscellaneous utility functions
+ *
+ * @file src/lib/util/misc.c
*
* @copyright 2000,2006 The FreeRADIUS server project
*/
-
RCSID("$Id$")
#include <freeradius-devel/util/base.h>
/*
- * missing.c Replacements for functions that are or can be
- * missing on some platforms.
- *
- * Version: $Id$
- *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/** Replacements for functions that are or can be missing on some platforms
+ *
+ * @file src/lib/util/missing.c
*
* @copyright 2000,2006 The FreeRADIUS server project
*/
-
RCSID("$Id$")
#include <freeradius-devel/util/base.h>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
- * @file net.c
- * @brief Functions to parse raw packets.
+/** Functions for parsing raw network packets
+ *
+ * @file src/lib/util/net.c
*
* @author Arran Cudbard-Bell <a.cudbardb@freeradius.org>
* @copyright 2014-2015 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Structures and functions for parsing raw network packets
*
- * @file lib/util/net.h
- * @brief Structures and functions for parsing raw network packets.
+ * @file src/lib/util/net.h
*
* @author Arran Cudbard-Bell <a.cudbardb@freeradius.org>
* @copyright 2014 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Structures and functions for packet manipulation
*
- * @file lib/util/packet.h
- * @brief Structures and functions for packet manipulation
+ * @file src/lib/util/packet.h
*
* @copyright 2001, 2002, 2003, 2004, 2005, 2006 The FreeRADIUS server project
*/
/*
- * pair.c Functions to handle VALUE_PAIRs
- *
- * Version: $Id$
- *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- *
- * @copyright 2000,2006 The FreeRADIUS server project
*/
+/** AVP manipulation and search API
+ *
+ * @file src/lib/util/pair.c
+ *
+ * @copyright 2000,2006,2015 The FreeRADIUS server project
+ */
RCSID("$Id$")
#include <freeradius-devel/util/base.h>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** AVP manipulation and search API
*
- * @file lib/util/pair.h
- * @brief AVP manipulation and search API.
+ * @file src/lib/util/pair.h
*
* @copyright 2015 The FreeRADIUS server project
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
- *
- * @file lib/util/cursor.c
- * @brief Functions to iterate over collections of VALUE_PAIRs
+/** Functions to iterate over collections of VALUE_PAIRs
*
* @note Do not modify collections of VALUE_PAIRs pointed to by a cursor
* with none fr_pair_cursor_* functions, during the lifetime of that cursor.
*
+ * @file src/lib/util/pair_cursor.c
+ *
* @author Arran Cudbard-Bell <a.cudbardb@freeradius.org>
* @copyright 2013-2015 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
* @copyright 2013-2015 The FreeRADIUS Server Project.
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Functions to iterate over collections of VALUE_PAIRs
*
- * @file lib/util/cursor.h
- * @brief Generic linked list cursor.
+ * @file src/lib/util/pair_cursor.h
*
* @copyright 2016 The FreeRADIUS server project
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
- * @file lib/util/pcap.c
- * @brief Wrappers around libpcap functions
+/** Wrappers around libpcap functions
+ *
+ * @file src/lib/util/pcap.c
*
* @author Arran Cudbard-Bell <a.cudbardb@freeradius.org>
* @copyright 2013 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifdef HAVE_LIBPCAP
-/**
- * $Id$
+/** Prototypes and constants for PCAP functions
*
- * @file lib/util/pcap.h
- * @brief Prototypes and constants for PCAP functions.
+ * @file src/lib/util/pcap.h
*
* @author Arran Cudbard-Bell <a.cudbardb@freeradius.org>
* @copyright 2013 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
/*
- * print.c Routines to print stuff.
- *
- * Version: $Id$
- *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/** Functions to produce and parse the FreeRADIUS presentation format
+ *
+ * @file src/lib/util/print.c
*
* @copyright 2000,2006 The FreeRADIUS server project
*/
-
RCSID("$Id$")
#include <freeradius-devel/util/base.h>
-
#include <ctype.h>
/** Checks for utf-8, taken from http://www.w3.org/International/questions/qa-forms-utf-8
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Protocol encoder/decoder support functions
*
- * @file proto.c
- * @brief functions common to protocol encoders/decoders.
+ * @file src/lib/util/proto.c
*
* @copyright 2015 The FreeRADIUS server project
*/
#pragma once
/*
- * 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 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.
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Protocol encoder/decoder support functions
*
- * @file lib/util/proto.h
- * @brief Protocol encoder/decoder support functions
+ * @file src/lib/util/proto.h
*
* @copyright 2015 The FreeRADIUS server project
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Functions to get randomness
*
- * @file rand.c
- * @brief Functions to get randomness
+ * @file src/lib/util/rand.c
*
- * @copyright 1999-2017 The FreeRADIUS server project
+ * @copyright 1999-2017 The FreeRADIUS server project
*/
-
RCSID("$Id$")
#include <freeradius-devel/util/base.h>
static _Thread_local fr_randctx fr_rand_pool; //!< A pool of pre-generated random integers
static _Thread_local bool fr_rand_initialized = false;
-
/** Seed the random number generator
*
* May be called any number of times.
/*
- * rbtree.c RED-BLACK balanced binary trees.
- *
- * Version: $Id$
- *
* 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.1 of the License, or
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- *
- * @copyright 2004,2006 The FreeRADIUS server project
*/
+/** Red/black tree implementation
+ *
+ * @file src/lib/util/rbtree.c
+ *
+ * @copyright 2004,2006 The FreeRADIUS server project
+ */
RCSID("$Id$")
#include <freeradius-devel/util/rbtree.h>
#pragma once
/*
- * 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 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.
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Red/black tree implementation
*
- * @file lib/util/rbtree.h
- * @brief Red/black tree implementation
+ * @file src/lib/util/rbtree.h
*
* @copyright 2016 The FreeRADIUS server project
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/regex.c
- * @brief regex abstraction functions
+/** Wrappers around various regular expression libraries
+ *
+ * @file src/lib/util/regex.c
*
* @copyright 2014 The FreeRADIUS server project
* @copyright 2014 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
*/
+RCSID("$Id$")
#ifdef HAVE_REGEX
#include <freeradius-devel/util/base.h>
#pragma once
/*
- * 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 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.
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifdef HAVE_REGEX
-/**
- * $Id$
+/** Wrappers around various regular expression libraries
*
- * @file lib/util/regex.h
- * @brief Wrappers around various regular expression libraries.
+ * @file src/lib/util/regex.h
*
* @copyright 2014 The FreeRADIUS server project
*/
-/*
- * SHA-1 in C
- * By Steve Reid <steve@edmweb.com>
- * 100% Public Domain
+/** Local implementation of the SHA1 hashing scheme
*
- * Version: $Id$
+ * SHA-1 in C 100% Public Domain
+ *
+ * @file src/lib/util/sha1.c
+ *
+ * @author Steve Reid <steve@edmweb.com>
*/
-
RCSID("$Id$")
#include <freeradius-devel/util/base.h>
#pragma once
-/**
- * $Id$
+/** Local implementation of the SHA1 hashing scheme
*
- * @file lib/util/sha1.h
- * @brief Local implementation of the SHA1 hashing scheme.
+ * SHA-1 in C 100% Public Domain
+ *
+ * @file src/lib/util/sha1.h
+ *
+ * @author Steve Reid <steve@edmweb.com>
*/
#ifdef WITH_OPENSSL_SHA1
# include <openssl/sha.h>
-
/*
- Unix snprintf implementation.
- Version 1.4
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Library 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 Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- Revision History:
-
- 1.4:
- * integrate in FreeRADIUS's libradius:
- * Fetched from: http://savannah.gnu.org/cgi-bin/viewcvs/mailutils/mailutils/lib/snprintf.c?rev=1.4
- * Fetched from: http://savannah.gnu.org/cgi-bin/viewcvs/mailutils/mailutils/lib/snprintf.h?rev=1.4
- * Replace config.h with autoconf.h
- * Protect with HAVE_SNPRINTF and HAVE_VSNPRINTF
- 1.3:
- * add #include <config.h> ifdef HAVE_CONFIG_H
- * cosmetic change, when exponent is 0 print xxxE+00
- instead of xxxE-00
- 1.2:
- * put the program under LGPL.
- 1.1:
- * added changes from Miles Bader
- * corrected a bug with %f
- * added support for %#g
- * added more comments :-)
- 1.0:
- * supporting must ANSI syntaxic_sugars
- 0.0:
- * suppot %s %c %d
-
- THANKS(for the patches and ideas):
- Miles Bader
- Cyrille Rustom
- Jacek Slabocewiz
- Mike Parker(mouse)
+ * This program is 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
-*/
+/** Unix snprintf implementation
+ *
+ * Version 1.4
+ *
+ * 1.4:
+ * * integrate in FreeRADIUS's libradius:
+ * * Fetched from: http://savannah.gnu.org/cgi-bin/viewcvs/mailutils/mailutils/lib/snprintf.c?rev=1.4
+ * * Fetched from: http://savannah.gnu.org/cgi-bin/viewcvs/mailutils/mailutils/lib/snprintf.h?rev=1.4
+ * * Replace config.h with autoconf.h
+ * * Protect with HAVE_SNPRINTF and HAVE_VSNPRINTF
+ * 1.3:
+ * * add #include <config.h> ifdef HAVE_CONFIG_H
+ * * cosmetic change, when exponent is 0 print xxxE+00
+ * instead of xxxE-00
+ * 1.2:
+ * * put the program under LGPL.
+ *
+ * 1.1:
+ * * added changes from Miles Bader
+ * * corrected a bug with %f
+ * * added support for %#g
+ * * added more comments :-)
+ * 1.0:
+ * * supporting must ANSI syntaxic_sugars
+ * 0.0:
+ * * suppot %s %c %d
+ *
+ * THANKS(for the patches and ideas):
+ * Miles Bader
+ * Cyrille Rustom
+ * Jacek Slabocewiz
+ * Mike Parker(mouse)
+ *
+ * @file src/lib/util/snprintf.h
+ *
+ * @copyright Alain Magloire: alainm@rcsm.ee.mcgill.ca
+ */
RCSID("$Id$")
/*
- Unix snprintf implementation.
- Version 1.4
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Library 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 Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- Revision History:
- see header of snprintf.c.
-
-format:
- int snprintf(holder, sizeof_holder, format, ...)
-
-Return values:
- (sizeof_holder - 1)
-
-
- THANKS(for the patches and ideas):
- Miles Bader
- Cyrille Rustom
- Jacek Slabocewiz
- Mike Parker(mouse)
-
-Alain Magloire: alainm@rcsm.ee.mcgill.ca
-*/
+ * This program is 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+/** Unix snprintf implementation
+ *
+ * Version 1.4
+ *
+ * THANKS(for the patches and ideas):
+ * Miles Bader
+ * Cyrille Rustom
+ * Jacek Slabocewiz
+ * Mike Parker(mouse)
+ *
+ * @file src/lib/util/snprintf.h
+ *
+ * @copyright Alain Magloire: alainm@rcsm.ee.mcgill.ca
+ */
#ifndef HAVE_VSNPRINTF
RCSIDH(snprintf_h, "$Id$")
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
- * @file socket.c
- * @brief Functions for establishing and managing low level sockets.
+/** Functions for establishing and managing low level sockets
+ *
+ * @file src/lib/util/socket.c
*
* @author Arran Cudbard-Bell <a.cudbardb@freeradius.org>
* @author Alan DeKok <aland@freeradius.org>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/strerror.c
- * @brief Support functions to allow libraries to provide errors to their callers.
+/** Support functions to allow libraries to provide errors to their callers
+ *
+ * @file src/lib/util/strerror.c
*
* @copyright 2017 The FreeRADIUS server project
* @copyright 2017 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
/*
- * strlcat.c Concatenate strings.
- *
- * Version: $Id$
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
*
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/*
- * @copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+/** Implementation of the strlcat function
*
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
+ * @file src/lib/util/strlcat.c
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * @copyright 2006 The FreeRADIUS server project
+ * @copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
*/
-
RCSID("$Id$")
#ifndef HAVE_STRLCAT
/*
- * strlcpy.c Copy strings.
- *
- * Version: $Id$
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
*
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/*
- * @copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+/** Local implementation of the strlcpy function
*
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
+ * @file src/lib/util/strlcpy.c
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * @copyright 2006 The FreeRADIUS server project
+ * @copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
*/
-
RCSID("$Id$")
#ifndef HAVE_STRLCPY
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/syserror.c
- * @brief Support functions to allow libraries to get system errors in a threadsafe
- * and easily debuggable way.
+/** Support functions to allow libraries to get system errors in a threadsafe and easily debuggable way
+ *
+ * @file src/lib/util/syserror.c
*
* @copyright 2017 The FreeRADIUS server project
* @copyright 2017 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * @file lib/util/talloc.c
- * @brief Functions which we wish were included in the standard talloc distribution.
+/** Functions which we wish were included in the standard talloc distribution
+ *
+ * @file src/lib/util/talloc.c
*
* @copyright 2017 The FreeRADIUS server project
* @copyright 2017 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
*/
-
RCSID("$Id$")
#include <freeradius-devel/util/talloc.h>
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+
+/** Functions which we wish were included in the standard talloc distribution
+ *
+ * @file src/lib/util/talloc.h
+ *
+ * @copyright 2017 The FreeRADIUS server project
+ * @copyright 2017 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
+ */
#include <talloc.h>
#include <stdbool.h>
#include <stdint.h>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Macros to abstract Thread Local Storage
+ *
+ * Simplifies creating destructors, called when the thread exits
*
* @file lib/util/threads.h
- * @brief Macros to abstract Thread Local Storage
*
* @copyright 2013-2016 The FreeRADIUS server project
*/
/*
- * token.c Read the next token from a string.
- * Yes it's pretty primitive but effective.
- *
- * Version: $Id$
- *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- *
- * @copyright 2000,2006 The FreeRADIUS server project
*/
+/** Tokenisation code and constants
+ *
+ * This is mostly for the attribute filter and user files.
+ *
+ * @file src/lib/util/token.c
+ *
+ * @copyright 2001,2006 The FreeRADIUS server project
+ */
RCSID("$Id$")
#include <freeradius-devel/util/base.h>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Tokenisation code and constants
*
- * @file lib/util/token.h
- * @brief Tokenisation code and constants.
+ * This is mostly for the attribute filter and user files.
+ *
+ * @file src/lib/util/token.h
*
* @copyright 2001,2006 The FreeRADIUS server project
*/
/*
- * trie.c Path-compressed tries
- *
- * Version: $Id$
- *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/** Path-compressed prefix tries
+ *
+ * @file src/lib/util/trie.c
*
* @copyright 2017 Alan DeKok <aland@freeradius.org>
*/
-
RCSID("$Id$")
-
#include <freeradius-devel/util/trie.h>
#include <freeradius-devel/util/dict.h>
#include <freeradius-devel/util/talloc.h>
-#ifdef TESTING
#include <freeradius-devel/server/rad_assert.h>
-#else
-#define rad_assert(_x)
-#endif
+
#include <string.h>
#include <ctype.h>
#include <errno.h>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Path-compressed prefix tries
*
- * @file lib/util/trie.h
- * @brief Prefix trie.
+ * @file src/lib/util/trie.h
*
* @copyright 2017 Alan DeKok <aland@freeradius.org>
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Types of values contained within an #fr_value_box_t
*
- * @file lib/util/types.h
- * @brief #fr_value_box_t types
+ * These are in a separate header file to avoid circular dependencies.
+ *
+ * @file src/lib/util/types.h
*
* @copyright 2017 The FreeRADIUS server project
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Utility functions for managing UDP sockets
*
- * @file util/udp.c
- * @brief Functions to send/receive UDP packets.
+ * @file src/lib/util/udp.c
*
* @copyright 2000-2003,2006 The FreeRADIUS server project
*/
-
RCSID("$Id$")
#include <freeradius-devel/util/udp.h>
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Utility functions for managing UDP sockets
*
- * @file lib/util/udp.h
- * @brief Abstraction API for sending and receiving packets on UDP sockets.
+ * @file src/lib/util/udp.h
*
* @copyright 2015 The FreeRADIUS server project
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
- * @file udpfromto.c
- * @brief Like recvfrom, but also stores the destination IP address. Useful on multihomed hosts.
+/** API for sending and receiving packets on unconnected UDP sockets
+ *
+ * Like recvfrom, but also stores the destination IP address. Useful on multihomed hosts.
+ *
+ * @file src/lib/util/udpfromto.c
*
* @copyright 2007 Alan DeKok <aland@deployingradius.com>
* @copyright 2002 Miquel van Smoorenburg
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** API for sending and receiving packets on unconnected UDP sockets
*
- * @file lib/util/udpfromto.h
- * @brief Abstract API for sending and receiving packets on unconnected UDP sockets.
+ * Like recvfrom, but also stores the destination IP address. Useful on multihomed hosts.
+ *
+ * @file src/lib/util/udpfromto.h
*
* @copyright 2015 The FreeRADIUS server project
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
- * @file value.c
- * @brief Manipulate boxed values representing all internal data types.
+/** Boxed value structures and functions to manipulate them
+ *
+ * @file src/lib/util/value.c
*
* There are three notional data formats used in the server:
*
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Boxed value structures and functions to manipulate them
*
- * @file lib/util/value.h
- * @brief Boxed values and functions to manipulate them.
+ * @file src/lib/util/value.h
*
* @copyright 2015-2018 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
*/
/*
- * version.c Validate application and library magic numbers.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * Version: $Id$
- *
- * 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,
+ * This library 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.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser 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
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- *
- * @copyright 1999-2014 The FreeRADIUS server project
*/
+/** Validate application and library magic numbers
+ *
+ * @file src/lib/util/version.c
+ *
+ * @copyright 2016 The FreeRADIUS server project
+ * @copyright 2016 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
+ */
RCSID("$Id$")
#include <freeradius-devel/util/base.h>
#pragma once
/*
- * 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 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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.
+ * This library 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
+ * Lesser 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/**
- * $Id$
+/** Version checking functions
*
- * @file lib/util/version.h
- * @brief Version checking functions
+ * @file src/lib/util/version.h
*
* @copyright 2016 The FreeRADIUS server project
+ * @copyright 2016 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
*/
RCSIDH(version_h, "$Id$")