ext_file_userip_acl.cc File Reference
#include "squid.h"
#include "helper/protocol_defines.h"
#include "rfc1738.h"
#include "util.h"
#include <cstdlib>
#include <cstring>
Include dependency graph for ext_file_userip_acl.cc:

Go to the source code of this file.

Classes

struct  ip_user_dict
 

Macros

#define DICT_BUFFER_SIZE   8196
 

Functions

int match_user (char *, char *)
 
int match_group (char *, char *)
 
struct ip_user_dictload_dict (FILE *)
 
int dict_lookup (struct ip_user_dict *, char *, char *)
 
static void usage (const char *program_name)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ DICT_BUFFER_SIZE

#define DICT_BUFFER_SIZE   8196

Size of lines read from the dictionary file

Definition at line 62 of file ext_file_userip_acl.cc.

Function Documentation

◆ dict_lookup()

int dict_lookup ( struct ip_user_dict first_entry,
char *  username,
char *  address 
)

This function looks for a matching ip/mask in the dict file loaded in memory. It returns 1 if it finds a match or 0 if no match is found

Definition at line 146 of file ext_file_userip_acl.cc.

References ip_user_dict::address, debug(), match_group(), match_user(), ip_user_dict::netmask, ip_user_dict::next_entry, and ip_user_dict::username.

Referenced by main().

◆ load_dict()

struct ip_user_dict * load_dict ( FILE *  FH)

This function parses the dictionary file and loads it in memory. All IP addresses are processed with a bitwise AND with their netmasks before they are stored. If there?s no netmask (no /) in the in the lhs , a mask 255.255.255.255 is assumed. It returns a pointer to the first entry of the linked list

Definition at line 72 of file ext_file_userip_acl.cc.

References ip_user_dict::address, debug(), DICT_BUFFER_SIZE, ip_user_dict::netmask, ip_user_dict::next_entry, ip_user_dict::username, and xmalloc.

Referenced by main().

◆ main()

◆ match_group()

int match_group ( char *  dict_group,
char *  username 
)

Definition at line 190 of file ext_file_userip_acl.cc.

References debug().

Referenced by dict_lookup().

◆ match_user()

int match_user ( char *  dict_username,
char *  username 
)

Definition at line 177 of file ext_file_userip_acl.cc.

References ip_user_dict::username.

Referenced by dict_lookup().

◆ usage()

static void usage ( const char *  program_name)
static

Definition at line 212 of file ext_file_userip_acl.cc.

References program_name.

Referenced by main().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors