summaryrefslogtreecommitdiff
path: root/src/pam_radius_auth.h
diff options
context:
space:
mode:
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>2014-03-06 12:43:20 +0000
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>2014-03-06 12:49:29 +0000
commit8efddb4f681a203f16b86e29bc08f2456b101131 (patch)
treee0113fb3da9fac3be6f2697ba2b3c708de6ecd91 /src/pam_radius_auth.h
parent38de67dd89f7684c7875fb62dd764c0ae21d3cb5 (diff)
downloadlibpam-radius-auth-8efddb4f681a203f16b86e29bc08f2456b101131.tar.gz
libpam-radius-auth-8efddb4f681a203f16b86e29bc08f2456b101131.zip
Add basic autoconf script
Diffstat (limited to 'src/pam_radius_auth.h')
-rw-r--r--src/pam_radius_auth.h126
1 files changed, 126 insertions, 0 deletions
diff --git a/src/pam_radius_auth.h b/src/pam_radius_auth.h
new file mode 100644
index 0000000..7241117
--- /dev/null
+++ b/src/pam_radius_auth.h
@@ -0,0 +1,126 @@
+#ifndef PAM_RADIUS_H
+#define PAM_RADIUS_H
+
+#include "config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/resource.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <syslog.h>
+#include <stdarg.h>
+#include <utmp.h>
+#include <time.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <fcntl.h>
+
+#if defined(HAVE_SECURITY_PAM_APPL_H)
+# include <security/pam_appl.h>
+#elif defined(HAVE_PAM_PAM_APPL_H)
+# include <pam/pam_appl.h>
+#endif
+
+#if defined(HAVE_SECURITY_PAM_MODULES_H)
+# include <security/pam_modules.h>
+#elif defined(HAVE_PAM_PAM_APPL_H)
+# include <pam/pam_modules.h>
+#else
+# error security/pam_modules.h or pam/pam_modules.h required
+#endif
+
+
+#include "radius.h"
+#include "md5.h"
+
+
+/*************************************************************************
+ * Additional RADIUS definitions
+ *************************************************************************/
+
+/* Per-attribute structure */
+typedef struct attribute_t {
+ unsigned char attribute;
+ unsigned char length;
+ unsigned char data[1];
+} attribute_t;
+
+typedef struct radius_server_t {
+ struct radius_server_t *next;
+ struct in_addr ip;
+ uint16_t port;
+ char *hostname;
+ char *secret;
+ int timeout;
+ int accounting;
+} radius_server_t;
+
+typedef struct radius_conf_t {
+ radius_server_t *server;
+ int retries;
+ int localifdown;
+ char *client_id;
+ int accounting_bug;
+ int sockfd;
+ int debug;
+} radius_conf_t;
+
+
+/*************************************************************************
+ * Platform specific defines
+ *************************************************************************/
+
+#ifdef sun
+#define PAM_EXTERN extern
+/*
+ * On older versions of Solaris, you may have to change this to:
+ * #define CONST
+ */
+#define CONST const
+#else
+#define CONST const
+#endif
+
+/*************************************************************************
+ * Useful macros and defines
+ *************************************************************************/
+
+#define _pam_forget(X) if (X) {memset(X, 0, strlen(X));free(X);X = NULL;}
+#ifndef _pam_drop
+#define _pam_drop(X) if (X) {free(X);X = NULL;}
+#endif
+
+#define PAM_DEBUG_ARG 1
+#define PAM_SKIP_PASSWD 2
+#define PAM_USE_FIRST_PASS 4
+#define PAM_TRY_FIRST_PASS 8
+#define PAM_RUSER_ARG 16
+
+
+/* Module defines */
+#ifndef BUFFER_SIZE
+#define BUFFER_SIZE 1024
+#endif /* BUFFER_SIZE */
+#define MAXPWNAM 253 /* maximum user name length. Server dependent,
+ * this is the default value
+ */
+#define MAXPASS 128 /* max password length. Again, depends on server
+ * compiled in. This is the default.
+ */
+#ifndef CONF_FILE /* the configuration file holding the server secret */
+#define CONF_FILE "/etc/raddb/server"
+#endif /* CONF_FILE */
+
+#ifndef FALSE
+#define FALSE 0
+#undef TRUE
+#define TRUE !FALSE
+#endif
+
+#endif /* PAM_RADIUS_H */