|
Squid Web Cache master
|
#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 | free_dict (struct ip_user_dict *head) |
| static void | usage (const char *program_name) |
| int | main (int argc, char *argv[]) |
| #define DICT_BUFFER_SIZE 8196 |
Size of lines read from the dictionary file
Definition at line 62 of file ext_file_userip_acl.cc.
| 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 156 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().
|
static |
| 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 82 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 xcalloc().
Referenced by main().
Definition at line 228 of file ext_file_userip_acl.cc.
References ip_user_dict::address, debug(), debug_enabled, dict_lookup(), free_dict(), 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().
| int match_group | ( | char * | dict_group, |
| char * | username | ||
| ) |
Definition at line 200 of file ext_file_userip_acl.cc.
References debug().
Referenced by dict_lookup().
| int match_user | ( | char * | dict_username, |
| char * | username | ||
| ) |
Definition at line 187 of file ext_file_userip_acl.cc.
References ip_user_dict::username.
Referenced by dict_lookup().
|
static |
Definition at line 221 of file ext_file_userip_acl.cc.
References program_name.