Cross reference for modules/wk/which_keytypes.c of index.

# File modules/wk/which_keytypes.c

      $Revision: 1.24 $

      which_keytypes:  Determine which keys to look for.

      This is based on the existing Perl code.

      Authors: ottrey, marek

## Included Files

- `#include <stdio.h>`

- `#include <stdlib.h>`

- `#include <strings.h>`

- `#include <glib.h>`

- `#include <pthread.h>`

- `#include "include/bitmask.h"`

- `#include "include/memwrap.h"`
  - `#include <include/erroutines.h>`
  - `#include <glib.h>`

- `#include "modules/wk/which_keytypes.h"`
  - `#include "include/bitmask.h"`

- `#include <regex.h>`

## 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 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 Keytypes

`char* const Keytypes[]`

Included from | modules/wk/which_keytypes.h
Visible in: |  | modules/wk/which_keytypes.c
Used in: | WK_to_string() | modules/wk/which_keytypes.c

## Global Variable wk_regex_list

`struct {...} wk_regex_list[]`

Visible in: |  | modules/wk/which_keytypes.c
Used in: | WK_new() | modules/wk/which_keytypes.c
| wk_regex_init() | modules/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: | modules/wk/which_keytypes.h
Calls: | MA_new() | modules/ma/bitmask.c
| MA_set() | modules/ma/bitmask.c
| wk_is_domain() | modules/wk/which_keytypes.c
| wk_is_hostname() | modules/wk/which_keytypes.c
| wk_is_name() | modules/wk/which_keytypes.c
| pthread_once(), regexec()
Called by: | QC_fill() | modules/qc/query_command.c
References Functions: | wk_regex_init() | modules/wk/which_keytypes.c
References Variables: | wk_regex_list | modules/wk/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: | modules/wk/which_keytypes.h
Calls: | MA_to_string() | modules/ma/bitmask.c
Called by: | QC_query_command_to_string() | modules/qc/query_command.c
References Variables: | Keytypes | modules/wk/which_keytypes.c

## Local Function wk_is_domain()

`static unsigned int wk_is_domain ( char* key )`

Calls: | regexec()
Called by: | WK_new() | modules/wk/which_keytypes.c
| wk_is_hostname() | modules/wk/which_keytypes.c
References Variables: | domainalpha | modules/wk/which_keytypes.c
| domainname | modules/wk/which_keytypes.c

## Local Function wk_is_hostname()

`static unsigned int wk_is_hostname ( char* key )`

Calls: | wk_is_domain() | modules/wk/which_keytypes.c
| regexec()
Called by: | WK_new() | modules/wk/which_keytypes.c
References Variables: | ipaddress | modules/wk/which_keytypes.c

## Local Function wk_is_name()

`static unsigned int wk_is_name ( char* key )`

Calls: | regexec()
Called by: | WK_new() | modules/wk/which_keytypes.c
References Variables: | ipaddress | modules/wk/which_keytypes.c
| ipprefix | modules/wk/which_keytypes.c
| validip6prefix | modules/wk/which_keytypes.c

## Local Function wk_regex_init()

`static void wk_regex_init ( void )`

Calls: | fprintf(), regcomp()
Used in: | WK_new() | modules/wk/which_keytypes.c
References Variables: | domainalpha | modules/wk/which_keytypes.c
| domainname | modules/wk/which_keytypes.c
| ipaddress | modules/wk/which_keytypes.c
| ipprefix | modules/wk/which_keytypes.c
| validip6prefix | modules/wk/which_keytypes.c
| wk_regex_list | modules/wk/which_keytypes.c