Cross reference for modules/pw/protocol_whois.c of index.

# File modules/pw/protocol_whois.c

      $Revision: 1.50 $

      Protocol whois module (pw).  Whois protocol.

      Status: NOT REVUED, TESTED

## Included Files

- `#include <stdio.h>`

- `#include <glib.h>`

- `#include "include/NAME"`

- `#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 <sys/types.h>`
    - `#include <glib.h>`
    - `#include <include/inet6def.h>`
    - `#include <include/erroutines.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/sk.h"`
      - `#include "include/stubs.h"`
      - `#include <sys/types.h>`
      - `#include <sys/socket.h>`
      - `#include <netinet/in.h>`
      - `#include <netdb.h>`
      - `#include <pthread.h>`
      - `#include <stdlib.h>`
      - `#include <errno.h>`
      - `#include <fcntl.h>`
      - `#include <signal.h>`
      - `#include <stdio.h>`
      - `#include "include/iproutines.h"`
    - `#include "include/thread.h"`

- `#include "modules/pw/protocol_whois.h"`
  - `#include "include/query_command.h"`
    - `#include <glib.h>`
    - `#include "include/bitmask.h"`
    - `#include "include/sk.h"`

- `#include "include/mysql_driver.h"`
  - `#include "/opt/package/mysql/include/mysql/mysql.h"`
    - `#include <sys/types.h>`
    - `#include "/opt/package/mysql/include/mysql/mysql_com.h"`
    - `#include "/opt/package/mysql/include/mysql/mysql_version.h"`
  - `#include "/opt/package/mysql/include/mysql/mysqld_error.h"`
  - `#include "include/erroutines.h"`

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

- `#include "include/query_instructions.h"`
  - `#include "include/rxroutines.h"`
  - `#include "include/iproutines.h"`
  - `#include "include/mysql_driver.h"`
  - `#include "include/query_command.h"`
  - `#include "include/defs.h"`
  - `#include "include/which_keytypes.h"`
  - `#include "include/access_control.h"`
    - `#include "include/erroutines.h"`
    - `#include "include/iproutines.h"`
    - `#include "include/rxroutines.h"`
    - `#include "include/mysql_driver.h"`
  - `#include "include/ca_configFns.h"`
    - `#include "include/ca_defs.h"`
      - `#include <pthread.h>`
      - `#include <glib.h>`
  - `#include "include/ca_dictionary.h"`
  - `#include "include/ca_macros.h"`
    - `#include "include/ca_adminAttribs.h"`
  - `#include "include/ca_srcAttribs.h"`

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

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

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

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

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

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

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

- `#include "include/protocol_mirror.h"`
  - `#include <glib.h>`
  - `#include "include/mysql_driver.h"`
  - `#include "include/iproutines.h"`
  - `#include "include/aa.h"`
    - `#include "include/iproutines.h"`

- `#include "include/ta.h"`
  - `#include <glib.h>`
  - `#include <pthread.h>`
  - `#include <stdio.h>`
  - `#include "include/stubs.h"`
  - `#include "include/memwrap.h"`
  - `#include "include/sk.h"`
  - `#include "include/timediff.h"`
    - `#include <sys/time.h>`

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

## Preprocessor definitions

`#define VERSION "3"`

void display_file opens a file and displays its contents to the connection described in conn. structure.
sk_conn_st *condat pointer to connection structure
char *filename file name

`#define READBUFSIZE 148`

## 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_initFn.c
|  | modules/ca/ca_sanityCheck.c
|  | modules/ca/ca_sourceLoader.c
|  | modules/ca/ca_values.c
|  | modules/er/er_macro.c
|  | modules/pm/pm_serials.c
|  | modules/pm/protocol_mirror.c
|  | modules/pw/protocol_whois.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
| ca_srchandle2Intelement() | modules/ca/ca_configFns.c
| ca_srchandle2Strelement() | 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_initFn.c
|  | modules/ca/ca_sanityCheck.c
|  | modules/ca/ca_sourceLoader.c
|  | modules/ca/ca_values.c
|  | modules/er/er_macro.c
|  | modules/pm/pm_serials.c
|  | modules/pm/protocol_mirror.c
|  | modules/pw/protocol_whois.c

## Global Function PW_interact()

      void
      PW_interact             Main loop for interaction with a single client.
                              The function sets up the accounting for the client,
    			  invokes parsing, execution, logging and accounting
    			  of the query.

`void PW_interact ( int sock )`

`int sock`
  Socket that client is connected to.

Prototyped in: | modules/pw/protocol_whois.h
Calls: | AC_acc_addup() | modules/ac/access_control.c
| AC_check_acl() | modules/ac/access_control.c
| AC_commit() | modules/ac/access_control.c
| AC_credit_isdenied() | modules/ac/access_control.c
| CO_get_whois_suspended() | modules/co/constants.c
| ER_dbg_va() | modules/er/er.c
| ER_inf_va() | modules/er/er.c
| PW_process_qc() | modules/pw/protocol_whois.c
| ca_get_int() | modules/ca/ca_configFns.c
| ca_get_string() | modules/ca/ca_configFns.c
| pw_log_query() | modules/pw/protocol_whois.c
| QC_create(), QC_environ_free(), QC_environ_new(), QC_free(), SK_cd_free(), SK_cd_gets(), SK_cd_make(), SK_cd_puts(), SK_getpeername(), TA_increment(), TA_setactivity(), TA_setcondat(), UT_timeget(), memcmp(), memset(), ut_string_chop(), wr_real_free()
Called by: | show_whois() | modules/pc/pc_commands.c
References Variables: | IP_ADDR_UNSPEC | modules/ip/ip.c

## Global Function PW_process_qc()

      void
      PW_process_qc          processes the query commands determined in QC,
                             This is where all the real action of the query
    			 part is invoked.

`void PW_process_qc ( Query_environ* qe, Query_command* qc, acc_st* acc_credit, acl_st* acl_eip )`

`Query_environ* qe`
  query environment
`Query_command* qc`
  query command structure
`acc_st* acc_credit`
  credit assigned to this IP
`acl_st* acl_eip`
  current acl record applicable to this IP

Calls: | AC_credit_isdenied() | modules/ac/access_control.c
| DF_get_class_template() | modules/df/defs.c
| DF_get_class_template_v() | modules/df/defs.c
| NOERR() | modules/er/er.c
| PM_get_nrtm_sources() | modules/pm/pm_serials.c
| ca_get_dirlist() | modules/ca/ca_configFns.c
| ca_get_string() | modules/ca/ca_configFns.c
| display_file() | modules/pw/protocol_whois.c
| QI_execute(), QI_free(), QI_new(), SK_cd_puts(), fprintf(), g_list_first(), g_string_free(), wr_real_free()
Called by: | PW_interact() | modules/pw/protocol_whois.c

## Local Function display_file()

    void
    display_file        opens a file and displays its contents to the
                        connection described in conn. structure.

`static void display_file ( sk_conn_st* condat, char* filename )`

`sk_conn_st* condat`
  pointer to connection structure
`char* filename`
  file name

Calls: | ER_perror() | modules/er/er.c
| SK_cd_puts(), fclose(), fopen(), fread(), strerror()
Called by: | PW_process_qc() | modules/pw/protocol_whois.c

## Local Function pw_log_query()

      static void
      pw_log_query              logs the query to a file after it has finished.
                                Takes many parameters to have access to as much
    			    information as possible, including the original
    			    query, accounting, response time, status of the
    			    client connection, etc.

`static void pw_log_query ( Query_environ* qe, Query_command* qc, acc_st* copy_credit, ut_timer_t begintime, ut_timer_t endtime, char* hostaddress, char* input )`

`Query_environ* qe`
  query environment
`Query_command* qc`
  query command structure
`acc_st* copy_credit`
  numbers of objects returned / referrals made during this query (calculated as original credit assigned before the query minus what's left after the query).
`ut_timer_t begintime`
  time the processing began
`ut_timer_t endtime`
  time the processing finished
`char* hostaddress`
  text address of the real IP
`char* input`
  original query (trailing whitespaces chopped off)

Calls: | AC_credit_to_string() | modules/ac/access_control.c
| ER_inf_va() | modules/er/er.c
| QC_get_qrytype(), UT_timediff(), wr_real_free()
Called by: | PW_interact() | modules/pw/protocol_whois.c