-
Notifications
You must be signed in to change notification settings - Fork 256
/
graphviz.in
388 lines (303 loc) · 5.55 KB
/
graphviz.in
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
# This file is part of SCIgen.
#
# SCIgen is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# SCIgen is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SCIgen; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GRAPHVIZ {
LAYOUT
size="3,3";
NODES
EDGES
END
}
LAYOUT {
GRAPH_DIR {
}
END }
NUM_NODES 2
NUM_NODES 3
NUM_NODES 4
NUM_NODES 5
NUM_NODES 6
NUM_NODES 7
NUM_NODES 8
NUM_NODES 9
NUM_NODES 10
NODES_1 NEW_NODE;
NODES_2 {
NEW_NODE;
NODES_1
}
NODES_3 {
NEW_NODE;
NODES_2
}
NODES_4 {
NEW_NODE;
NODES_3
}
NODES_5 {
NEW_NODE;
NODES_4
}
NODES_6 {
NEW_NODE;
NODES_5
}
NODES_7 {
NEW_NODE;
NODES_6
}
NODES_8 {
NEW_NODE;
NODES_7
}
NODES_9 {
NEW_NODE;
NODES_8
}
NODES_10 {
NEW_NODE;
NODES_9
}
EDGES_1 EDGE;
EDGES_2 {
EDGE;
EDGES_1
}
EDGES_3 {
EDGE;
EDGES_2
}
EDGES_4 {
EDGE;
EDGES_3
}
EDGES_5 {
EDGE;
EDGES_4
}
EDGES_6 {
EDGE;
EDGES_5
}
EDGES_7 {
EDGE;
EDGES_6
}
EDGES_8 {
EDGE;
EDGES_7
}
EDGES_9 {
EDGE;
EDGES_8
}
EDGES_10 {
EDGE;
EDGES_9
}
EDGES_11 {
EDGE;
EDGES_10
}
EDGES_12 {
EDGE;
EDGES_11
}
EDGES_13 {
EDGE;
EDGES_12
}
EDGES_14 {
EDGE;
EDGES_13
}
EDGES_15 {
EDGE;
EDGES_14
}
EDGES_16 {
EDGE;
EDGES_15
}
NEW_NODE nodeNODENUM+ [label=NODE_LABEL, shape=SHAPE_TYPE]
OLD_NODE nodeNODENUM#
NODENUM\+
NODENUM\#
EDGE OLD_NODE EDGEOP LABELED_EDGE
EDGE!
LABELED_EDGE!
LABELED_EDGE OLD_NODE [label=EDGE_LABEL, dir="back"]
EDGE_LABEL_YESNO yes
EDGE_LABEL_YESNO no
NODE_LABEL_PROG "Web Browser"
NODE_LABEL_PROG Kernel
NODE_LABEL_PROG Userspace
NODE_LABEL_PROG JVM
NODE_LABEL_PROG+10 SYSNAME
NODE_LABEL_PROG Editor
NODE_LABEL_PROG Simulator
NODE_LABEL_PROG Emulator
NODE_LABEL_PROG "File System"
NODE_LABEL_PROG Network
NODE_LABEL_PROG "Video Card"
NODE_LABEL_PROG X
NODE_LABEL_PROG "Trap handler"
NODE_LABEL_PROG Memory
NODE_LABEL_PROG Shell
NODE_LABEL_PROG Keyboard
NODE_LABEL_PROG Display
NODE_LABEL_DEC "NODE_LABEL_LET < NODE_LABEL_LET"
NODE_LABEL_DEC "NODE_LABEL_LET == NODE_LABEL_LET"
NODE_LABEL_DEC "NODE_LABEL_LET > NODE_LABEL_LET"
NODE_LABEL_DEC "NODE_LABEL_LET != NODE_LABEL_LET"
NODE_LABEL_DEC "NODE_LABEL_LET % 2\n== 0"
NODE_LABEL_DEC "goto\nTWODIG"
NODE_LABEL_DEC "goto\nSYSNAME"
NODE_LABEL_DEC stop
NODE_LABEL_DEC start
TWODIG NONZ
TWODIG NONZDIGIT
NODE_LABEL_LET A
NODE_LABEL_LET B
NODE_LABEL_LET C
NODE_LABEL_LET D
NODE_LABEL_LET E
NODE_LABEL_LET F
NODE_LABEL_LET G
NODE_LABEL_LET H
NODE_LABEL_LET I
NODE_LABEL_LET J
NODE_LABEL_LET K
NODE_LABEL_LET L
NODE_LABEL_LET M
NODE_LABEL_LET N
NODE_LABEL_LET O
NODE_LABEL_LET P
NODE_LABEL_LET Q
NODE_LABEL_LET R
NODE_LABEL_LET S
NODE_LABEL_LET T
NODE_LABEL_LET U
NODE_LABEL_LET V
NODE_LABEL_LET W
NODE_LABEL_LET X
NODE_LABEL_LET Y
NODE_LABEL_LET Z
NODE_LABEL_NET Gateway
NODE_LABEL_NET "SYSNAME\nnode"
NODE_LABEL_NET "SYSNAME\nserver"
NODE_LABEL_NET "SYSNAME\nclient"
NODE_LABEL_NET "Web proxy"
NODE_LABEL_NET Firewall
NODE_LABEL_NET "Remote\nfirewall"
NODE_LABEL_NET "Remote\nserver"
NODE_LABEL_NET "DNS\nserver"
NODE_LABEL_NET "CDN\ncache"
NODE_LABEL_NET "Home\nuser"
NODE_LABEL_NET VPN
NODE_LABEL_NET "Bad\nnode"
NODE_LABEL_NET "Failed!"
NODE_LABEL_NET "Client\nA"
NODE_LABEL_NET "Client\nB"
NODE_LABEL_NET "Server\nA"
NODE_LABEL_NET "Server\nB"
NODE_LABEL_NET "NAT"
NODE_LABEL_HW "L1\ncache"
NODE_LABEL_HW "L2\ncache"
NODE_LABEL_HW "L3\ncache"
NODE_LABEL_HW "Memory\nbus"
NODE_LABEL_HW "CPU"
NODE_LABEL_HW "GPU"
NODE_LABEL_HW "Page\ntable"
NODE_LABEL_HW "Register\nfile"
NODE_LABEL_HW "SYSNAME\ncore"
NODE_LABEL_HW "Trap\nhandler"
NODE_LABEL_HW "DMA"
NODE_LABEL_HW "Disk"
NODE_LABEL_HW "ALU"
NODE_LABEL_HW "PC"
NODE_LABEL_HW "Stack"
NODE_LABEL_HW "Heap"
NONZ 1
NONZ 2
NONZ 3
NONZ 4
NONZ 5
NONZ 6
NONZ 7
NONZ 8
NONZ 9
DIGIT+9 NONZ
DIGIT 0
IP_PORT NONZDIGIT
IP_PART DIGIT
IP_PART+4 NONZDIGIT
IP_PART+4 1DIGITDIGIT
IP_PART 20DIGIT
IP_PART 21DIGIT
IP_PART 22DIGIT
IP_PART 23DIGIT
IP_PART 23DIGIT
IP_PART 24DIGIT
IP_PART 250
IP_PART 251
IP_PART 252
IP_PART 253
IP_PART 254
IP_PART 255
NODE_LABEL_IP+5 "IP_PART.IP_PART.IP_PART.IP_PART", IP_FONT_SIZE
NODE_LABEL_IP "IP_PART.IP_PART.IP_PART.0/24", IP_FONT_SIZE
NODE_LABEL_IP "IP_PART.IP_PART.0.0/16", IP_FONT_SIZE
NODE_LABEL_IP "IP_PART.0.0.0/8", IP_FONT_SIZE
NODE_LABEL_IP "IP_PART.IP_PART.IP_PART.IP_PART:IP_PORT", IP_FONT_SIZE
IP_FONT_SIZE fontsize=9
NODE_LABEL!
# letter
PICK_LABEL_TYPE+2 0
#programs
PICK_LABEL_TYPE+2 1
#network elements
PICK_LABEL_TYPE+2 2
# ip addresses
PICK_LABEL_TYPE 3
# hardware
PICK_LABEL_TYPE+2 4
# decisions
PICK_LABEL_TYPE+2 5
PICK_GRAPH_TYPE graph
PICK_GRAPH_TYPE digraph
PICK_SHAPE_TYPE+3 SHAPE_TYPE
PICK_SHAPE_TYPE+2 SHAPE_TYPE SHAPE_TYPE
PICK_SHAPE_TYPE SHAPE_TYPE SHAPE_TYPE SHAPE_TYPE
PICK_SHAPE_TYPE SHAPE_TYPE SHAPE_TYPE SHAPE_TYPE SHAPE_TYPE SHAPE_TYPE
SHAPE_TYPE+7 ellipse
SHAPE_TYPE circle
SHAPE_TYPE egg
SHAPE_TYPE+5 triangle
SHAPE_TYPE+5 diamond
SHAPE_TYPE+10 box
SHAPE_TYPE trapezium
SHAPE_TYPE parallelogram
SHAPE_TYPE house
SHAPE_TYPE hexagon
SHAPE_TYPE octagon
SHAPE_TYPE record
SHAPE_TYPE polygon
SHAPE_TYPE!
UNDIR_LAYOUT neato
UNDIR_LAYOUT twopi
UNDIR_LAYOUT circo
UNDIR_LAYOUT fdp
DIR_LAYOUT dot