1    | #ifndef READ_QUERY_COMMAND
2    | #define READ_QUERY_COMMAND
3    | 
4    | /***************************************
5    |   $Revision: 1.7 $
6    | 
7    |   Query command module (qi)
8    | 
9    |   Status: NOT REVUED, NOT TESTED
10   | 
11   |   ******************/ /******************
12   |   Copyright (c) 1999                              RIPE NCC
13   |  
14   |   All Rights Reserved
15   |   
16   |   Permission to use, copy, modify, and distribute this software and its
17   |   documentation for any purpose and without fee is hereby granted,
18   |   provided that the above copyright notice appear in all copies and that
19   |   both that copyright notice and this permission notice appear in
20   |   supporting documentation, and that the name of the author not be
21   |   used in advertising or publicity pertaining to distribution of the
22   |   software without specific, written prior permission.
23   |   
24   |   THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
25   |   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
26   |   AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
27   |   DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
28   |   AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
29   |   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
30   |   ***************************************/
31   | #define USAGE  "Usage: whois [-aFLmMrSvR] [-h hostname] [-s sources] [-T types] [-i attr] keys\n" \
32   | "whois -t type       whois -v type\n" \
33   | "\n"\
34   | "Where:\n"\
35   | "\n"\
36   | "-a                         search all databases\n"\
37   | "-F                         fast raw output\n"\
38   | "-h hostname                search alternate server\n"\
39   | "-i [attr][[,attr] ... ]    do an inverse lookup for specified attributes\n"\
40   | "-l                         ???\n"\
41   | "-L                         find all Less specific matches\n"\
42   | "-m                         find first level more specific matches\n"\
43   | "-M                         find all More specific matches\n"\
44   | "-r                         turn off recursive lookups\n"\
45   | "-s source[[,source] ... ]  search databases with source 'source'\n"\
46   | "-S                         tell server to leave out 'syntactic sugar'\n"\
47   | "-t type                    requests template for object of type 'type'\n"\
48   | "-v type                    requests verbose template for object of type 'type'\n"\
49   | "-R                         force to show local copy of the domain object even if it contains referral\n"\
50   | "-T type[[,type] ... ]      only look for objects of type 'type'\n"\
51   | "\n"\
52   | "Please note that most of these flags are NOT understood by\n"\
53   | "non RIPE whois servers\n\n"
54   | 
55   | #include <glib.h>
56   | #include "bitmask.h"
57   | 
58   | typedef struct Query_command_t {
59   |   unsigned int a;
60   |   unsigned int g;
61   |   mask_t inv_attrs_bitmap;
62   |   unsigned int k;
63   |   unsigned int recursive;
64   |   unsigned int l;
65   |   unsigned int m;
66   |   GList *sources_list;
67   |   unsigned int t;
68   |   unsigned int v;
69   |   unsigned int F;
70   |   unsigned int L;
71   |   unsigned int M;
72   |   unsigned int R;
73   |   unsigned int S;
74   |   mask_t object_type_bitmap;
75   |   unsigned int V;
76   |   mask_t keytypes_bitmap;
77   |   char *keys;
78   | } Query_command;
79   | 
80   | char *QC_bitmap_to_string(mask_t bitmap);
81   | char *QC_query_command_to_string(Query_command *query_command);
82   | void QC_free(Query_command *qc);
83   | Query_command *QC_new(char *query_str, int sock);
84   | Query_command *QC_environ_update(Query_command *qc, Query_command *qe);
85   | 
86   | #endif /* READ_QUERY_COMMAND */