From 385cc92bc91e1a6c3724085c060e76bf40c13ed3 Mon Sep 17 00:00:00 2001
From: Rasmus Dahlberg <rasmus@rgdd.se>
Date: Tue, 15 Oct 2024 16:08:16 +0200
Subject: Import PhD thesis

---
 summary/src/ctga/img/parser.tex | 66 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 summary/src/ctga/img/parser.tex

(limited to 'summary/src/ctga/img/parser.tex')

diff --git a/summary/src/ctga/img/parser.tex b/summary/src/ctga/img/parser.tex
new file mode 100644
index 0000000..dba221b
--- /dev/null
+++ b/summary/src/ctga/img/parser.tex
@@ -0,0 +1,66 @@
+\resizebox{\columnwidth}{!}{%
+\begin{tikzpicture}[%
+  -latex,
+  sibling distance=10em,
+  level distance=22pt,
+  parser/.style = {%
+    draw,
+    shape=rectangle,
+    rounded corners,
+    align=center,
+    top color=white,
+    bottom color=mydblue!20,
+  },
+  label/.style = {%
+    draw=none,
+    align=center,
+    text=mydblue,
+    font=\scriptsize,
+  },
+  arrow/.style = {%
+	  draw,
+	  -latex,
+	  rounded corners,
+  },
+]
+	
+	\node[parser](eth){Ethernet};
+	\node[parser,right=of eth](udp){UDP};
+	\coordinate(ip) at ($ (eth) !.5! (udp) $);
+	\node[parser,above=of ip](ipv4){IPv4};
+	\node[parser,below=of ip](ipv6){IPv6};
+
+	\node[parser,right=of udp](dns){DNS};
+	\node[parser](dnsp) at ($ (dns) + (1,1.1) $){preamble};
+	\node[parser](dnsq) at ($ (dns) + (2.25,.45) $){domain name};
+	\node[parser](dnst) at ($ (dns) + (2.25,-.45) $){query type};
+	\node[parser](dnsc) at ($ (dns) + (1,-1.1) $){query class};
+
+	\path[arrow] ($ (eth) + (-1.25,0) $) -- node[left,pos=0]{\texttt{pkt\_in}} (eth);
+
+	\path[arrow] (eth) |- node[label,above left,pos=1]{\texttt{type=0x0800}} (ipv4);
+	\path[arrow] (eth) |- node[label,below left,pos=1]{\texttt{type=0x86DD}} (ipv6);
+	\path[arrow] (ipv4) -| node[label,above right, pos=0]{\texttt{proto=0x17}} (udp);
+	\path[arrow] (ipv6) -| node[label,below right, pos=0]{\texttt{proto=0x17}} (udp);
+	\path[arrow] (udp) -- node[label,above]{\texttt{sport=53}} (dns);
+
+	\path[arrow,dashed] (dns) |- (dnsp);
+	\path[arrow,dashed] (dnsp) -| node[label,above right,pos=0]{\texttt{qd=an=1}} (dnsq);
+	\path[arrow,dashed] (dnsq) -- node[label,right]{\texttt{known log}} (dnst);
+	\path[arrow,dashed] (dnst) |- node[label,below right,pos=1]{\texttt{TXT}} (dnsc);
+	\path[arrow,dashed]
+		(dnsq) edge[out=5, in=355, looseness=8]
+			node[label,right]{
+				\begin{tabular}{c}
+					variable \\
+					length
+				  \end{tabular}
+				}
+		(dnsq);
+	\path[arrow,dashed]
+		(dnsc) --
+			node[label,below right,pos=.8]{\texttt{IN}}
+			node[pos=1.2,rotate=90]{\texttt{clone}}
+		($ (dnsc) + (-1.5,0) $);
+\end{tikzpicture}
+}
-- 
cgit v1.2.3

