Cross reference for modules/qc/query_command.c of index.

# File modules/qc/query_command.c

      $Revision: 1.39 $

      Query command module (qc).  This is what the whois query gets stored as in
      memory.

      Status: NOT REVUED, TESTED

## Included Files

- `#include <stdlib.h>`

- `#include <stdio.h>`

- `#include <string.h>`

- `#include <ctype.h>`

- `#include "modules/qc/query_command.h"`
  - `#include <glib.h>`
  - `#include "include/bitmask.h"`
  - `#include "include/socket.h"`
    - `#include <sys/types.h>`
    - `#include <sys/socket.h>`
    - `#include <netinet/in.h>`
    - `#include <stdlib.h>`
    - `#include <errno.h>`
    - `#include <netdb.h>`
    - `#include <signal.h>`
    - `#include <stdio.h>`
    - `#include <include/iproutines.h>`

- `#include "include/defs.h"`
  - `#include <glib.h>`
  - `#include "include/bitmask.h"`
  - `#include "include/DF_class_enum.def"`
  - `#include "include/DF_class_mask.def"`
  - `#include "include/DF_attribute_enum.def"`
  - `#include "include/DF_attribute_inv_attr_mask.def"`
  - `#include "include/which_keytypes.h"`
    - `#include "include/bitmask.h"`
  - `#include "include/iproutines.h"`
  - `#include "include/rxroutines.h"`
    - `#include <glib.h>`
    - `#include <pthread.h>`
    - `#include <stubs.h>`
    - `#include <include/memwrap.h>`
    - `#include <stdio.h>`
    - `#include <iproutines.h>`
    - `#include <erroutines.h>`
    - `#include "include/socket.h"`
    - `#include "include/thread.h"`
      - `#include <pthread.h>`

- `#include "include/constants.h"`
  - `#include <glib.h>`

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

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

- `#include "include/ca_configFns.h"`
  - `#include "include/ca_defs.h"`
    - `#include <pthread.h>`
    - `#include <glib.h>`

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

- `#include "include/ca_macros.h"`
  - `#include "include/ca_adminAttribs.h"`

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

- `#include "modules/qc/getopt.h"`

## Preprocessor definitions

`#define QC_IMPL`

`#define MAX_OPT_ARG_C 20`

String sizes

`#define STR_S 63`

`#define STR_M 255`

`#define STR_L 1023`

`#define STR_XL 4095`

`#define STR_XXL 16383`

## Global Variable qrytype_str

`char* qrytype_str[]`

Included from | modules/qc/query_command.h
Visible in: |  | modules/qc/query_command.c
Used in: | QC_get_qrytype() | modules/qc/query_command.c

## Global Variable Lock

`pthread_mutex_t Lock`

Included from | include/ca_defs.h
Visible in: |  | modules/ac/access_control.c
|  | modules/ca/ca_configFns.c
|  | modules/ca/ca_values.c
|  | modules/pm/pm_serials.c
|  | modules/pm/protocol_mirror.c
|  | modules/qc/query_command.c
Used in: | ca_get_adminIntElement() | modules/ca/ca_configFns.c
| ca_get_adminStrElement() | modules/ca/ca_configFns.c
| ca_get_boolean() | modules/ca/ca_configFns.c
| ca_get_dirlist() | modules/ca/ca_configFns.c
| ca_get_int() | modules/ca/ca_configFns.c
| ca_get_string() | modules/ca/ca_configFns.c
| ca_set_boolean() | modules/ca/ca_configFns.c
| ca_set_string() | modules/ca/ca_configFns.c

## Global Variable newPort

`char newPort[16]`

Included from | include/ca_defs.h
Visible in: |  | modules/ac/access_control.c
|  | modules/ca/ca_configFns.c
|  | modules/ca/ca_values.c
|  | modules/pm/pm_serials.c
|  | modules/pm/protocol_mirror.c
|  | modules/qc/query_command.c

## Global Function QC_create()

     QC_create()

      try to parse the query and fill in the QC struct, setting
      qc->query_type accordingly.

      by marek.

`Query_command* QC_create ( char* input, Query_environ* qe )`

Prototyped in: | modules/qc/query_command.h
Calls: | QC_fill() | modules/qc/query_command.c
| calloc(), fprintf(), free(), strchr(), strcmp(), strlen(), wr_real_calloc()

## Global Function QC_environ_free()

      Free the query_environ.

      Query_command *qc query_environ to be freed.

      More:

      Authors:
            ottrey

    Online References:

`void QC_environ_free ( Query_environ* qe )`

Prototyped in: | modules/qc/query_command.h
Calls: | g_list_free(), wr_real_free()

## Global Function QC_environ_new()

      Create a new query environment.

      More:

      Authors:
            ottrey

    Online References:

`Query_environ* QC_environ_new ( char* ip, unsigned sock )`

Prototyped in: | modules/qc/query_command.h
Calls: | ca_get_SourceHandleByPosition() | modules/ca/ca_configFns.c
| ca_srchandle2Strelement() | modules/ca/ca_configFns.c
| fprintf(), g_list_append(), wr_real_calloc()

## Global Function QC_environ_to_string()

      Convert the query_environ to a string.

      Query_environ *query_environ The query_environ to be converted.

      More:

      Authors:
            ottrey

    Online References:

`char* QC_environ_to_string ( Query_environ qe )`

Prototyped in: | modules/qc/query_command.h
Calls: | IP_addr_b2a() | modules/ip/ip.c
| qc_sources_list_to_string() | modules/qc/query_command.c
| fprintf(), sprintf(), strcpy(), strlen(), wr_real_free(), wr_real_malloc()

## Global Function QC_free()

      Free the query_command.

      XXX I'm not sure the bitmaps will get freed.
      qc->inv_attrs_bitmap
      qc->object_type_bitmap
      qc->keytypes_bitmap

      More:

      Authors:
            ottrey

    Online References:

`void QC_free ( Query_command* qc )`

`Query_command* qc`
  query_command to be freed.

Prototyped in: | modules/qc/query_command.h
Calls: | wr_real_free()

## Global Function QC_get_qrytype()

`char* QC_get_qrytype ( qc_qtype_t qrytype )`

Prototyped in: | modules/qc/query_command.h
Calls: | fprintf()
References Variables: | qrytype_str | modules/qc/query_command.c

## Global Function QC_query_command_to_string()

      Convert the query_command to a string.

      More:

      Authors:
            ottrey

    Online References:

`char* QC_query_command_to_string ( Query_command* query_command )`

`Query_command* query_command`
  The query_command to be converted.

Prototyped in: | modules/qc/query_command.h
Calls: | DF_get_attribute_names() | modules/df/defs.c
| DF_get_class_names() | modules/df/defs.c
| MA_to_string() | modules/ma/bitmask.c
| WK_to_string(), fprintf(), sprintf(), strcpy(), strlen(), wr_real_free(), wr_real_malloc()
Called by: | log_command() | modules/qc/query_command.c

## Global Function qc_sources_list_to_string()

`char* qc_sources_list_to_string ( GList* list )`

Calls: | ca_srchandle2Strelement() | modules/ca/ca_configFns.c
| fprintf(), g_list_first(), strcat(), strlen(), wr_real_realloc()
Called by: | QC_environ_to_string() | modules/qc/query_command.c

## Local Function QC_fill()

      Create a new query_command.

      Pre-condition:

      Returns -1 when query incorrect, 0 otherwise

      More:

      Authors:
            ottrey - original code
    	marek - modified for my getopts, multiple sources;
    	        and generally cleaned.

    Online References:

`static int QC_fill ( char* query_str, Query_command* query_command, Query_environ* qe )`

`char* query_str`
  The garden variety whois query string.
`Query_command* query_command`
  &nbs;
`Query_environ* qe`
  the environment

Calls: | DF_get_attribute_aliases() | modules/df/defs.c
| DF_get_attribute_index() | modules/df/defs.c
| DF_get_class_aliases() | modules/df/defs.c
| DF_get_class_index() | modules/df/defs.c
| DF_get_server_queries() | modules/df/defs.c
| IP_addr_t2b() | modules/ip/ip.c
| MA_isset() | modules/ma/bitmask.c
| MA_new() | modules/ma/bitmask.c
| MA_set() | modules/ma/bitmask.c
| ca_get_SourceHandleByName() | modules/ca/ca_configFns.c
| ca_get_SourceHandleByPosition() | modules/ca/ca_configFns.c
| log_command() | modules/qc/query_command.c
| mg_getopt() | modules/qc/mg_getopt.c
| mg_new() | modules/qc/mg_getopt.c
| SK_cd_printf(), SK_cd_puts(), WK_new(), fprintf(), g_list_append(), g_list_free(), g_strsplit(), getsubopt(), sprintf(), strcat(), strcmp(), strcpy(), strlen(), strncpy(), strtok_r(), toupper(), wr_real_calloc(), wr_real_free(), wr_real_malloc()
Called by: | QC_create() | modules/qc/query_command.c

## Local Function log_command()

      Log the command.
      This is more to do with Tracing.  And should/will get merged with a tracing
      module (when it is finalized.)

      More:

      Authors:
            ottrey

    Online References:

`static void log_command ( char* query_str, Query_command* query_command )`

Calls: | ER_dbg_va() | modules/er/er.c
| ER_is_traced() | modules/er/er.c
| QC_query_command_to_string() | modules/qc/query_command.c
| wr_real_free()
Called by: | QC_fill() | modules/qc/query_command.c