File modules/qc/query_command.c

  $Revision: 1.22 $

Query command module (qc). This is what the whois query gets stored as in memory.
Status: NOT REVUED, NOT TESTED

Included Files


Preprocessor definitions

#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 Function QC_create()

Query_command* QC_create ( char* input, Query_environ* qe )
Prototyped in: modules/qc/query_command.h
Calls: QC_fill()modules/qc/query_command.c
  fprintf(), strcmp(), strlen(), wr_real_calloc()
Called by: PW_interact()modules/pw/protocol_whois.c

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()
Called by: PW_interact()modules/pw/protocol_whois.c

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: CO_get_database()modules/co/constants.c
  fprintf(), g_list_append(), wr_real_calloc()
Called by: PW_interact()modules/pw/protocol_whois.c

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: DF_sources_list_to_string()modules/df/defs.c
  IP_addr_b2a()modules/ip/ip.c
  fprintf(), sprintf(), strcpy(), strlen(), wr_real_free(), wr_real_malloc()
Called by: print_hello_banner()modules/pw/protocol_whois.c

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()
Called by: PW_interact()modules/pw/protocol_whois.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 strsep()

char* strsep ( char** stringp, const char* delim )
Calls: strtok_r()
Called by: QC_fill()modules/qc/query_command.c

Local Function QC_fill()

  Create a new query_command.

Pre-condition:
More:
  Authors:
        ottrey
Online References:
static void 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
 
Query_environ* qe
the environment
Calls: CO_get_comnd_logging()modules/co/constants.c
  CO_get_database()modules/co/constants.c
  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_database()modules/df/defs.c
  DF_get_server_queries()modules/df/defs.c
  DF_get_source()modules/df/defs.c
  DF_get_sources()modules/df/defs.c
  DF_sources_to_string()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
  log_command()modules/qc/query_command.c
  my_getopt()modules/qc/query_command.c
  strsep()modules/qc/query_command.c
  SK_cd_puts(), WK_new(), fprintf(), g_list_append(), g_list_first(), g_list_remove(), g_strsplit(), getsubopt(), sprintf(), strcat(), strcmp(), strcpy(), strlen(), strncmp(), strncpy(), 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: CO_get_comnd_logfile()modules/co/constants.c
  CO_get_comnd_logging()modules/co/constants.c
  QC_query_command_to_string()modules/qc/query_command.c
  fclose(), fopen(), fprintf(), printf(), strcmp(), wr_real_free()
Called by: QC_fill()modules/qc/query_command.c

Local Function my_getopt()

  A thread safe version of getopt, used to get the options from the whois
  query.

More:
  Authors:
        ottrey
Online References:
  • man getopt
static int my_getopt ( int opt_argc, char** opt_argv, char* optstring, int* my_optind_ptr, char** my_optarg_ptr )
int opt_argc
The number of query arguments.
char** opt_argv
The query arguments.
char* optstring
The string containing valid options.
int* my_optind_ptr
A pointer to the index into the options of the option returned.
char** my_optarg_ptr
A pointer to the arguments to be returned.
Calls: strlen(), strncmp()
Called by: QC_fill()modules/qc/query_command.c