File wk/which_keytypes.c

  $Revision: 1.29 $

which_keytypes: Determine which keys to look for.
This is based on the existing Perl code.
Authors: ottrey, marek

Included Files


Preprocessor definitions

#define WK_IMPL

#define DOMAINNAME "^[ ]*[a-zA-Z0-9/-]*(\\.[a-zA-Z0-9-]+)*[ ]*$"

#define DOMAINALPHA "[a-zA-Z]"

#define VALIDIP6PREFIX "^[0-9A-F:]*:[0-9A-F:/]*$"

#define ASNUM "^AS[1-9][0-9]{0,9}$"

#define ASRANGE "^AS[1-9][0-9]{0,9}[ ]*([-][ ]*AS[1-9][0-9]{0,9}){0,1}$"

#define NETNAME "^[A-Z][A-Z0-9_-]*$"

#define MAINTAINER "^[A-Z][A-Z0-9_-]*$"

#define LIMERICK "^LIM-[A-Z0-9_-]+$"

#define KEYCERT "^PGPKEY-[0-9A-F]{8}$"

#define ROUTESETNAME "(^|:)RS-[A-Z0-9_-]*[A-Z0-9](:|$)"

#define ASSETNAME "(^|:)AS-[A-Z0-9_-]*[A-Z0-9](:|$)"

#define AUTONICPREFIXREGULAR "^AUTO-"

#define IPRANGE "^[0-9]{1,3}(\\.[0-9]{1,3}){0,3}[ ]*-[ ]*[0-9]{1,3}(\\.[0-9]{1,3}){0,3}$"

#define IPADDRESS "^[0-9.]+$"

#define IPPREFIX "^[0-9.]+/[0-9]+$"

#define PEERINGSET "(^|:)PRNG-[A-Z0-9_-]*[A-Z0-9](:|$)"

#define FILTERSET "(^|:)FLTR-[A-Z0-9_-]*[A-Z0-9](:|$)"

#define RTRSET "(^|:)RTRS-[A-Z0-9_-]*[A-Z0-9](:|$)"

#define IRT "^IRT-[A-Z0-9_-]+[A-Z0-9]$"

#define NICHANDLE "^[A-Z0-9-]+$"

#define NAME_B "^[a-zA-Z][a-zA-Z_0-9.'|`;:,?/}{()+*#&-]*$"

#define EMAIL "@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*$"

#define WK_REGEX_LIST_LEN


Global Variable Lock

pthread_mutex_t Lock
Included from /home/shane/release/RIP/include/ca_defs.h
Visible in:  aa/aa.c
   ac/ac_persistence.c
   ac/access_control.c
   au/AU_util.c
   ca/ca_configFns.c
   ca/ca_initFn.c
   ca/ca_sanityCheck.c
   ca/ca_sourceLoader.c
   ca/ca_values.c
   co/constants.c
   df/defs.c
   er/er.c
   er/er_arrays.c
   er/er_macro.c
   er/er_paths.c
   er/er_print.c
   ip/ip.c
   ma/bitmask.c
   mm/mm.c
   nh/nh.c
   pa/gpg.c
   pa/spawn.c
   pc/pc_commands.c
   pc/protocol_config.c
   pm/pm_serials.c
   pm/protocol_mirror.c
   pr/properties.c
   pw/protocol_whois.c
   qc/mg_getopt.c
   qc/query_command.c
   qi/query_instructions.c
   rp/rp_convert.c
   rp/rp_load.c
   rp/rp_search.c
   rp/rp_tree.c
   rp/rp_update.c
   rx/rx_node.c
   rx/rx_print.c
   rx/rx_search.c
   rx/rx_tree.c
   sk/cd_socket.c
   sk/cd_watchdog.c
   sk/sk_socket.c
   sq/mysql_driver.c
   sv/server.c
   ta/ta.c
   th/thread.c
   ud/ud_comrol.c
   ud/ud_core.c
   ud/ud_main.c
   ud/ud_misc.c
   ud/ud_process_stream.c
   ud/ud_recover.c
   ud/ud_rx.c
   ud/ud_serial.c
   up/UP_extrnl_syntax.c
   up/UP_util.c
   ut/fdwrap.c
   ut/memwrap.c
   ut/numconv.c
   ut/timediff.c
   ut/ut_string.c
   wh/wh_queries.c
   wk/which_keytypes.c
Used in: ca_get_adminIntElement()ca/ca_configFns.c
  ca_get_adminStrElement()ca/ca_configFns.c
  ca_get_boolean()ca/ca_configFns.c
  ca_get_dirlist()ca/ca_configFns.c
  ca_get_int()ca/ca_configFns.c
  ca_get_string()ca/ca_configFns.c
  ca_set_boolean()ca/ca_configFns.c
  ca_srchandle2Intelement()ca/ca_configFns.c
  ca_srchandle2Strelement()ca/ca_configFns.c

Global Variable Keytypes

char* const Keytypes[]
Included from /home/shane/release/RIP/include/which_keytypes.h
Visible in:  wk/which_keytypes.c
Used in: WK_to_string()wk/which_keytypes.c

Global Variable wk_regex_list

struct {...} wk_regex_list[]
Visible in:  wk/which_keytypes.c
Used in: WK_new()wk/which_keytypes.c
  wk_regex_init()wk/which_keytypes.c

Local Variables

ipaddress
static regex_t ipaddress
Used in: wk_is_hostname()
  wk_is_name()
  wk_regex_init()

ipprefix
static regex_t ipprefix
Used in: wk_is_name()
  wk_regex_init()

validip6prefix
static regex_t validip6prefix
Used in: wk_is_name()
  wk_regex_init()

domainname
static regex_t domainname
Used in: wk_is_domain()
  wk_regex_init()

domainalpha
static regex_t domainalpha
Used in: wk_is_domain()
  wk_regex_init()


Global Function WK_new()

  Create a new which keytypes bitmap.

This checks the string to see which keys it looks like. This helps us decide what SQL tables (or radix trees) we need to query for a match.
More:
  Authors:
        ottrey
	shane
Online References:
mask_t WK_new ( char* key )
char* key
The key to be examined.
Prototyped in: /home/shane/release/RIP/include/which_keytypes.h
Calls: MA_new()ma/bitmask.c
  MA_set()ma/bitmask.c
  wk_is_domain()wk/which_keytypes.c
  wk_is_hostname()wk/which_keytypes.c
  wk_is_name()wk/which_keytypes.c
  pthread_once(), regexec()
Called by: QC_fill()qc/query_command.c
References Functions: wk_regex_init()wk/which_keytypes.c
References Variables: wk_regex_listwk/which_keytypes.c

Global Function WK_to_string()

  Convert the which keytypes bitmap into a string.

More:
  Authors:
        ottrey
Online References:
char* WK_to_string ( mask_t wk )
mask_t wk
The which keytypes mask to be converted.
Prototyped in: /home/shane/release/RIP/include/which_keytypes.h
Calls: MA_to_string()ma/bitmask.c
Called by: QC_query_command_to_string()qc/query_command.c
References Variables: Keytypeswk/which_keytypes.c

Local Function asctime_r()

static char* asctime_r ( const struct tm* __tm, char* __buf )
Included from: /usr/include/time.h
Calls: __posix_asctime_r()

Local Function ctime_r()

static char* ctime_r ( const time_t* __time, char* __buf )
Included from: /usr/include/time.h
Calls: __posix_ctime_r()

Local Function getlogin_r()

static int getlogin_r ( char* __name, int __len )
Included from: /usr/include/unistd.h
Calls: __posix_getlogin_r()

Local Function readdir_r()

static int readdir_r ( DIR* __dp, struct dirent* __ent, struct dirent** __res )
Included from: /usr/include/dirent.h
Calls: __posix_readdir_r()

Local Function sigwait()

static int sigwait ( const sigset_t* __setp, int* __signo )
Included from: /usr/include/signal.h
Calls: __posix_sigwait()

Local Function ttyname_r()

static int ttyname_r ( int __fildes, char* __buf, size_t __size )
Included from: /usr/include/unistd.h
Calls: __posix_ttyname_r()

Local Function wk_is_domain()

static unsigned int wk_is_domain ( char* key )
Calls: regexec()
Called by: WK_new()wk/which_keytypes.c
  wk_is_hostname()wk/which_keytypes.c
References Variables: domainalphawk/which_keytypes.c
  domainnamewk/which_keytypes.c

Local Function wk_is_hostname()

static unsigned int wk_is_hostname ( char* key )
Calls: wk_is_domain()wk/which_keytypes.c
  regexec()
Called by: WK_new()wk/which_keytypes.c
References Variables: ipaddresswk/which_keytypes.c

Local Function wk_is_name()

static unsigned int wk_is_name ( char* key )
Calls: regexec()
Called by: WK_new()wk/which_keytypes.c
References Variables: ipaddresswk/which_keytypes.c
  ipprefixwk/which_keytypes.c
  validip6prefixwk/which_keytypes.c

Local Function wk_regex_init()

static void wk_regex_init ( void )
Calls: fprintf(), regcomp()
Used in: WK_new()wk/which_keytypes.c
References Variables: domainalphawk/which_keytypes.c
  domainnamewk/which_keytypes.c
  ipaddresswk/which_keytypes.c
  ipprefixwk/which_keytypes.c
  validip6prefixwk/which_keytypes.c
  wk_regex_listwk/which_keytypes.c