basic_radius_auth.cc File Reference
#include "squid.h"
#include "auth/basic/RADIUS/radius-util.h"
#include "auth/basic/RADIUS/radius.h"
#include "helper/protocol_defines.h"
#include "md5.h"
#include <cctype>
#include <cerrno>
#include <cstring>
#include <ctime>
#include <random>
Include dependency graph for basic_radius_auth.cc:

Go to the source code of this file.

Macros

#define MAXPWNAM   254
 
#define MAXPASS   254
 
#define MAXLINE   254
 

Functions

static void md5_calc (uint8_t out[16], void *in, size_t len)
 
static int timeval_diff (const struct timeval *a, const struct timeval *b)
 
static int time_since (const struct timeval *when)
 
static int result_recv (char *buffer, int length)
 
static void random_vector (char *aVector)
 
static int rad_auth_config (const char *cfname)
 
static void urldecode (char *dst, const char *src, int size)
 
static void authenticate (int socket_fd, const char *username, const char *passwd)
 
int main (int argc, char **argv)
 

Variables

static int i_send_buffer [2048]
 
static int i_recv_buffer [2048]
 
static char * send_buffer = (char *) i_send_buffer
 
static char * recv_buffer = (char *) i_recv_buffer
 
static int sockfd
 
static u_char request_id
 
static char vector [AUTH_VECTOR_LEN]
 
static char secretkey [MAXPASS+1] = ""
 
static char server [MAXLINE] = ""
 
static char identifier [MAXLINE] = ""
 
static char svc_name [MAXLINE] = "radius"
 
static int nasport = 111
 
static int nasporttype = 0
 
static uint32_t nas_ipaddr
 
static uint32_t auth_ipaddr
 
static int retries = 10
 
char progname [] = "basic_radius_auth"
 

Macro Definition Documentation

#define MAXLINE   254

Definition at line 98 of file basic_radius_auth.cc.

Referenced by rad_auth_config().

#define MAXPASS   254

Definition at line 97 of file basic_radius_auth.cc.

Referenced by authenticate(), and main().

#define MAXPWNAM   254

Definition at line 96 of file basic_radius_auth.cc.

Referenced by authenticate(), and main().

Function Documentation

static void md5_calc ( uint8_t  out[16],
void *  in,
size_t  len 
)
static

Definition at line 154 of file basic_radius_auth.cc.

References SquidMD5Final(), SquidMD5Init(), and SquidMD5Update().

Referenced by authenticate(), and result_recv().

static int rad_auth_config ( const char *  cfname)
static

Definition at line 224 of file basic_radius_auth.cc.

References identifier, MAXLINE, NULL, retries, secretkey, server, and svc_name.

Referenced by main().

static void random_vector ( char *  aVector)
static

Definition at line 207 of file basic_radius_auth.cc.

References AUTH_VECTOR_LEN, and i.

Referenced by authenticate().

static int result_recv ( char *  buffer,
int  length 
)
static
static int time_since ( const struct timeval *  when)
static

Definition at line 143 of file basic_radius_auth.cc.

References NULL, and timeval_diff().

Referenced by authenticate().

static int timeval_diff ( const struct timeval *  a,
const struct timeval *  b 
)
static

Definition at line 134 of file basic_radius_auth.cc.

Referenced by time_since().

static void urldecode ( char *  dst,
const char *  src,
int  size 
)
static

Definition at line 255 of file basic_radius_auth.cc.

References NULL, and size.

Referenced by main().

Variable Documentation

uint32_t auth_ipaddr
static

Definition at line 116 of file basic_radius_auth.cc.

Referenced by main().

int i_recv_buffer[2048]
static

Definition at line 103 of file basic_radius_auth.cc.

Referenced by authenticate().

int i_send_buffer[2048]
static

Definition at line 102 of file basic_radius_auth.cc.

char identifier[MAXLINE] = ""
static

Definition at line 111 of file basic_radius_auth.cc.

Referenced by authenticate(), main(), rad_auth_config(), and time_Inst().

uint32_t nas_ipaddr
static

Definition at line 115 of file basic_radius_auth.cc.

Referenced by authenticate(), and main().

int nasport = 111
static

Definition at line 113 of file basic_radius_auth.cc.

Referenced by authenticate().

int nasporttype = 0
static

Definition at line 114 of file basic_radius_auth.cc.

Referenced by authenticate().

char progname[] = "basic_radius_auth"
char* recv_buffer = (char *) i_recv_buffer
static

Definition at line 105 of file basic_radius_auth.cc.

Referenced by authenticate().

u_char request_id
static

Definition at line 107 of file basic_radius_auth.cc.

Referenced by authenticate(), and result_recv().

char secretkey[MAXPASS+1] = ""
static

Definition at line 109 of file basic_radius_auth.cc.

Referenced by authenticate(), main(), rad_auth_config(), and result_recv().

char* send_buffer = (char *) i_send_buffer
static

Definition at line 104 of file basic_radius_auth.cc.

Referenced by authenticate().

int sockfd
static

Definition at line 106 of file basic_radius_auth.cc.

Referenced by action(), connectTo(), main(), and serverSocket().

char svc_name[MAXLINE] = "radius"
static

Definition at line 112 of file basic_radius_auth.cc.

Referenced by main(), and rad_auth_config().

char vector[AUTH_VECTOR_LEN]
static

Definition at line 108 of file basic_radius_auth.cc.

Referenced by authenticate(), Rock::SwapDir::getOptionTree(), and result_recv().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors