-
Notifications
You must be signed in to change notification settings - Fork 0
/
todo
135 lines (79 loc) · 2.97 KB
/
todo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
+=========================================================================================================================
|dns_lib|
+-------+
**OK**int build_dns_message_aaa(DNS_MESSAGE *msg, char **output);
**OK**int build_dns_message_answer(DNS_MESSAGE *msg, char **output);
**OK**int build_dns_message_authority(DNS_MESSAGE *msg, char **output);
**OK**int build_dns_message_additional(DNS_MESSAGE *msg, char **output);
**OK**int insert_dns_message_answer(DNS_MESSAGE *message, char *buffer, int buf_length);
**OK**int insert_dns_message_authority(DNS_MESSAGE *message, char *buffer, int buf_length);
**OK**int insert_dns_message_additional(DNS_MESSAGE *message, char *buffer, int buf_length);
+==================================================================================================
+===================================================================================================
|args.c|
+------+
+===================================================================================================
+===================================================================================================
|dns_resolver|
+------------+
Arguments system:
There are 2 types how program can be run.
First type is 'run-output-close'
Second is 'run-editor_loop-close'
in examples below 'dns' is a name of compiled program.
text in '{ }' are comments.
In the first case user puts some args as standard program arguments, eg.
./dns -some_argument_1 -some_arg_2
then program shows result (output) and close.
Second case is more complicated, user give some special arg
./dns -some_special_arg
Then programs runs in loop and takes from standard input commands and executes it.
This two cases with parameters are described below in details.
First case:
run-output-close:
args:
standard arguments:
-help
/?
-?
/help
Show help.
-server [server ip] -name [domain name]
-server [CONST ALIAS] -name [domain name]
-server ([CONST ALIAS] or [server ip]) -prot [UDP/TCP type]
CONST ALIAS are defined as:
ROOT_X
where X is a first label of root-servers domains.
For example:
ROOT_A (means a.root-server.org )
ROOT_B (means b.root-server.org )
ROOT_K (means k.root-server.org etc...)
prot TYPE:
protocols which can be used are:
udp
tcp
default protocol is udp.
Example question to google DNS server for stackoverflow.com address:
./dns -server 8.8.8.8 -name www.stackoverflow.com
OR
./dns -server 8.8.8.8 -name stackoverflow.com
OR
./dns -server 8.8.8.8 -name www.stackoverflow.com -prot tcp
Additional arguments:
-v (show informations what happend)
-vv (show more informations what happend)
Second case:
first parameter must be -builder:
./dns -builder
then programs runs main loop.
./dns -build
>> [BUILD MODE]
>>
to exit this loop just enter 'exit'
./dns -build
>> [BUILD MODE]
>> exit
>> closing.
???????????????????????????????????????
+===================================================================================================
------------------------------