#include "squid.h"
#include "helper/protocol_defines.h"
#include "rfc1738.h"
#include "util.h"
#include <cstdlib>
#include <cstring>
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_dict * | load_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()
Definition at line 219 of file ext_file_userip_acl.cc.
References ip_user_dict::address, debug(), debug_enabled, dict_lookup(), getopt(), HELPER_INPUT_BUFFER, HLP_MSG, load_dict(), optarg, program_name, rfc1738_unescape(), SEND_BH, SEND_ERR, SEND_OK, usage(), ip_user_dict::username, and xstrerr().
◆ 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 |
Definition at line 212 of file ext_file_userip_acl.cc.
References program_name.
Referenced by main().