ofs | hex dump | ascii |
---|
0000 | d4 c3 b2 a1 02 00 04 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 d8 b2 e9 50 b1 32 04 00 | ...........................P.2.. |
0020 | 30 02 00 00 30 02 00 00 1e 00 00 00 60 00 00 00 02 04 06 40 00 00 00 00 00 00 00 00 00 00 00 00 | 0...0.......`......@............ |
0040 | 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 e5 af 1f 90 08 97 16 66 0a 65 66 ef | ...........................f.ef. |
0060 | 80 18 28 e9 02 0c 00 00 01 01 08 0a 05 c0 8c fc 05 c0 38 8c 47 45 54 20 2f 70 6b 67 2f 67 69 74 | ..(...............8.GET./pkg/git |
0080 | 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 20 48 54 54 50 2f | hub.com/gconnell/gopacket/.HTTP/ |
00a0 | 31 2e 31 0d 0a 48 6f 73 74 3a 20 6c 6f 63 61 6c 68 6f 73 74 3a 38 30 38 30 0d 0a 43 6f 6e 6e 65 | 1.1..Host:.localhost:8080..Conne |
00c0 | 63 74 69 6f 6e 3a 20 6b 65 65 70 2d 61 6c 69 76 65 0d 0a 43 61 63 68 65 2d 43 6f 6e 74 72 6f 6c | ction:.keep-alive..Cache-Control |
00e0 | 3a 20 6d 61 78 2d 61 67 65 3d 30 0d 0a 55 73 65 72 2d 41 67 65 6e 74 3a 20 4d 6f 7a 69 6c 6c 61 | :.max-age=0..User-Agent:.Mozilla |
0100 | 2f 35 2e 30 20 28 4d 61 63 69 6e 74 6f 73 68 3b 20 49 6e 74 65 6c 20 4d 61 63 20 4f 53 20 58 20 | /5.0.(Macintosh;.Intel.Mac.OS.X. |
0120 | 31 30 5f 38 5f 32 29 20 41 70 70 6c 65 57 65 62 4b 69 74 2f 35 33 37 2e 31 31 20 28 4b 48 54 4d | 10_8_2).AppleWebKit/537.11.(KHTM |
0140 | 4c 2c 20 6c 69 6b 65 20 47 65 63 6b 6f 29 20 43 68 72 6f 6d 65 2f 32 33 2e 30 2e 31 32 37 31 2e | L,.like.Gecko).Chrome/23.0.1271. |
0160 | 31 30 31 20 53 61 66 61 72 69 2f 35 33 37 2e 31 31 0d 0a 41 63 63 65 70 74 3a 20 74 65 78 74 2f | 101.Safari/537.11..Accept:.text/ |
0180 | 68 74 6d 6c 2c 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78 68 74 6d 6c 2b 78 6d 6c 2c 61 70 70 6c 69 | html,application/xhtml+xml,appli |
01a0 | 63 61 74 69 6f 6e 2f 78 6d 6c 3b 71 3d 30 2e 39 2c 2a 2f 2a 3b 71 3d 30 2e 38 0d 0a 52 65 66 65 | cation/xml;q=0.9,*/*;q=0.8..Refe |
01c0 | 72 65 72 3a 20 68 74 74 70 3a 2f 2f 6c 6f 63 61 6c 68 6f 73 74 3a 38 30 38 30 2f 70 6b 67 2f 0d | rer:.http://localhost:8080/pkg/. |
01e0 | 0a 41 63 63 65 70 74 2d 45 6e 63 6f 64 69 6e 67 3a 20 67 7a 69 70 2c 64 65 66 6c 61 74 65 2c 73 | .Accept-Encoding:.gzip,deflate,s |
0200 | 64 63 68 0d 0a 41 63 63 65 70 74 2d 4c 61 6e 67 75 61 67 65 3a 20 65 6e 2d 55 53 2c 65 6e 3b 71 | dch..Accept-Language:.en-US,en;q |
0220 | 3d 30 2e 38 0d 0a 41 63 63 65 70 74 2d 43 68 61 72 73 65 74 3a 20 49 53 4f 2d 38 38 35 39 2d 31 | =0.8..Accept-Charset:.ISO-8859-1 |
0240 | 2c 75 74 66 2d 38 3b 71 3d 30 2e 37 2c 2a 3b 71 3d 30 2e 33 0d 0a 0d 0a d8 b2 e9 50 ea 32 04 00 | ,utf-8;q=0.7,*;q=0.3.......P.2.. |
0260 | 4c 00 00 00 4c 00 00 00 1e 00 00 00 60 01 88 91 00 20 06 40 00 00 00 00 00 00 00 00 00 00 00 00 | L...L.......`......@............ |
0280 | 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 1f 90 e5 af 0a 65 66 ef 08 97 18 4a | .........................ef....J |
02a0 | 80 10 23 02 00 28 00 00 01 01 08 0a 05 c0 8c fc 05 c0 8c fc d8 b2 e9 50 5e 0c 07 00 4c 10 00 00 | ..#..(.................P^...L... |
02c0 | 4c 10 00 00 1e 00 00 00 60 01 88 91 10 20 06 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 | L.......`......@................ |
02e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 1f 90 e5 af 0a 65 66 ef 08 97 18 4a 80 18 23 02 | .....................ef....J..#. |
0300 | 10 28 00 00 01 01 08 0a 05 c0 8d b6 05 c0 8c fc 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d | .(..............HTTP/1.1.200.OK. |
0320 | 0a 44 61 74 65 3a 20 53 75 6e 2c 20 30 36 20 4a 61 6e 20 32 30 31 33 20 31 37 3a 32 32 3a 33 32 | .Date:.Sun,.06.Jan.2013.17:22:32 |
0340 | 20 47 4d 54 0d 0a 54 72 61 6e 73 66 65 72 2d 45 6e 63 6f 64 69 6e 67 3a 20 63 68 75 6e 6b 65 64 | .GMT..Transfer-Encoding:.chunked |
0360 | 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 78 74 2f 68 74 6d 6c 3b 20 63 68 61 72 73 | ..Content-Type:.text/html;.chars |
0380 | 65 74 3d 75 74 66 2d 38 0d 0a 0d 0a 32 30 30 0d 0a 3c 21 44 4f 43 54 59 50 45 20 68 74 6d 6c 3e | et=utf-8....200..<!DOCTYPE.html> |
03a0 | 0a 3c 68 74 6d 6c 3e 0a 3c 68 65 61 64 3e 0a 3c 6d 65 74 61 20 68 74 74 70 2d 65 71 75 69 76 3d | .<html>.<head>.<meta.http-equiv= |
03c0 | 22 43 6f 6e 74 65 6e 74 2d 54 79 70 65 22 20 63 6f 6e 74 65 6e 74 3d 22 74 65 78 74 2f 68 74 6d | "Content-Type".content="text/htm |
03e0 | 6c 3b 20 63 68 61 72 73 65 74 3d 75 74 66 2d 38 22 3e 0a 0a 20 20 3c 74 69 74 6c 65 3e 67 6f 70 | l;.charset=utf-8">....<title>gop |
0400 | 61 63 6b 65 74 20 2d 20 54 68 65 20 47 6f 20 50 72 6f 67 72 61 6d 6d 69 6e 67 20 4c 61 6e 67 75 | acket.-.The.Go.Programming.Langu |
0420 | 61 67 65 3c 2f 74 69 74 6c 65 3e 0a 0a 3c 6c 69 6e 6b 20 74 79 70 65 3d 22 74 65 78 74 2f 63 73 | age</title>..<link.type="text/cs |
0440 | 73 22 20 72 65 6c 3d 22 73 74 79 6c 65 73 68 65 65 74 22 20 68 72 65 66 3d 22 2f 64 6f 63 2f 73 | s".rel="stylesheet".href="/doc/s |
0460 | 74 79 6c 65 2e 63 73 73 22 3e 0a 3c 73 63 72 69 70 74 20 74 79 70 65 3d 22 74 65 78 74 2f 6a 61 | tyle.css">.<script.type="text/ja |
0480 | 76 61 73 63 72 69 70 74 22 20 73 72 63 3d 22 2f 64 6f 63 2f 67 6f 64 6f 63 73 2e 6a 73 22 3e 3c | vascript".src="/doc/godocs.js">< |
04a0 | 2f 73 63 72 69 70 74 3e 0a 0a 3c 2f 68 65 61 64 3e 0a 3c 62 6f 64 79 3e 0a 0a 3c 64 69 76 20 69 | /script>..</head>.<body>..<div.i |
04c0 | 64 3d 22 74 6f 70 62 61 72 22 3e 3c 64 69 76 20 63 6c 61 73 73 3d 22 63 6f 6e 74 61 69 6e 65 72 | d="topbar"><div.class="container |
04e0 | 20 77 69 64 65 22 3e 0a 0a 3c 66 6f 72 6d 20 6d 65 74 68 6f 64 3d 22 47 45 54 22 20 61 63 74 69 | .wide">..<form.method="GET".acti |
0500 | 6f 6e 3d 22 2f 73 65 61 72 63 68 22 3e 0a 3c 64 69 76 20 69 64 3d 22 6d 65 6e 75 22 3e 0a 3c 61 | on="/search">.<div.id="menu">.<a |
0520 | 20 68 72 65 66 3d 22 2f 64 6f 63 2f 22 3e 44 6f 63 75 6d 65 6e 74 73 3c 2f 61 3e 0a 3c 61 20 68 | .href="/doc/">Documents</a>.<a.h |
0540 | 72 65 66 3d 22 2f 72 65 66 2f 22 3e 52 65 66 65 72 65 6e 63 65 73 3c 2f 61 3e 0a 3c 61 20 68 72 | ref="/ref/">References</a>.<a.hr |
0560 | 65 66 3d 22 2f 70 6b 67 2f 22 3e 50 61 63 6b 61 67 65 73 3c 2f 61 3e 0a 3c 61 20 68 72 65 66 3d | ef="/pkg/">Packages</a>.<a.href= |
0580 | 22 2f 70 72 6f 6a 65 63 74 2f 22 3e 54 68 65 20 50 0d 0a 64 65 0d 0a 72 6f 6a 65 63 74 3c 2f 61 | "/project/">The.P..de..roject</a |
05a0 | 3e 0a 3c 61 20 68 72 65 66 3d 22 2f 68 65 6c 70 2f 22 3e 48 65 6c 70 3c 2f 61 3e 0a 3c 69 6e 70 | >.<a.href="/help/">Help</a>.<inp |
05c0 | 75 74 20 74 79 70 65 3d 22 74 65 78 74 22 20 69 64 3d 22 73 65 61 72 63 68 22 20 6e 61 6d 65 3d | ut.type="text".id="search".name= |
05e0 | 22 71 22 20 63 6c 61 73 73 3d 22 69 6e 61 63 74 69 76 65 22 20 76 61 6c 75 65 3d 22 53 65 61 72 | "q".class="inactive".value="Sear |
0600 | 63 68 22 3e 0a 3c 2f 64 69 76 3e 0a 3c 64 69 76 20 69 64 3d 22 68 65 61 64 69 6e 67 22 3e 3c 61 | ch">.</div>.<div.id="heading"><a |
0620 | 20 68 72 65 66 3d 22 2f 22 3e 54 68 65 20 47 6f 20 50 72 6f 67 72 61 6d 6d 69 6e 67 20 4c 61 6e | .href="/">The.Go.Programming.Lan |
0640 | 67 75 61 67 65 3c 2f 61 3e 3c 2f 64 69 76 3e 0a 3c 2f 66 6f 72 6d 3e 0a 0a 3c 2f 64 69 76 3e 3c | guage</a></div>.</form>..</div>< |
0660 | 2f 64 69 76 3e 0a 0a 3c 64 69 76 20 69 64 3d 22 70 61 67 65 22 0d 0a 64 0d 0a 20 63 6c 61 73 73 | /div>..<div.id="page"..d...class |
0680 | 3d 22 77 69 64 65 22 0d 0a 33 0d 0a 3e 0a 0a 0d 0a 35 38 0d 0a 0a 20 20 3c 64 69 76 20 69 64 3d | ="wide"..3..>....58.....<div.id= |
06a0 | 22 70 6c 75 73 6f 6e 65 22 3e 3c 67 3a 70 6c 75 73 6f 6e 65 20 73 69 7a 65 3d 22 73 6d 61 6c 6c | "plusone"><g:plusone.size="small |
06c0 | 22 20 61 6e 6e 6f 74 61 74 69 6f 6e 3d 22 6e 6f 6e 65 22 3e 3c 2f 67 3a 70 6c 75 73 6f 6e 65 3e | ".annotation="none"></g:plusone> |
06e0 | 3c 2f 64 69 76 3e 0a 20 20 3c 68 31 3e 0d 0a 31 30 0d 0a 50 61 63 6b 61 67 65 20 67 6f 70 61 63 | </div>...<h1>..10..Package.gopac |
0700 | 6b 65 74 0d 0a 36 0d 0a 3c 2f 68 31 3e 0a 0d 0a 31 0d 0a 0a 0d 0a 32 0d 0a 0a 0a 0d 0a 31 37 0d | ket..6..</h1>...1.....2......17. |
0720 | 0a 0a 3c 64 69 76 20 69 64 3d 22 6e 61 76 22 3e 3c 2f 64 69 76 3e 0a 0a 0d 0a 31 0d 0a 0a 0d 0a | ..<div.id="nav"></div>....1..... |
0740 | 63 65 39 34 0d 0a 3c 21 2d 2d 0a 09 43 6f 70 79 72 69 67 68 74 20 32 30 30 39 20 54 68 65 20 47 | ce94..<!--..Copyright.2009.The.G |
0760 | 6f 20 41 75 74 68 6f 72 73 2e 20 41 6c 6c 20 72 69 67 68 74 73 20 72 65 73 65 72 76 65 64 2e 0a | o.Authors..All.rights.reserved.. |
0780 | 09 55 73 65 20 6f 66 20 74 68 69 73 20 73 6f 75 72 63 65 20 63 6f 64 65 20 69 73 20 67 6f 76 65 | .Use.of.this.source.code.is.gove |
07a0 | 72 6e 65 64 20 62 79 20 61 20 42 53 44 2d 73 74 79 6c 65 0a 09 6c 69 63 65 6e 73 65 20 74 68 61 | rned.by.a.BSD-style..license.tha |
07c0 | 74 20 63 61 6e 20 62 65 20 66 6f 75 6e 64 20 69 6e 20 74 68 65 20 4c 49 43 45 4e 53 45 20 66 69 | t.can.be.found.in.the.LICENSE.fi |
07e0 | 6c 65 2e 0a 2d 2d 3e 0a 3c 21 2d 2d 0a 09 4e 6f 74 65 3a 20 53 74 61 74 69 63 20 28 69 2e 65 2e | le..-->.<!--..Note:.Static.(i.e. |
0800 | 2c 20 6e 6f 74 20 74 65 6d 70 6c 61 74 65 2d 67 65 6e 65 72 61 74 65 64 29 20 68 72 65 66 20 61 | ,.not.template-generated).href.a |
0820 | 6e 64 20 69 64 0a 09 61 74 74 72 69 62 75 74 65 73 20 73 74 61 72 74 20 77 69 74 68 20 22 70 6b | nd.id..attributes.start.with."pk |
0840 | 67 2d 22 20 74 6f 20 6d 61 6b 65 20 69 74 20 69 6d 70 6f 73 73 69 62 6c 65 20 66 6f 72 0a 09 74 | g-".to.make.it.impossible.for..t |
0860 | 68 65 6d 20 74 6f 20 63 6f 6e 66 6c 69 63 74 20 77 69 74 68 20 67 65 6e 65 72 61 74 65 64 20 61 | hem.to.conflict.with.generated.a |
0880 | 74 74 72 69 62 75 74 65 73 20 28 73 6f 6d 65 20 6f 66 20 77 68 69 63 68 0a 09 63 6f 72 72 65 73 | ttributes.(some.of.which..corres |
08a0 | 70 6f 6e 64 20 74 6f 20 47 6f 20 69 64 65 6e 74 69 66 69 65 72 73 29 2e 0a 2d 2d 3e 0a 0a 09 0a | pond.to.Go.identifiers)..-->.... |
08c0 | 09 09 3c 64 69 76 20 69 64 3d 22 73 68 6f 72 74 2d 6e 61 76 22 3e 0a 09 09 09 3c 64 6c 3e 0a 09 | ..<div.id="short-nav">....<dl>.. |
08e0 | 09 09 3c 64 64 3e 3c 63 6f 64 65 3e 69 6d 70 6f 72 74 20 22 67 69 74 68 75 62 2e 63 6f 6d 2f 67 | ..<dd><code>import."github.com/g |
0900 | 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 22 3c 2f 63 6f 64 65 3e 3c 2f 64 64 3e 0a 09 09 | connell/gopacket"</code></dd>... |
0920 | 09 3c 2f 64 6c 3e 0a 09 09 09 3c 64 6c 3e 0a 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 | .</dl>....<dl>....<dd><a.href="# |
0940 | 70 6b 67 2d 6f 76 65 72 76 69 65 77 22 20 63 6c 61 73 73 3d 22 6f 76 65 72 76 69 65 77 4c 69 6e | pkg-overview".class="overviewLin |
0960 | 6b 22 3e 4f 76 65 72 76 69 65 77 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 3c 64 64 3e 3c 61 20 68 | k">Overview</a></dd>....<dd><a.h |
0980 | 72 65 66 3d 22 23 70 6b 67 2d 69 6e 64 65 78 22 3e 49 6e 64 65 78 3c 2f 61 3e 3c 2f 64 64 3e 0a | ref="#pkg-index">Index</a></dd>. |
09a0 | 09 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 70 6b | ................<dd><a.href="#pk |
09c0 | 67 2d 73 75 62 64 69 72 65 63 74 6f 72 69 65 73 22 3e 53 75 62 64 69 72 65 63 74 6f 72 69 65 73 | g-subdirectories">Subdirectories |
09e0 | 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 0a 09 09 09 3c 2f 64 6c 3e 0a 09 09 3c 2f 64 69 76 3e 0a | </a></dd>........</dl>...</div>. |
0a00 | 09 09 3c 21 2d 2d 20 54 68 65 20 70 61 63 6b 61 67 65 27 73 20 4e 61 6d 65 20 69 73 20 70 72 69 | ..<!--.The.package's.Name.is.pri |
0a20 | 6e 74 65 64 20 61 73 20 74 69 74 6c 65 20 62 79 20 74 68 65 20 74 6f 70 2d 6c 65 76 65 6c 20 74 | nted.as.title.by.the.top-level.t |
0a40 | 65 6d 70 6c 61 74 65 20 2d 2d 3e 0a 09 09 3c 64 69 76 20 69 64 3d 22 70 6b 67 2d 6f 76 65 72 76 | emplate.-->...<div.id="pkg-overv |
0a60 | 69 65 77 22 20 63 6c 61 73 73 3d 22 74 6f 67 67 6c 65 56 69 73 69 62 6c 65 22 3e 0a 09 09 09 3c | iew".class="toggleVisible">....< |
0a80 | 64 69 76 20 63 6c 61 73 73 3d 22 63 6f 6c 6c 61 70 73 65 64 22 3e 0a 09 09 09 09 3c 68 32 20 63 | div.class="collapsed">.....<h2.c |
0aa0 | 6c 61 73 73 3d 22 74 6f 67 67 6c 65 42 75 74 74 6f 6e 22 20 74 69 74 6c 65 3d 22 43 6c 69 63 6b | lass="toggleButton".title="Click |
0ac0 | 20 74 6f 20 73 68 6f 77 20 4f 76 65 72 76 69 65 77 20 73 65 63 74 69 6f 6e 22 3e 4f 76 65 72 76 | .to.show.Overview.section">Overv |
0ae0 | 69 65 77 20 e2 96 b9 3c 2f 68 32 3e 0a 09 09 09 3c 2f 64 69 76 3e 0a 09 09 09 3c 64 69 76 20 63 | iew....</h2>....</div>....<div.c |
0b00 | 6c 61 73 73 3d 22 65 78 70 61 6e 64 65 64 22 3e 0a 09 09 09 09 3c 68 32 20 63 6c 61 73 73 3d 22 | lass="expanded">.....<h2.class=" |
0b20 | 74 6f 67 67 6c 65 42 75 74 74 6f 6e 22 20 74 69 74 6c 65 3d 22 43 6c 69 63 6b 20 74 6f 20 68 69 | toggleButton".title="Click.to.hi |
0b40 | 64 65 20 4f 76 65 72 76 69 65 77 20 73 65 63 74 69 6f 6e 22 3e 4f 76 65 72 76 69 65 77 20 e2 96 | de.Overview.section">Overview... |
0b60 | be 3c 2f 68 32 3e 0a 09 09 09 09 3c 70 3e 0a 50 61 63 6b 61 67 65 20 67 6f 70 61 63 6b 65 74 20 | .</h2>.....<p>.Package.gopacket. |
0b80 | 70 72 6f 76 69 64 65 73 20 70 61 63 6b 65 74 20 64 65 63 6f 64 69 6e 67 20 66 6f 72 20 74 68 65 | provides.packet.decoding.for.the |
0ba0 | 20 47 6f 20 6c 61 6e 67 75 61 67 65 2e 0a 3c 2f 70 3e 0a 3c 70 3e 0a 67 6f 70 61 63 6b 65 74 20 | .Go.language..</p>.<p>.gopacket. |
0bc0 | 63 6f 6e 74 61 69 6e 73 20 33 20 73 75 62 2d 70 61 63 6b 61 67 65 73 20 77 69 74 68 20 61 64 64 | contains.3.sub-packages.with.add |
0be0 | 69 74 69 6f 6e 61 6c 20 66 75 6e 63 74 69 6f 6e 61 6c 69 74 79 20 79 6f 75 20 6d 61 79 20 66 69 | itional.functionality.you.may.fi |
0c00 | 6e 64 0a 75 73 65 66 75 6c 3a 0a 3c 2f 70 3e 0a 3c 70 72 65 3e 2a 20 6c 61 79 65 72 73 3a 20 59 | nd.useful:.</p>.<pre>*.layers:.Y |
0c20 | 6f 75 26 23 33 39 3b 6c 6c 20 70 72 6f 62 61 62 6c 79 20 75 73 65 20 74 68 69 73 20 65 76 65 72 | ou'll.probably.use.this.ever |
0c40 | 79 20 74 69 6d 65 2e 20 20 54 68 69 73 20 63 6f 6e 74 61 69 6e 73 20 6f 66 20 74 68 65 20 6c 6f | y.time...This.contains.of.the.lo |
0c60 | 67 69 63 0a 20 20 20 20 62 75 69 6c 74 20 69 6e 74 6f 20 67 6f 70 61 63 6b 65 74 20 66 6f 72 20 | gic.....built.into.gopacket.for. |
0c80 | 64 65 63 6f 64 69 6e 67 20 70 61 63 6b 65 74 20 70 72 6f 74 6f 63 6f 6c 73 2e 20 20 4e 6f 74 65 | decoding.packet.protocols...Note |
0ca0 | 20 74 68 61 74 20 61 6c 6c 20 65 78 61 6d 70 6c 65 0a 20 20 20 20 63 6f 64 65 20 62 65 6c 6f 77 | .that.all.example.....code.below |
0cc0 | 20 61 73 73 75 6d 65 73 20 74 68 61 74 20 79 6f 75 20 68 61 76 65 20 69 6d 70 6f 72 74 65 64 20 | .assumes.that.you.have.imported. |
0ce0 | 62 6f 74 68 20 67 6f 70 61 63 6b 65 74 20 61 6e 64 0a 20 20 20 20 67 6f 70 61 63 6b 65 74 2f 6c | both.gopacket.and.....gopacket/l |
0d00 | 61 79 65 72 73 2e 0a 2a 20 70 63 61 70 3a 20 43 20 62 69 6e 64 69 6e 67 73 20 74 6f 20 75 73 65 | ayers..*.pcap:.C.bindings.to.use |
0d20 | 20 6c 69 62 70 63 61 70 20 74 6f 20 70 75 6c 6c 20 70 61 63 6b 65 74 73 20 6f 66 66 20 74 68 65 | .libpcap.to.pull.packets.off.the |
0d40 | 20 77 69 72 65 2e 0a 2a 20 70 66 72 69 6e 67 3a 20 43 20 62 69 6e 64 69 6e 67 73 20 74 6f 20 75 | .wire..*.pfring:.C.bindings.to.u |
0d60 | 73 65 20 50 46 5f 52 49 4e 47 20 74 6f 20 70 75 6c 6c 20 70 61 63 6b 65 74 73 20 6f 66 66 20 74 | se.PF_RING.to.pull.packets.off.t |
0d80 | 68 65 20 77 69 72 65 2e 0a 3c 2f 70 72 65 3e 0a 3c 68 33 20 69 64 3d 22 42 61 73 69 63 5f 55 73 | he.wire..</pre>.<h3.id="Basic_Us |
0da0 | 61 67 65 22 3e 42 61 73 69 63 20 55 73 61 67 65 3c 2f 68 33 3e 0a 3c 70 3e 0a 67 6f 70 61 63 6b | age">Basic.Usage</h3>.<p>.gopack |
0dc0 | 65 74 20 74 61 6b 65 73 20 69 6e 20 70 61 63 6b 65 74 20 64 61 74 61 20 61 73 20 61 20 5b 5d 62 | et.takes.in.packet.data.as.a.[]b |
0de0 | 79 74 65 20 61 6e 64 20 64 65 63 6f 64 65 73 20 69 74 20 69 6e 74 6f 20 61 20 70 61 63 6b 65 74 | yte.and.decodes.it.into.a.packet |
0e00 | 20 77 69 74 68 0a 61 20 6e 6f 6e 2d 7a 65 72 6f 20 6e 75 6d 62 65 72 20 6f 66 20 26 23 33 34 3b | .with.a.non-zero.number.of." |
0e20 | 6c 61 79 65 72 73 26 23 33 34 3b 2e 20 20 45 61 63 68 20 6c 61 79 65 72 20 63 6f 72 72 65 73 70 | layers"...Each.layer.corresp |
0e40 | 6f 6e 64 73 20 74 6f 20 61 20 70 72 6f 74 6f 63 6f 6c 0a 77 69 74 68 69 6e 20 74 68 65 20 62 79 | onds.to.a.protocol.within.the.by |
0e60 | 74 65 73 2e 20 20 4f 6e 63 65 20 61 20 70 61 63 6b 65 74 20 68 61 73 20 62 65 65 6e 20 64 65 63 | tes...Once.a.packet.has.been.dec |
0e80 | 6f 64 65 64 2c 20 74 68 65 20 6c 61 79 65 72 73 20 6f 66 20 74 68 65 20 70 61 63 6b 65 74 0a 63 | oded,.the.layers.of.the.packet.c |
0ea0 | 61 6e 20 62 65 20 72 65 71 75 65 73 74 65 64 20 66 72 6f 6d 20 74 68 65 20 70 61 63 6b 65 74 2e | an.be.requested.from.the.packet. |
0ec0 | 0a 3c 2f 70 3e 0a 3c 70 72 65 3e 2f 2f 20 44 65 63 6f 64 65 20 61 20 70 61 63 6b 65 74 0a 70 61 | .</p>.<pre>//.Decode.a.packet.pa |
0ee0 | 63 6b 65 74 20 3a 3d 20 67 6f 70 61 63 6b 65 74 2e 4e 65 77 50 61 63 6b 65 74 28 6d 79 50 61 63 | cket.:=.gopacket.NewPacket(myPac |
0f00 | 6b 65 74 44 61 74 61 2c 20 6c 61 79 65 72 73 2e 4c 61 79 65 72 54 79 70 65 45 74 68 65 72 6e 65 | ketData,.layers.LayerTypeEtherne |
0f20 | 74 2c 20 67 6f 70 61 63 6b 65 74 2e 44 65 66 61 75 6c 74 29 0a 2f 2f 20 47 65 74 20 74 68 65 20 | t,.gopacket.Default).//.Get.the. |
0f40 | 54 43 50 20 6c 61 79 65 72 20 66 72 6f 6d 20 74 68 69 73 20 70 61 63 6b 65 74 0a 69 66 20 74 63 | TCP.layer.from.this.packet.if.tc |
0f60 | 70 4c 61 79 65 72 20 3a 3d 20 70 61 63 6b 65 74 2e 4c 61 79 65 72 28 6c 61 79 65 72 73 2e 4c 61 | pLayer.:=.packet.Layer(layers.La |
0f80 | 79 65 72 54 79 70 65 54 43 50 29 3b 20 74 63 70 4c 61 79 65 72 20 21 3d 20 6e 69 6c 20 7b 0a 20 | yerTypeTCP);.tcpLayer.!=.nil.{.. |
0fa0 | 20 66 6d 74 2e 50 72 69 6e 74 6c 6e 28 26 23 33 34 3b 54 68 69 73 20 69 73 20 61 20 54 43 50 20 | .fmt.Println("This.is.a.TCP. |
0fc0 | 70 61 63 6b 65 74 21 26 23 33 34 3b 29 0a 20 20 2f 2f 20 47 65 74 20 61 63 74 75 61 6c 20 54 43 | packet!")...//.Get.actual.TC |
0fe0 | 50 20 64 61 74 61 20 66 72 6f 6d 20 74 68 69 73 20 6c 61 79 65 72 0a 20 20 74 63 70 2c 20 5f 20 | P.data.from.this.layer...tcp,._. |
1000 | 3a 3d 20 74 63 70 4c 61 79 65 72 2e 28 2a 6c 61 79 65 72 73 2e 54 43 50 29 0a 20 20 66 6d 74 2e | :=.tcpLayer.(*layers.TCP)...fmt. |
1020 | 50 72 69 6e 74 66 28 26 23 33 34 3b 46 72 6f 6d 20 73 72 63 20 70 6f 72 74 20 25 64 20 74 6f 20 | Printf("From.src.port.%d.to. |
1040 | 64 73 74 20 70 6f 72 74 20 25 64 5c 6e 26 23 33 34 3b 2c 20 74 63 70 2e 53 72 63 50 6f 72 74 2c | dst.port.%d\n",.tcp.SrcPort, |
1060 | 20 74 63 70 2e 44 73 74 50 6f 72 74 29 0a 7d 0a 2f 2f 20 49 74 65 72 61 74 65 20 6f 76 65 72 20 | .tcp.DstPort).}.//.Iterate.over. |
1080 | 61 6c 6c 20 6c 61 79 65 72 73 2c 20 70 72 69 6e 74 69 6e 67 20 6f 75 74 20 65 61 63 68 20 6c 61 | all.layers,.printing.out.each.la |
10a0 | 79 65 72 20 74 79 70 65 0a 66 6f 72 20 6c 61 79 65 72 20 3a 3d 20 72 61 6e 67 65 20 70 61 63 6b | yer.type.for.layer.:=.range.pack |
10c0 | 65 74 2e 4c 61 79 65 72 73 28 29 20 7b 0a 20 20 66 6d 74 2e 50 72 69 6e 74 6c 6e 28 26 23 33 34 | et.Layers().{...fmt.Println(" |
10e0 | 3b 50 41 43 4b 45 54 20 4c 41 59 45 52 3a 26 23 33 34 3b 2c 20 6c 61 79 65 72 2e 4c 61 79 65 72 | ;PACKET.LAYER:",.layer.Layer |
1100 | 54 79 70 65 28 29 29 0a 7d 0a 3c 2f 70 72 65 3e 0a 3c 70 3e 0a 50 61 63 6b 65 74 73 20 63 61 6e | Type()).}.</pre>.<p>.Packets.can |
1120 | 20 62 65 20 64 65 63 6f 64 65 64 20 66 72 6f 6d 20 61 20 6e 75 6d 62 65 72 20 6f 66 20 73 74 61 | .be.decoded.from.a.number.of.sta |
1140 | 72 74 69 6e 67 20 70 6f 69 6e 74 73 2e 20 20 4d 61 6e 79 20 6f 66 20 6f 75 72 20 62 61 73 65 0a | rting.points...Many.of.our.base. |
1160 | 74 79 70 65 73 20 69 6d 70 6c 65 6d 65 6e 74 20 44 65 63 6f 64 65 72 2c 20 77 68 69 63 68 20 61 | types.implement.Decoder,.which.a |
1180 | 6c 6c 6f 77 20 75 73 20 74 6f 20 64 65 63 6f 64 65 20 70 61 63 6b 65 74 73 20 66 6f 72 20 77 68 | llow.us.to.decode.packets.for.wh |
11a0 | 69 63 68 0a 77 65 20 64 6f 6e 26 23 33 39 3b 74 20 68 61 76 65 20 66 75 6c 6c 20 64 61 74 61 2e | ich.we.don't.have.full.data. |
11c0 | 0a 3c 2f 70 3e 0a 3c 70 72 65 3e 2f 2f 20 44 65 63 6f 64 65 20 61 6e 20 65 74 68 65 72 6e 65 74 | .</p>.<pre>//.Decode.an.ethernet |
11e0 | 20 70 61 63 6b 65 74 0a 65 74 68 50 20 3a 3d 20 67 6f 70 61 63 6b 65 74 2e 4e 65 77 50 61 63 6b | .packet.ethP.:=.gopacket.NewPack |
1200 | 65 74 28 70 31 2c 20 6c 61 79 65 72 73 2e 4c 61 79 65 72 54 79 70 65 45 74 68 65 72 6e 65 74 2c | et(p1,.layers.LayerTypeEthernet, |
1220 | 20 67 6f 70 61 63 6b 65 74 2e 44 65 66 61 75 6c 74 29 0a 2f 2f 20 44 65 63 6f 64 65 20 61 6e 20 | .gopacket.Default).//.Decode.an. |
1240 | 49 50 76 36 20 68 65 61 64 65 72 20 61 6e 64 20 65 76 65 72 79 74 68 69 6e 67 20 69 74 20 63 6f | IPv6.header.and.everything.it.co |
1260 | 6e 74 61 69 6e 73 0a 69 70 50 20 3a 3d 20 67 6f 70 61 63 6b 65 74 2e 4e 65 77 50 61 63 6b 65 74 | ntains.ipP.:=.gopacket.NewPacket |
1280 | 28 70 32 2c 20 6c 61 79 65 72 73 2e 4c 61 79 65 72 54 79 70 65 49 50 76 36 2c 20 67 6f 70 61 63 | (p2,.layers.LayerTypeIPv6,.gopac |
12a0 | 6b 65 74 2e 44 65 66 61 75 6c 74 29 0a 2f 2f 20 44 65 63 6f 64 65 20 61 20 54 43 50 20 68 65 61 | ket.Default).//.Decode.a.TCP.hea |
12c0 | 64 65 72 20 61 6e 64 20 69 74 73 20 70 61 79 6c 6f 61 64 0a 74 63 70 50 20 3a 3d 20 67 6f 70 61 | der.and.its.payload.tcpP.:=.gopa |
12e0 | 63 6b 65 74 2e 4e 65 77 50 61 63 6b 65 74 28 70 33 2c 20 6c 61 79 65 72 73 2e 4c 61 79 65 72 54 | cket.NewPacket(p3,.layers.LayerT |
1300 | 79 70 65 54 43 50 2c 20 67 6f 70 61 63 6b 65 74 d8 b2 e9 50 80 0c 07 00 04 40 00 00 04 40 00 00 | ypeTCP,.gopacket...P.....@...@.. |
1320 | 1e 00 00 00 60 01 88 91 3f d8 06 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 | ....`...?..@.................... |
1340 | 00 00 00 00 00 00 00 00 00 00 00 01 1f 90 e5 af 0a 65 76 ef 08 97 18 4a 80 10 23 02 3f e0 00 00 | .................ev....J..#.?... |
1360 | 01 01 08 0a 05 c0 8d b6 05 c0 8c fc 2e 44 65 66 61 75 6c 74 29 0a 3c 2f 70 72 65 3e 0a 3c 68 33 | .............Default).</pre>.<h3 |
1380 | 20 69 64 3d 22 52 65 61 64 69 6e 67 5f 50 61 63 6b 65 74 73 5f 46 72 6f 6d 5f 41 5f 53 6f 75 72 | .id="Reading_Packets_From_A_Sour |
13a0 | 63 65 22 3e 52 65 61 64 69 6e 67 20 50 61 63 6b 65 74 73 20 46 72 6f 6d 20 41 20 53 6f 75 72 63 | ce">Reading.Packets.From.A.Sourc |
13c0 | 65 3c 2f 68 33 3e 0a 3c 70 3e 0a 4d 6f 73 74 20 6f 66 20 74 68 65 20 74 69 6d 65 2c 20 79 6f 75 | e</h3>.<p>.Most.of.the.time,.you |
13e0 | 20 77 6f 6e 26 23 33 39 3b 74 20 6a 75 73 74 20 68 61 76 65 20 61 20 5b 5d 62 79 74 65 20 6f 66 | .won't.just.have.a.[]byte.of |
1400 | 20 70 61 63 6b 65 74 20 64 61 74 61 20 6c 79 69 6e 67 20 61 72 6f 75 6e 64 2e 0a 49 6e 73 74 65 | .packet.data.lying.around..Inste |
1420 | 61 64 2c 20 79 6f 75 26 23 33 39 3b 6c 6c 20 77 61 6e 74 20 74 6f 20 72 65 61 64 20 70 61 63 6b | ad,.you'll.want.to.read.pack |
1440 | 65 74 73 20 69 6e 20 66 72 6f 6d 20 73 6f 6d 65 77 68 65 72 65 20 28 66 69 6c 65 2c 20 69 6e 74 | ets.in.from.somewhere.(file,.int |
1460 | 65 72 66 61 63 65 2c 20 65 74 63 29 0a 61 6e 64 20 70 72 6f 63 65 73 73 20 74 68 65 6d 2e 20 20 | erface,.etc).and.process.them... |
1480 | 54 6f 20 64 6f 20 74 68 61 74 2c 20 79 6f 75 26 23 33 39 3b 6c 6c 20 77 61 6e 74 20 74 6f 20 62 | To.do.that,.you'll.want.to.b |
14a0 | 75 69 6c 64 20 61 20 50 61 63 6b 65 74 53 6f 75 72 63 65 2e 0a 3c 2f 70 3e 0a 3c 70 3e 0a 46 69 | uild.a.PacketSource..</p>.<p>.Fi |
14c0 | 72 73 74 2c 20 79 6f 75 26 23 33 39 3b 6c 6c 20 6e 65 65 64 20 74 6f 20 63 6f 6e 73 74 72 75 63 | rst,.you'll.need.to.construc |
14e0 | 74 20 61 6e 20 6f 62 6a 65 63 74 20 74 68 61 74 20 69 6d 70 6c 65 6d 65 6e 74 73 20 74 68 65 20 | t.an.object.that.implements.the. |
1500 | 50 61 63 6b 65 74 44 61 74 61 53 6f 75 72 63 65 0a 69 6e 74 65 72 66 61 63 65 2e 20 20 54 68 65 | PacketDataSource.interface...The |
1520 | 72 65 20 61 72 65 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 20 6f 66 20 74 68 69 73 20 69 | re.are.implementations.of.this.i |
1540 | 6e 74 65 72 66 61 63 65 20 62 75 6e 64 6c 65 64 20 77 69 74 68 20 67 6f 70 61 63 6b 65 74 0a 69 | nterface.bundled.with.gopacket.i |
1560 | 6e 20 74 68 65 20 67 6f 70 61 63 6b 65 74 2f 70 63 61 70 20 61 6e 64 20 67 6f 70 61 63 6b 65 74 | n.the.gopacket/pcap.and.gopacket |
1580 | 2f 70 66 72 69 6e 67 20 73 75 62 70 61 63 6b 61 67 65 73 2e 2e 2e 20 73 65 65 20 74 68 65 69 72 | /pfring.subpackages....see.their |
15a0 | 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 0a 66 6f 72 20 6d 6f 72 65 20 69 6e 66 6f 72 6d 61 74 | .documentation.for.more.informat |
15c0 | 69 6f 6e 20 6f 6e 20 74 68 65 69 72 20 75 73 61 67 65 2e 20 20 4f 6e 63 65 20 79 6f 75 20 68 61 | ion.on.their.usage...Once.you.ha |
15e0 | 76 65 20 61 20 50 61 63 6b 65 74 44 61 74 61 53 6f 75 72 63 65 2c 20 79 6f 75 20 63 61 6e 0a 70 | ve.a.PacketDataSource,.you.can.p |
1600 | 61 73 73 20 69 74 20 69 6e 74 6f 20 4e 65 77 50 61 63 6b 65 74 53 6f 75 72 63 65 2c 20 61 6c 6f | ass.it.into.NewPacketSource,.alo |
1620 | 6e 67 20 77 69 74 68 20 61 20 44 65 63 6f 64 65 72 20 6f 66 20 79 6f 75 72 20 63 68 6f 69 63 65 | ng.with.a.Decoder.of.your.choice |
1640 | 2c 20 74 6f 20 63 72 65 61 74 65 0a 61 20 50 61 63 6b 65 74 53 6f 75 72 63 65 2e 0a 3c 2f 70 3e | ,.to.create.a.PacketSource..</p> |
1660 | 0a 3c 70 3e 0a 4f 6e 63 65 20 79 6f 75 20 68 61 76 65 20 61 20 50 61 63 6b 65 74 53 6f 75 72 63 | .<p>.Once.you.have.a.PacketSourc |
1680 | 65 2c 20 79 6f 75 20 63 61 6e 20 72 65 61 64 20 70 61 63 6b 65 74 73 20 66 72 6f 6d 20 69 74 20 | e,.you.can.read.packets.from.it. |
16a0 | 69 6e 20 6d 75 6c 74 69 70 6c 65 20 77 61 79 73 2e 0a 53 65 65 20 74 68 65 20 64 6f 63 73 20 66 | in.multiple.ways..See.the.docs.f |
16c0 | 6f 72 20 50 61 63 6b 65 74 53 6f 75 72 63 65 20 66 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 | or.PacketSource.for.more.details |
16e0 | 2e 20 20 54 68 65 20 65 61 73 69 65 73 74 20 6d 65 74 68 6f 64 20 69 73 20 74 68 65 0a 50 61 63 | ...The.easiest.method.is.the.Pac |
1700 | 6b 65 74 73 20 66 75 6e 63 74 69 6f 6e 2c 20 77 68 69 63 68 20 72 65 74 75 72 6e 73 20 61 20 63 | kets.function,.which.returns.a.c |
1720 | 68 61 6e 6e 65 6c 2c 20 74 68 65 6e 20 61 73 79 6e 63 68 72 6f 6e 6f 75 73 6c 79 20 77 72 69 74 | hannel,.then.asynchronously.writ |
1740 | 65 73 20 6e 65 77 0a 70 61 63 6b 65 74 73 20 69 6e 74 6f 20 74 68 61 74 20 63 68 61 6e 6e 65 6c | es.new.packets.into.that.channel |
1760 | 2c 20 63 6c 6f 73 69 6e 67 20 74 68 65 20 63 68 61 6e 6e 65 6c 20 69 66 20 74 68 65 20 70 61 63 | ,.closing.the.channel.if.the.pac |
1780 | 6b 65 74 53 6f 75 72 63 65 20 68 69 74 73 20 61 6e 0a 65 6e 64 2d 6f 66 2d 66 69 6c 65 2e 0a 3c | ketSource.hits.an.end-of-file..< |
17a0 | 2f 70 3e 0a 3c 70 72 65 3e 70 61 63 6b 65 74 53 6f 75 72 63 65 20 3a 3d 20 2e 2e 2e 20 20 2f 2f | /p>.<pre>packetSource.:=......// |
17c0 | 20 63 6f 6e 73 74 72 75 63 74 20 75 73 69 6e 67 20 70 63 61 70 20 6f 72 20 70 66 72 69 6e 67 0a | .construct.using.pcap.or.pfring. |
17e0 | 66 6f 72 20 70 61 63 6b 65 74 20 3a 3d 20 72 61 6e 67 65 20 70 61 63 6b 65 74 53 6f 75 72 63 65 | for.packet.:=.range.packetSource |
1800 | 2e 50 61 63 6b 65 74 73 28 29 20 7b 0a 20 20 68 61 6e 64 6c 65 50 61 63 6b 65 74 28 70 61 63 6b | .Packets().{...handlePacket(pack |
1820 | 65 74 29 20 20 2f 2f 20 64 6f 20 73 6f 6d 65 74 68 69 6e 67 20 77 69 74 68 20 65 61 63 68 20 70 | et)..//.do.something.with.each.p |
1840 | 61 63 6b 65 74 0a 7d 0a 3c 2f 70 72 65 3e 0a 3c 70 3e 0a 59 6f 75 20 63 61 6e 20 63 68 61 6e 67 | acket.}.</pre>.<p>.You.can.chang |
1860 | 65 20 74 68 65 20 64 65 63 6f 64 69 6e 67 20 6f 70 74 69 6f 6e 73 20 6f 66 20 74 68 65 20 70 61 | e.the.decoding.options.of.the.pa |
1880 | 63 6b 65 74 53 6f 75 72 63 65 20 62 79 20 73 65 74 74 69 6e 67 20 66 69 65 6c 64 73 20 69 6e 0a | cketSource.by.setting.fields.in. |
18a0 | 70 61 63 6b 65 74 53 6f 75 72 63 65 2e 44 65 63 6f 64 65 4f 70 74 69 6f 6e 73 2e 2e 2e 20 73 65 | packetSource.DecodeOptions....se |
18c0 | 65 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 73 65 63 74 69 6f 6e 73 20 66 6f 72 20 6d 6f 72 | e.the.following.sections.for.mor |
18e0 | 65 20 64 65 74 61 69 6c 73 2e 0a 3c 2f 70 3e 0a 3c 68 33 20 69 64 3d 22 4c 61 7a 79 5f 44 65 63 | e.details..</p>.<h3.id="Lazy_Dec |
1900 | 6f 64 69 6e 67 22 3e 4c 61 7a 79 20 44 65 63 6f 64 69 6e 67 3c 2f 68 33 3e 0a 3c 70 3e 0a 67 6f | oding">Lazy.Decoding</h3>.<p>.go |
1920 | 70 61 63 6b 65 74 20 6f 70 74 69 6f 6e 61 6c 6c 79 20 64 65 63 6f 64 65 73 20 70 61 63 6b 65 74 | packet.optionally.decodes.packet |
1940 | 20 64 61 74 61 20 6c 61 7a 69 6c 79 2c 20 6d 65 61 6e 69 6e 67 20 69 74 0a 6f 6e 6c 79 20 64 65 | .data.lazily,.meaning.it.only.de |
1960 | 63 6f 64 65 73 20 61 20 70 61 63 6b 65 74 20 6c 61 79 65 72 20 77 68 65 6e 20 69 74 20 6e 65 65 | codes.a.packet.layer.when.it.nee |
1980 | 64 73 20 74 6f 20 74 6f 20 68 61 6e 64 6c 65 20 61 20 66 75 6e 63 74 69 6f 6e 20 63 61 6c 6c 2e | ds.to.to.handle.a.function.call. |
19a0 | 0a 3c 2f 70 3e 0a 3c 70 72 65 3e 2f 2f 20 43 72 65 61 74 65 20 61 20 70 61 63 6b 65 74 2c 20 62 | .</p>.<pre>//.Create.a.packet,.b |
19c0 | 75 74 20 64 6f 6e 26 23 33 39 3b 74 20 61 63 74 75 61 6c 6c 79 20 64 65 63 6f 64 65 20 61 6e 79 | ut.don't.actually.decode.any |
19e0 | 74 68 69 6e 67 20 79 65 74 0a 70 61 63 6b 65 74 20 3a 3d 20 67 6f 70 61 63 6b 65 74 2e 4e 65 77 | thing.yet.packet.:=.gopacket.New |
1a00 | 50 61 63 6b 65 74 28 6d 79 50 61 63 6b 65 74 44 61 74 61 2c 20 6c 61 79 65 72 73 2e 4c 61 79 65 | Packet(myPacketData,.layers.Laye |
1a20 | 72 54 79 70 65 45 74 68 65 72 6e 65 74 2c 20 67 6f 70 61 63 6b 65 74 2e 4c 61 7a 79 29 0a 2f 2f | rTypeEthernet,.gopacket.Lazy).// |
1a40 | 20 4e 6f 77 2c 20 64 65 63 6f 64 65 20 74 68 65 20 70 61 63 6b 65 74 20 75 70 20 74 6f 20 74 68 | .Now,.decode.the.packet.up.to.th |
1a60 | 65 20 66 69 72 73 74 20 49 50 76 34 20 6c 61 79 65 72 20 66 6f 75 6e 64 20 62 75 74 20 6e 6f 20 | e.first.IPv4.layer.found.but.no. |
1a80 | 66 75 72 74 68 65 72 2e 0a 2f 2f 20 49 66 20 6e 6f 20 49 50 76 34 20 6c 61 79 65 72 20 77 61 73 | further..//.If.no.IPv4.layer.was |
1aa0 | 20 66 6f 75 6e 64 2c 20 74 68 65 20 77 68 6f 6c 65 20 70 61 63 6b 65 74 20 77 69 6c 6c 20 62 65 | .found,.the.whole.packet.will.be |
1ac0 | 20 64 65 63 6f 64 65 64 20 6c 6f 6f 6b 69 6e 67 20 66 6f 72 0a 2f 2f 20 69 74 2e 0a 69 70 34 20 | .decoded.looking.for.//.it..ip4. |
1ae0 | 3a 3d 20 70 61 63 6b 65 74 2e 4c 61 79 65 72 28 6c 61 79 65 72 73 2e 4c 61 79 65 72 54 79 70 65 | :=.packet.Layer(layers.LayerType |
1b00 | 49 50 76 34 29 0a 2f 2f 20 44 65 63 6f 64 65 20 61 6c 6c 20 6c 61 79 65 72 73 20 61 6e 64 20 72 | IPv4).//.Decode.all.layers.and.r |
1b20 | 65 74 75 72 6e 20 74 68 65 6d 2e 20 20 54 68 65 20 6c 61 79 65 72 73 20 75 70 20 74 6f 20 74 68 | eturn.them...The.layers.up.to.th |
1b40 | 65 20 66 69 72 73 74 20 49 50 76 34 20 6c 61 79 65 72 0a 2f 2f 20 61 72 65 20 61 6c 72 65 61 64 | e.first.IPv4.layer.//.are.alread |
1b60 | 79 20 64 65 63 6f 64 65 64 2c 20 61 6e 64 20 77 69 6c 6c 20 6e 6f 74 20 72 65 71 75 69 72 65 20 | y.decoded,.and.will.not.require. |
1b80 | 64 65 63 6f 64 69 6e 67 20 61 20 73 65 63 6f 6e 64 20 74 69 6d 65 2e 0a 6c 61 79 65 72 73 20 3a | decoding.a.second.time..layers.: |
1ba0 | 3d 20 70 61 63 6b 65 74 2e 4c 61 79 65 72 73 28 29 0a 3c 2f 70 72 65 3e 0a 3c 70 3e 0a 4c 61 7a | =.packet.Layers().</pre>.<p>.Laz |
1bc0 | 69 6c 79 2d 64 65 63 6f 64 65 64 20 70 61 63 6b 65 74 73 20 61 72 65 20 6e 6f 74 20 63 6f 6e 63 | ily-decoded.packets.are.not.conc |
1be0 | 75 72 72 65 6e 63 79 2d 73 61 66 65 2e 20 20 53 69 6e 63 65 20 6c 61 79 65 72 73 20 68 61 76 65 | urrency-safe...Since.layers.have |
1c00 | 20 6e 6f 74 20 61 6c 6c 20 62 65 65 6e 0a 64 65 63 6f 64 65 64 2c 20 65 61 63 68 20 63 61 6c 6c | .not.all.been.decoded,.each.call |
1c20 | 20 74 6f 20 4c 61 79 65 72 28 29 20 6f 72 20 4c 61 79 65 72 73 28 29 20 68 61 73 20 74 68 65 20 | .to.Layer().or.Layers().has.the. |
1c40 | 70 6f 74 65 6e 74 69 61 6c 20 74 6f 20 6d 75 74 61 74 65 20 74 68 65 20 70 61 63 6b 65 74 0a 69 | potential.to.mutate.the.packet.i |
1c60 | 6e 20 6f 72 64 65 72 20 74 6f 20 64 65 63 6f 64 65 20 74 68 65 20 6e 65 78 74 20 6c 61 79 65 72 | n.order.to.decode.the.next.layer |
1c80 | 2e 20 20 49 66 20 61 20 70 61 63 6b 65 74 20 69 73 20 75 73 65 64 0a 69 6e 20 6d 75 6c 74 69 70 | ...If.a.packet.is.used.in.multip |
1ca0 | 6c 65 20 67 6f 72 6f 75 74 69 6e 65 73 20 63 6f 6e 63 75 72 72 65 6e 74 6c 79 2c 20 64 6f 6e 26 | le.goroutines.concurrently,.don& |
1cc0 | 23 33 39 3b 74 20 75 73 65 20 67 6f 70 61 63 6b 65 74 2e 4c 61 7a 79 2e 20 20 54 68 65 6e 20 67 | #39;t.use.gopacket.Lazy...Then.g |
1ce0 | 6f 70 61 63 6b 65 74 0a 77 69 6c 6c 20 64 65 63 6f 64 65 20 74 68 65 20 70 61 63 6b 65 74 20 66 | opacket.will.decode.the.packet.f |
1d00 | 75 6c 6c 79 2c 20 61 6e 64 20 61 6c 6c 20 66 75 74 75 72 65 20 66 75 6e 63 74 69 6f 6e 20 63 61 | ully,.and.all.future.function.ca |
1d20 | 6c 6c 73 20 77 6f 6e 26 23 33 39 3b 74 20 6d 75 74 61 74 65 20 74 68 65 0a 6f 62 6a 65 63 74 2e | lls.won't.mutate.the.object. |
1d40 | 0a 3c 2f 70 3e 0a 3c 68 33 20 69 64 3d 22 4e 6f 43 6f 70 79 5f 44 65 63 6f 64 69 6e 67 22 3e 4e | .</p>.<h3.id="NoCopy_Decoding">N |
1d60 | 6f 43 6f 70 79 20 44 65 63 6f 64 69 6e 67 3c 2f 68 33 3e 0a 3c 70 3e 0a 42 79 20 64 65 66 61 75 | oCopy.Decoding</h3>.<p>.By.defau |
1d80 | 6c 74 2c 20 67 6f 70 61 63 6b 65 74 20 77 69 6c 6c 20 63 6f 70 79 20 74 68 65 20 73 6c 69 63 65 | lt,.gopacket.will.copy.the.slice |
1da0 | 20 70 61 73 73 65 64 20 74 6f 20 4e 65 77 50 61 63 6b 65 74 20 61 6e 64 20 73 74 6f 72 65 20 74 | .passed.to.NewPacket.and.store.t |
1dc0 | 68 65 0a 63 6f 70 79 20 77 69 74 68 69 6e 20 74 68 65 20 70 61 63 6b 65 74 2c 20 73 6f 20 66 75 | he.copy.within.the.packet,.so.fu |
1de0 | 74 75 72 65 20 6d 75 74 61 74 69 6f 6e 73 20 74 6f 20 74 68 65 20 62 79 74 65 73 20 75 6e 64 65 | ture.mutations.to.the.bytes.unde |
1e00 | 72 6c 79 69 6e 67 20 74 68 65 20 73 6c 69 63 65 0a 64 6f 6e 26 23 33 39 3b 74 20 61 66 66 65 63 | rlying.the.slice.don't.affec |
1e20 | 74 20 74 68 65 20 70 61 63 6b 65 74 20 61 6e 64 20 69 74 73 20 6c 61 79 65 72 73 2e 20 20 49 66 | t.the.packet.and.its.layers...If |
1e40 | 20 79 6f 75 20 63 61 6e 20 67 75 61 72 61 6e 74 65 65 20 74 68 61 74 20 74 68 65 0a 75 6e 64 65 | .you.can.guarantee.that.the.unde |
1e60 | 72 6c 79 69 6e 67 20 73 6c 69 63 65 20 62 79 74 65 73 20 77 6f 6e 26 23 33 39 3b 74 20 62 65 20 | rlying.slice.bytes.won't.be. |
1e80 | 63 68 61 6e 67 65 64 2c 20 79 6f 75 20 63 61 6e 20 75 73 65 20 4e 6f 43 6f 70 79 20 74 6f 20 74 | changed,.you.can.use.NoCopy.to.t |
1ea0 | 65 6c 6c 0a 67 6f 70 61 63 6b 65 74 2e 4e 65 77 50 61 63 6b 65 74 2c 20 61 6e 64 20 69 74 26 23 | ell.gopacket.NewPacket,.and.it&# |
1ec0 | 33 39 3b 6c 6c 20 75 73 65 20 74 68 65 20 70 61 73 73 65 64 2d 69 6e 20 73 6c 69 63 65 20 69 74 | 39;ll.use.the.passed-in.slice.it |
1ee0 | 73 65 6c 66 2e 0a 3c 2f 70 3e 0a 3c 70 72 65 3e 2f 2f 20 54 68 69 73 20 63 68 61 6e 6e 65 6c 20 | self..</p>.<pre>//.This.channel. |
1f00 | 72 65 74 75 72 6e 73 20 6e 65 77 20 62 79 74 65 20 73 6c 69 63 65 73 2c 20 65 61 63 68 20 6f 66 | returns.new.byte.slices,.each.of |
1f20 | 20 77 68 69 63 68 20 70 6f 69 6e 74 73 20 74 6f 20 61 20 6e 65 77 0a 2f 2f 20 6d 65 6d 6f 72 79 | .which.points.to.a.new.//.memory |
1f40 | 20 6c 6f 63 61 74 69 6f 6e 20 74 68 61 74 26 23 33 39 3b 73 20 67 75 61 72 61 6e 74 65 65 64 20 | .location.that's.guaranteed. |
1f60 | 69 6d 6d 75 74 61 62 6c 65 20 66 6f 72 20 74 68 65 20 64 75 72 61 74 69 6f 6e 20 6f 66 20 74 68 | immutable.for.the.duration.of.th |
1f80 | 65 0a 2f 2f 20 70 61 63 6b 65 74 2e 0a 66 6f 72 20 64 61 74 61 20 3a 3d 20 72 61 6e 67 65 20 6d | e.//.packet..for.data.:=.range.m |
1fa0 | 79 42 79 74 65 53 6c 69 63 65 43 68 61 6e 6e 65 6c 20 7b 0a 20 20 70 20 3a 3d 20 67 6f 70 61 63 | yByteSliceChannel.{...p.:=.gopac |
1fc0 | 6b 65 74 2e 4e 65 77 50 61 63 6b 65 74 28 64 61 74 61 2c 20 6c 61 79 65 72 73 2e 4c 61 79 65 72 | ket.NewPacket(data,.layers.Layer |
1fe0 | 54 79 70 65 45 74 68 65 72 6e 65 74 2c 20 67 6f 70 61 63 6b 65 74 2e 4e 6f 43 6f 70 79 29 0a 20 | TypeEthernet,.gopacket.NoCopy).. |
2000 | 20 64 6f 53 6f 6d 65 74 68 69 6e 67 57 69 74 68 50 61 63 6b 65 74 28 70 29 0a 7d 0a 3c 2f 70 72 | .doSomethingWithPacket(p).}.</pr |
2020 | 65 3e 0a 3c 70 3e 0a 54 68 65 20 66 61 73 74 65 73 74 20 6d 65 74 68 6f 64 20 6f 66 20 64 65 63 | e>.<p>.The.fastest.method.of.dec |
2040 | 6f 64 69 6e 67 20 69 73 20 74 6f 20 75 73 65 20 62 6f 74 68 20 4c 61 7a 79 20 61 6e 64 20 4e 6f | oding.is.to.use.both.Lazy.and.No |
2060 | 43 6f 70 79 2c 20 62 75 74 20 6e 6f 74 65 20 66 72 6f 6d 0a 74 68 65 20 6d 61 6e 79 20 63 61 76 | Copy,.but.note.from.the.many.cav |
2080 | 65 61 74 73 20 61 62 6f 76 65 20 74 68 61 74 20 66 6f 72 20 73 6f 6d 65 20 69 6d 70 6c 65 6d 65 | eats.above.that.for.some.impleme |
20a0 | 6e 74 61 74 69 6f 6e 73 20 74 68 65 79 20 6d 61 79 20 62 65 20 64 61 6e 67 65 72 6f 75 73 0a 65 | ntations.they.may.be.dangerous.e |
20c0 | 69 74 68 65 72 20 6f 72 20 62 6f 74 68 20 6d 61 79 20 62 65 20 64 61 6e 67 65 72 6f 75 73 2e 0a | ither.or.both.may.be.dangerous.. |
20e0 | 3c 2f 70 3e 0a 3c 68 33 20 69 64 3d 22 50 6f 69 6e 74 65 72 73 5f 54 6f 5f 4b 6e 6f 77 6e 5f 4c | </p>.<h3.id="Pointers_To_Known_L |
2100 | 61 79 65 72 73 22 3e 50 6f 69 6e 74 65 72 73 20 54 6f 20 4b 6e 6f 77 6e 20 4c 61 79 65 72 73 3c | ayers">Pointers.To.Known.Layers< |
2120 | 2f 68 33 3e 0a 3c 70 3e 0a 44 75 72 69 6e 67 20 64 65 63 6f 64 69 6e 67 2c 20 63 65 72 74 61 69 | /h3>.<p>.During.decoding,.certai |
2140 | 6e 20 6c 61 79 65 72 73 20 61 72 65 20 73 74 6f 72 65 64 20 69 6e 20 74 68 65 20 70 61 63 6b 65 | n.layers.are.stored.in.the.packe |
2160 | 74 20 61 73 20 77 65 6c 6c 2d 6b 6e 6f 77 6e 0a 6c 61 79 65 72 20 74 79 70 65 73 2e 20 20 46 6f | t.as.well-known.layer.types...Fo |
2180 | 72 20 65 78 61 6d 70 6c 65 2c 20 49 50 76 34 20 61 6e 64 20 49 50 76 36 20 61 72 65 20 62 6f 74 | r.example,.IPv4.and.IPv6.are.bot |
21a0 | 68 20 63 6f 6e 73 69 64 65 72 65 64 20 4e 65 74 77 6f 72 6b 4c 61 79 65 72 0a 6c 61 79 65 72 73 | h.considered.NetworkLayer.layers |
21c0 | 2c 20 77 68 69 6c 65 20 54 43 50 20 61 6e 64 20 55 44 50 20 61 72 65 20 62 6f 74 68 20 54 72 61 | ,.while.TCP.and.UDP.are.both.Tra |
21e0 | 6e 73 70 6f 72 74 4c 61 79 65 72 20 6c 61 79 65 72 73 2e 20 20 57 65 20 73 75 70 70 6f 72 74 20 | nsportLayer.layers...We.support. |
2200 | 34 0a 6c 61 79 65 72 73 2c 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 74 68 65 20 34 | 4.layers,.corresponding.to.the.4 |
2220 | 20 6c 61 79 65 72 73 20 6f 66 20 74 68 65 20 54 43 50 2f 49 50 20 6c 61 79 65 72 69 6e 67 20 73 | .layers.of.the.TCP/IP.layering.s |
2240 | 63 68 65 6d 65 20 28 72 6f 75 67 68 6c 79 0a 61 6e 61 67 61 6c 6f 75 73 20 74 6f 20 6c 61 79 65 | cheme.(roughly.anagalous.to.laye |
2260 | 72 73 20 32 2c 20 33 2c 20 34 2c 20 61 6e 64 20 37 20 6f 66 20 74 68 65 20 4f 53 49 20 6d 6f 64 | rs.2,.3,.4,.and.7.of.the.OSI.mod |
2280 | 65 6c 29 2e 20 20 54 6f 20 61 63 63 65 73 73 20 74 68 65 73 65 2c 0a 79 6f 75 20 63 61 6e 20 75 | el)...To.access.these,.you.can.u |
22a0 | 73 65 20 74 68 65 20 70 61 63 6b 65 74 2e 4c 69 6e 6b 4c 61 79 65 72 2c 20 70 61 63 6b 65 74 2e | se.the.packet.LinkLayer,.packet. |
22c0 | 4e 65 74 77 6f 72 6b 4c 61 79 65 72 2c 0a 70 61 63 6b 65 74 2e 54 72 61 6e 73 70 6f 72 74 4c 61 | NetworkLayer,.packet.TransportLa |
22e0 | 79 65 72 2c 20 61 6e 64 20 70 61 63 6b 65 74 2e 41 70 70 6c 69 63 61 74 69 6f 6e 4c 61 79 65 72 | yer,.and.packet.ApplicationLayer |
2300 | 20 66 75 6e 63 74 69 6f 6e 73 2e 20 20 45 61 63 68 20 6f 66 0a 74 68 65 73 65 20 66 75 6e 63 74 | .functions...Each.of.these.funct |
2320 | 69 6f 6e 73 20 72 65 74 75 72 6e 73 20 61 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 69 6e 74 | ions.returns.a.corresponding.int |
2340 | 65 72 66 61 63 65 0a 28 67 6f 70 61 63 6b 65 74 2e 7b 4c 69 6e 6b 2c 4e 65 74 77 6f 72 6b 2c 54 | erface.(gopacket.{Link,Network,T |
2360 | 72 61 6e 73 70 6f 72 74 2c 41 70 70 6c 69 63 61 74 69 6f 6e 7d 4c 61 79 65 72 29 2e 20 20 54 68 | ransport,Application}Layer)...Th |
2380 | 65 20 66 69 72 73 74 20 74 68 72 65 65 0a 70 72 6f 76 69 64 65 20 6d 65 74 68 6f 64 73 20 66 6f | e.first.three.provide.methods.fo |
23a0 | 72 20 67 65 74 74 69 6e 67 20 73 72 63 2f 64 73 74 20 61 64 64 72 65 73 73 65 73 20 66 6f 72 20 | r.getting.src/dst.addresses.for. |
23c0 | 74 68 61 74 20 70 61 72 74 69 63 75 6c 61 72 20 6c 61 79 65 72 2c 0a 77 68 69 6c 65 20 74 68 65 | that.particular.layer,.while.the |
23e0 | 20 66 69 6e 61 6c 20 6c 61 79 65 72 20 70 72 6f 76 69 64 65 73 20 61 20 50 61 79 6c 6f 61 64 20 | .final.layer.provides.a.Payload. |
2400 | 66 75 6e 63 74 69 6f 6e 20 74 6f 20 67 65 74 20 70 61 79 6c 6f 61 64 20 64 61 74 61 2e 0a 54 68 | function.to.get.payload.data..Th |
2420 | 69 73 20 69 73 20 68 65 6c 70 66 75 6c 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 2c 20 74 6f 20 67 | is.is.helpful,.for.example,.to.g |
2440 | 65 74 20 70 61 79 6c 6f 61 64 73 20 66 6f 72 20 61 6c 6c 20 70 61 63 6b 65 74 73 20 72 65 67 61 | et.payloads.for.all.packets.rega |
2460 | 72 64 6c 65 73 73 0a 6f 66 20 74 68 65 69 72 20 75 6e 64 65 72 6c 79 69 6e 67 20 64 61 74 61 20 | rdless.of.their.underlying.data. |
2480 | 74 79 70 65 3a 0a 3c 2f 70 3e 0a 3c 70 72 65 3e 2f 2f 20 47 65 74 20 70 61 63 6b 65 74 73 20 66 | type:.</p>.<pre>//.Get.packets.f |
24a0 | 72 6f 6d 20 73 6f 6d 65 20 73 6f 75 72 63 65 0a 66 6f 72 20 70 61 63 6b 65 74 20 3a 3d 20 72 61 | rom.some.source.for.packet.:=.ra |
24c0 | 6e 67 65 20 73 6f 6d 65 53 6f 75 72 63 65 20 7b 0a 20 20 69 66 20 61 70 70 20 3a 3d 20 70 61 63 | nge.someSource.{...if.app.:=.pac |
24e0 | 6b 65 74 2e 41 70 70 6c 69 63 61 74 69 6f 6e 4c 61 79 65 72 28 29 3b 20 61 70 70 20 21 3d 20 6e | ket.ApplicationLayer();.app.!=.n |
2500 | 69 6c 20 7b 0a 20 20 20 20 69 66 20 73 74 72 69 6e 67 73 2e 43 6f 6e 74 61 69 6e 73 28 73 74 72 | il.{.....if.strings.Contains(str |
2520 | 69 6e 67 28 61 70 70 2e 50 61 79 6c 6f 61 64 28 29 29 2c 20 26 23 33 34 3b 6d 61 67 69 63 20 73 | ing(app.Payload()),."magic.s |
2540 | 74 72 69 6e 67 26 23 33 34 3b 29 20 7b 0a 20 20 20 20 20 20 66 6d 74 2e 50 72 69 6e 74 6c 6e 28 | tring").{.......fmt.Println( |
2560 | 26 23 33 34 3b 46 6f 75 6e 64 20 6d 61 67 69 63 20 73 74 72 69 6e 67 20 69 6e 20 61 20 70 61 63 | "Found.magic.string.in.a.pac |
2580 | 6b 65 74 21 26 23 33 34 3b 29 0a 20 20 20 20 7d 0a 20 20 7d 0a 7d 0a 3c 2f 70 72 65 3e 0a 3c 70 | ket!").....}...}.}.</pre>.<p |
25a0 | 3e 0a 41 20 70 61 72 74 69 63 75 6c 61 72 6c 79 20 75 73 65 66 75 6c 20 6c 61 79 65 72 20 69 73 | >.A.particularly.useful.layer.is |
25c0 | 20 45 72 72 6f 72 4c 61 79 65 72 2c 20 77 68 69 63 68 20 69 73 20 73 65 74 20 77 68 65 6e 65 76 | .ErrorLayer,.which.is.set.whenev |
25e0 | 65 72 20 74 68 65 72 65 26 23 33 39 3b 73 0a 61 6e 20 65 72 72 6f 72 20 70 61 72 73 69 6e 67 20 | er.there's.an.error.parsing. |
2600 | 70 61 72 74 20 6f 66 20 74 68 65 20 70 61 63 6b 65 74 2e 0a 3c 2f 70 3e 0a 3c 70 72 65 3e 70 61 | part.of.the.packet..</p>.<pre>pa |
2620 | 63 6b 65 74 20 3a 3d 20 67 6f 70 61 63 6b 65 74 2e 4e 65 77 50 61 63 6b 65 74 28 6d 79 50 61 63 | cket.:=.gopacket.NewPacket(myPac |
2640 | 6b 65 74 44 61 74 61 2c 20 6c 61 79 65 72 73 2e 4c 61 79 65 72 54 79 70 65 45 74 68 65 72 6e 65 | ketData,.layers.LayerTypeEtherne |
2660 | 74 2c 20 67 6f 70 61 63 6b 65 74 2e 44 65 66 61 75 6c 74 29 0a 69 66 20 65 72 72 20 3a 3d 20 70 | t,.gopacket.Default).if.err.:=.p |
2680 | 61 63 6b 65 74 2e 45 72 72 6f 72 4c 61 79 65 72 28 29 3b 20 65 72 72 20 21 3d 20 6e 69 6c 20 7b | acket.ErrorLayer();.err.!=.nil.{ |
26a0 | 0a 20 20 66 6d 74 2e 50 72 69 6e 74 6c 6e 28 26 23 33 34 3b 45 72 72 6f 72 20 64 65 63 6f 64 69 | ...fmt.Println("Error.decodi |
26c0 | 6e 67 20 73 6f 6d 65 20 70 61 72 74 20 6f 66 20 74 68 65 20 70 61 63 6b 65 74 3a 26 23 33 34 3b | ng.some.part.of.the.packet:" |
26e0 | 2c 20 65 72 72 29 0a 7d 0a 3c 2f 70 72 65 3e 0a 3c 70 3e 0a 4e 6f 74 65 20 74 68 61 74 20 77 65 | ,.err).}.</pre>.<p>.Note.that.we |
2700 | 20 64 6f 6e 26 23 33 39 3b 74 20 72 65 74 75 72 6e 20 61 6e 20 65 72 72 6f 72 20 66 72 6f 6d 20 | .don't.return.an.error.from. |
2720 | 4e 65 77 50 61 63 6b 65 74 20 62 65 63 61 75 73 65 20 77 65 20 6d 61 79 20 68 61 76 65 20 64 65 | NewPacket.because.we.may.have.de |
2740 | 63 6f 64 65 64 0a 61 20 6e 75 6d 62 65 72 20 6f 66 20 6c 61 79 65 72 73 20 73 75 63 63 65 73 73 | coded.a.number.of.layers.success |
2760 | 66 75 6c 6c 79 20 62 65 66 6f 72 65 20 72 75 6e 6e 69 6e 67 20 69 6e 74 6f 20 6f 75 72 20 65 72 | fully.before.running.into.our.er |
2780 | 72 6f 6e 65 6f 75 73 20 6c 61 79 65 72 2e 20 20 59 6f 75 0a 6d 61 79 20 73 74 69 6c 6c 20 62 65 | roneous.layer...You.may.still.be |
27a0 | 20 61 62 6c 65 20 74 6f 20 67 65 74 20 79 6f 75 72 20 45 74 68 65 72 6e 65 74 20 61 6e 64 20 49 | .able.to.get.your.Ethernet.and.I |
27c0 | 50 76 34 20 6c 61 79 65 72 73 20 63 6f 72 72 65 63 74 6c 79 2c 20 65 76 65 6e 20 69 66 0a 79 6f | Pv4.layers.correctly,.even.if.yo |
27e0 | 75 72 20 54 43 50 20 6c 61 79 65 72 20 69 73 20 6d 61 6c 66 6f 72 6d 65 64 2e 0a 3c 2f 70 3e 0a | ur.TCP.layer.is.malformed..</p>. |
2800 | 3c 68 33 20 69 64 3d 22 46 6c 6f 77 5f 41 6e 64 5f 45 6e 64 70 6f 69 6e 74 22 3e 46 6c 6f 77 20 | <h3.id="Flow_And_Endpoint">Flow. |
2820 | 41 6e 64 20 45 6e 64 70 6f 69 6e 74 3c 2f 68 33 3e 0a 3c 70 3e 0a 67 6f 70 61 63 6b 65 74 20 68 | And.Endpoint</h3>.<p>.gopacket.h |
2840 | 61 73 20 74 77 6f 20 75 73 65 66 75 6c 20 6f 62 6a 65 63 74 73 2c 20 46 6c 6f 77 20 61 6e 64 20 | as.two.useful.objects,.Flow.and. |
2860 | 45 6e 64 70 6f 69 6e 74 2c 20 66 6f 72 20 63 6f 6d 6d 75 6e 69 63 61 74 69 6e 67 20 69 6e 20 61 | Endpoint,.for.communicating.in.a |
2880 | 20 70 72 6f 74 6f 63 6f 6c 0a 69 6e 64 65 70 65 6e 64 65 6e 74 20 6d 61 6e 6e 65 72 20 74 68 65 | .protocol.independent.manner.the |
28a0 | 20 66 61 63 74 20 74 68 61 74 20 61 20 70 61 63 6b 65 74 20 69 73 20 63 6f 6d 69 6e 67 20 66 72 | .fact.that.a.packet.is.coming.fr |
28c0 | 6f 6d 20 41 20 61 6e 64 20 67 6f 69 6e 67 20 74 6f 20 42 2e 0a 54 68 65 20 67 65 6e 65 72 61 6c | om.A.and.going.to.B..The.general |
28e0 | 20 6c 61 79 65 72 20 74 79 70 65 73 20 4c 69 6e 6b 4c 61 79 65 72 2c 20 4e 65 74 77 6f 72 6b 4c | .layer.types.LinkLayer,.NetworkL |
2900 | 61 79 65 72 2c 20 61 6e 64 20 54 72 61 6e 73 70 6f 72 74 4c 61 79 65 72 20 61 6c 6c 20 70 72 6f | ayer,.and.TransportLayer.all.pro |
2920 | 76 69 64 65 0a 6d 65 74 68 6f 64 73 20 66 6f 72 20 65 78 74 72 61 63 74 69 6e 67 20 74 68 65 69 | vide.methods.for.extracting.thei |
2940 | 72 20 66 6c 6f 77 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2c 20 77 69 74 68 6f 75 74 20 77 6f 72 72 | r.flow.information,.without.worr |
2960 | 79 69 6e 67 20 61 62 6f 75 74 20 74 68 65 20 74 79 70 65 0a 6f 66 20 74 68 65 20 75 6e 64 65 72 | ying.about.the.type.of.the.under |
2980 | 6c 79 69 6e 67 20 4c 61 79 65 72 2e 0a 3c 2f 70 3e 0a 3c 70 3e 0a 41 20 46 6c 6f 77 20 69 73 20 | lying.Layer..</p>.<p>.A.Flow.is. |
29a0 | 61 20 73 69 6d 70 6c 65 20 6f 62 6a 65 63 74 20 6d 61 64 65 20 75 70 20 6f 66 20 61 20 73 65 74 | a.simple.object.made.up.of.a.set |
29c0 | 20 6f 66 20 74 77 6f 20 45 6e 64 70 6f 69 6e 74 73 2c 20 6f 6e 65 20 73 6f 75 72 63 65 20 61 6e | .of.two.Endpoints,.one.source.an |
29e0 | 64 20 6f 6e 65 0a 64 65 73 74 69 6e 61 74 69 6f 6e 2e 20 20 49 74 20 64 65 74 61 69 6c 73 20 74 | d.one.destination...It.details.t |
2a00 | 68 65 20 73 65 6e 64 65 72 20 61 6e 64 20 72 65 63 65 69 76 65 72 20 6f 66 20 74 68 65 20 4c 61 | he.sender.and.receiver.of.the.La |
2a20 | 79 65 72 20 6f 66 20 74 68 65 20 50 61 63 6b 65 74 2e 0a 3c 2f 70 3e 0a 3c 70 3e 0a 41 6e 20 45 | yer.of.the.Packet..</p>.<p>.An.E |
2a40 | 6e 64 70 6f 69 6e 74 20 69 73 20 61 20 68 61 73 68 61 62 6c 65 20 72 65 70 72 65 73 65 6e 74 61 | ndpoint.is.a.hashable.representa |
2a60 | 74 69 6f 6e 20 6f 66 20 61 20 73 6f 75 72 63 65 20 6f 72 20 64 65 73 74 69 6e 61 74 69 6f 6e 2e | tion.of.a.source.or.destination. |
2a80 | 20 20 46 6f 72 0a 65 78 61 6d 70 6c 65 2c 20 66 6f 72 20 4c 61 79 65 72 54 79 70 65 49 50 76 34 | ..For.example,.for.LayerTypeIPv4 |
2aa0 | 2c 20 61 6e 20 45 6e 64 70 6f 69 6e 74 20 63 6f 6e 74 61 69 6e 73 20 74 68 65 20 49 50 20 61 64 | ,.an.Endpoint.contains.the.IP.ad |
2ac0 | 64 72 65 73 73 20 62 79 74 65 73 20 66 6f 72 20 61 20 76 34 0a 49 50 20 70 61 63 6b 65 74 2e 20 | dress.bytes.for.a.v4.IP.packet.. |
2ae0 | 20 41 20 46 6c 6f 77 20 63 61 6e 20 62 65 20 62 72 6f 6b 65 6e 20 69 6e 74 6f 20 45 6e 64 70 6f | .A.Flow.can.be.broken.into.Endpo |
2b00 | 69 6e 74 73 2c 20 61 6e 64 20 45 6e 64 70 6f 69 6e 74 73 20 63 61 6e 20 62 65 20 63 6f 6d 62 69 | ints,.and.Endpoints.can.be.combi |
2b20 | 6e 65 64 0a 69 6e 74 6f 20 46 6c 6f 77 73 3a 0a 3c 2f 70 3e 0a 3c 70 72 65 3e 70 61 63 6b 65 74 | ned.into.Flows:.</p>.<pre>packet |
2b40 | 20 3a 3d 20 67 6f 70 61 63 6b 65 74 2e 4e 65 77 50 61 63 6b 65 74 28 6d 79 50 61 63 6b 65 74 44 | .:=.gopacket.NewPacket(myPacketD |
2b60 | 61 74 61 2c 20 6c 61 79 65 72 73 2e 4c 61 79 65 72 54 79 70 65 45 74 68 65 72 6e 65 74 2c 20 67 | ata,.layers.LayerTypeEthernet,.g |
2b80 | 6f 70 61 63 6b 65 74 2e 4c 61 7a 79 29 0a 6e 65 74 46 6c 6f 77 20 3a 3d 20 70 61 63 6b 65 74 2e | opacket.Lazy).netFlow.:=.packet. |
2ba0 | 4e 65 74 77 6f 72 6b 4c 61 79 65 72 28 29 2e 4e 65 74 77 6f 72 6b 46 6c 6f 77 28 29 0a 73 72 63 | NetworkLayer().NetworkFlow().src |
2bc0 | 2c 20 64 73 74 20 3a 3d 20 6e 65 74 46 6c 6f 77 2e 45 6e 64 70 6f 69 6e 74 73 28 29 0a 72 65 76 | ,.dst.:=.netFlow.Endpoints().rev |
2be0 | 65 72 73 65 46 6c 6f 77 20 3a 3d 20 67 6f 70 61 63 6b 65 74 2e 4e 65 77 46 6c 6f 77 28 64 73 74 | erseFlow.:=.gopacket.NewFlow(dst |
2c00 | 2c 20 73 72 63 29 0a 3c 2f 70 72 65 3e 0a 3c 70 3e 0a 42 6f 74 68 20 45 6e 64 70 6f 69 6e 74 20 | ,.src).</pre>.<p>.Both.Endpoint. |
2c20 | 61 6e 64 20 46 6c 6f 77 20 6f 62 6a 65 63 74 73 20 63 61 6e 20 62 65 20 75 73 65 64 20 61 73 20 | and.Flow.objects.can.be.used.as. |
2c40 | 6d 61 70 20 6b 65 79 73 2c 20 61 6e 64 20 74 68 65 20 65 71 75 61 6c 69 74 79 0a 6f 70 65 72 61 | map.keys,.and.the.equality.opera |
2c60 | 74 6f 72 20 63 61 6e 20 63 6f 6d 70 61 72 65 20 74 68 65 6d 2c 20 73 6f 20 79 6f 75 20 63 61 6e | tor.can.compare.them,.so.you.can |
2c80 | 20 65 61 73 69 6c 79 20 67 72 6f 75 70 20 74 6f 67 65 74 68 65 72 20 61 6c 6c 20 70 61 63 6b 65 | .easily.group.together.all.packe |
2ca0 | 74 73 0a 62 61 73 65 64 20 6f 6e 20 65 6e 64 70 6f 69 6e 74 20 63 72 69 74 65 72 69 61 3a 0a 3c | ts.based.on.endpoint.criteria:.< |
2cc0 | 2f 70 3e 0a 3c 70 72 65 3e 66 6c 6f 77 73 20 3a 3d 20 6d 61 70 5b 67 6f 70 61 63 6b 65 74 2e 45 | /p>.<pre>flows.:=.map[gopacket.E |
2ce0 | 6e 64 70 6f 69 6e 74 5d 63 68 61 6e 20 67 6f 70 61 63 6b 65 74 2e 50 61 63 6b 65 74 0a 70 61 63 | ndpoint]chan.gopacket.Packet.pac |
2d00 | 6b 65 74 20 3a 3d 20 67 6f 70 61 63 6b 65 74 2e 4e 65 77 50 61 63 6b 65 74 28 6d 79 50 61 63 6b | ket.:=.gopacket.NewPacket(myPack |
2d20 | 65 74 44 61 74 61 2c 20 6c 61 79 65 72 73 2e 4c 61 79 65 72 54 79 70 65 45 74 68 65 72 6e 65 74 | etData,.layers.LayerTypeEthernet |
2d40 | 2c 20 67 6f 70 61 63 6b 65 74 2e 4c 61 7a 79 29 0a 2f 2f 20 53 65 6e 64 20 61 6c 6c 20 54 43 50 | ,.gopacket.Lazy).//.Send.all.TCP |
2d60 | 20 70 61 63 6b 65 74 73 20 74 6f 20 63 68 61 6e 6e 65 6c 73 20 62 61 73 65 64 20 6f 6e 20 74 68 | .packets.to.channels.based.on.th |
2d80 | 65 69 72 20 64 65 73 74 69 6e 61 74 69 6f 6e 20 70 6f 72 74 2e 0a 69 66 20 74 63 70 20 3a 3d 20 | eir.destination.port..if.tcp.:=. |
2da0 | 70 61 63 6b 65 74 2e 4c 61 79 65 72 28 6c 61 79 65 72 73 2e 4c 61 79 65 72 54 79 70 65 54 43 50 | packet.Layer(layers.LayerTypeTCP |
2dc0 | 29 3b 20 74 63 70 20 21 3d 20 6e 69 6c 20 7b 0a 20 20 66 6c 6f 77 73 5b 74 63 70 2e 54 72 61 6e | );.tcp.!=.nil.{...flows[tcp.Tran |
2de0 | 73 70 6f 72 74 46 6c 6f 77 28 29 2e 44 73 74 28 29 5d 20 26 6c 74 3b 2d 20 70 61 63 6b 65 74 0a | sportFlow().Dst()].<-.packet. |
2e00 | 7d 0a 2f 2f 20 4c 6f 6f 6b 20 66 6f 72 20 61 6c 6c 20 70 61 63 6b 65 74 73 20 77 69 74 68 20 74 | }.//.Look.for.all.packets.with.t |
2e20 | 68 65 20 73 61 6d 65 20 73 6f 75 72 63 65 20 61 6e 64 20 64 65 73 74 69 6e 61 74 69 6f 6e 20 6e | he.same.source.and.destination.n |
2e40 | 65 74 77 6f 72 6b 20 61 64 64 72 65 73 73 0a 69 66 20 6e 65 74 20 3a 3d 20 70 61 63 6b 65 74 2e | etwork.address.if.net.:=.packet. |
2e60 | 4e 65 74 77 6f 72 6b 4c 61 79 65 72 28 29 3b 20 6e 65 74 20 21 3d 20 6e 69 6c 20 7b 0a 20 20 73 | NetworkLayer();.net.!=.nil.{...s |
2e80 | 72 63 2c 20 64 73 74 20 3a 3d 20 6e 65 74 2e 4e 65 74 77 6f 72 6b 46 6c 6f 77 28 29 2e 45 6e 64 | rc,.dst.:=.net.NetworkFlow().End |
2ea0 | 70 6f 69 6e 74 73 28 29 0a 20 20 69 66 20 73 72 63 20 3d 3d 20 64 73 74 20 7b 0a 20 20 20 20 66 | points()...if.src.==.dst.{.....f |
2ec0 | 6d 74 2e 50 72 69 6e 74 6c 6e 28 26 23 33 34 3b 46 69 73 68 79 20 70 61 63 6b 65 74 20 68 61 73 | mt.Println("Fishy.packet.has |
2ee0 | 20 73 61 6d 65 20 6e 65 74 77 6f 72 6b 20 73 6f 75 72 63 65 20 61 6e 64 20 64 73 74 3a 20 25 73 | .same.network.source.and.dst:.%s |
2f00 | 26 23 33 34 3b 2c 20 73 72 63 29 0a 20 20 7d 0a 7d 0a 2f 2f 20 46 69 6e 64 20 61 6c 6c 20 70 61 | ",.src)...}.}.//.Find.all.pa |
2f20 | 63 6b 65 74 73 20 63 6f 6d 69 6e 67 20 66 72 6f 6d 20 55 44 50 20 70 6f 72 74 20 31 30 30 30 20 | ckets.coming.from.UDP.port.1000. |
2f40 | 74 6f 20 55 44 50 20 70 6f 72 74 20 35 30 30 0a 69 6e 74 65 72 65 73 74 69 6e 67 46 6c 6f 77 20 | to.UDP.port.500.interestingFlow. |
2f60 | 3a 3d 20 67 6f 70 61 63 6b 65 74 2e 4e 65 77 46 6c 6f 77 28 6c 61 79 65 72 73 2e 4e 65 77 55 44 | :=.gopacket.NewFlow(layers.NewUD |
2f80 | 50 50 6f 72 74 45 6e 64 70 6f 69 6e 74 28 31 30 30 30 29 2c 20 6c 61 79 65 72 73 2e 4e 65 77 55 | PPortEndpoint(1000),.layers.NewU |
2fa0 | 44 50 50 6f 72 74 45 6e 64 70 6f 69 6e 74 28 35 30 30 29 29 0a 69 66 20 74 20 3a 3d 20 70 61 63 | DPPortEndpoint(500)).if.t.:=.pac |
2fc0 | 6b 65 74 2e 4e 65 74 77 6f 72 6b 4c 61 79 65 72 28 29 3b 20 74 20 21 3d 20 6e 69 6c 20 26 61 6d | ket.NetworkLayer();.t.!=.nil.&am |
2fe0 | 70 3b 26 61 6d 70 3b 20 74 2e 54 72 61 6e 73 70 6f 72 74 46 6c 6f 77 28 29 20 3d 3d 20 69 6e 74 | p;&.t.TransportFlow().==.int |
3000 | 65 72 65 73 74 69 6e 67 46 6c 6f 77 20 7b 0a 20 20 66 6d 74 2e 50 72 69 6e 74 6c 6e 28 26 23 33 | erestingFlow.{...fmt.Println( |
3020 | 34 3b 46 6f 75 6e 64 20 74 68 61 74 20 55 44 50 20 66 6c 6f 77 20 49 20 77 61 73 20 6c 6f 6f 6b | 4;Found.that.UDP.flow.I.was.look |
3040 | 69 6e 67 20 66 6f 72 21 26 23 33 34 3b 29 0a 7d 0a 3c 2f 70 72 65 3e 0a 3c 68 33 20 69 64 3d 22 | ing.for!").}.</pre>.<h3.id=" |
3060 | 49 6d 70 6c 65 6d 65 6e 74 69 6e 67 5f 59 6f 75 72 5f 4f 77 6e 5f 44 65 63 6f 64 65 72 22 3e 49 | Implementing_Your_Own_Decoder">I |
3080 | 6d 70 6c 65 6d 65 6e 74 69 6e 67 20 59 6f 75 72 20 4f 77 6e 20 44 65 63 6f 64 65 72 3c 2f 68 33 | mplementing.Your.Own.Decoder</h3 |
30a0 | 3e 0a 3c 70 3e 0a 49 66 20 79 6f 75 72 20 6e 65 74 77 6f 72 6b 20 68 61 73 20 73 6f 6d 65 20 73 | >.<p>.If.your.network.has.some.s |
30c0 | 74 72 61 6e 67 65 20 65 6e 63 61 70 73 75 6c 61 74 69 6f 6e 2c 20 79 6f 75 20 63 61 6e 20 69 6d | trange.encapsulation,.you.can.im |
30e0 | 70 6c 65 6d 65 6e 74 20 79 6f 75 72 20 6f 77 6e 0a 64 65 63 6f 64 65 72 2e 20 20 49 6e 20 74 68 | plement.your.own.decoder...In.th |
3100 | 69 73 20 65 78 61 6d 70 6c 65 2c 20 77 65 20 68 61 6e 64 6c 65 20 45 74 68 65 72 6e 65 74 20 70 | is.example,.we.handle.Ethernet.p |
3120 | 61 63 6b 65 74 73 20 77 68 69 63 68 20 61 72 65 20 65 6e 63 61 70 73 75 6c 61 74 65 64 0a 69 6e | ackets.which.are.encapsulated.in |
3140 | 20 61 20 34 2d 62 79 74 65 20 68 65 61 64 65 72 2e 0a 3c 2f 70 3e 0a 3c 70 72 65 3e 2f 2f 20 43 | .a.4-byte.header..</p>.<pre>//.C |
3160 | 72 65 61 74 65 20 61 20 6c 61 79 65 72 20 74 79 70 65 2c 20 73 68 6f 75 6c 64 20 62 65 20 75 6e | reate.a.layer.type,.should.be.un |
3180 | 69 71 75 65 20 61 6e 64 20 68 69 67 68 2c 20 73 6f 20 69 74 20 64 6f 65 73 6e 26 23 33 39 3b 74 | ique.and.high,.so.it.doesn't |
31a0 | 20 63 6f 6e 66 6c 69 63 74 2c 0a 2f 2f 20 67 69 76 69 6e 67 20 69 74 20 61 20 6e 61 6d 65 20 61 | .conflict,.//.giving.it.a.name.a |
31c0 | 6e 64 20 61 20 64 65 63 6f 64 65 72 20 74 6f 20 75 73 65 2e 0a 76 61 72 20 4d 79 4c 61 79 65 72 | nd.a.decoder.to.use..var.MyLayer |
31e0 | 54 79 70 65 20 3d 20 67 6f 70 61 63 6b 65 74 2e 52 65 67 69 73 74 65 72 4c 61 79 65 72 54 79 70 | Type.=.gopacket.RegisterLayerTyp |
3200 | 65 28 31 32 33 34 35 2c 20 26 23 33 34 3b 4d 79 4c 61 79 65 72 54 79 70 65 26 23 33 34 3b 2c 20 | e(12345,."MyLayerType",. |
3220 | 67 6f 70 61 63 6b 65 74 2e 44 65 63 6f 64 65 46 75 6e 63 28 64 65 63 6f 64 65 4d 79 4c 61 79 65 | gopacket.DecodeFunc(decodeMyLaye |
3240 | 72 29 29 0a 0a 2f 2f 20 49 6d 70 6c 65 6d 65 6e 74 20 6d 79 20 6c 61 79 65 72 0a 74 79 70 65 20 | r))..//.Implement.my.layer.type. |
3260 | 4d 79 4c 61 79 65 72 20 73 74 72 75 63 74 20 7b 0a 20 20 53 74 72 61 6e 67 65 48 65 61 64 65 72 | MyLayer.struct.{...StrangeHeader |
3280 | 20 5b 5d 62 79 74 65 0a 20 20 70 61 79 6c 6f 61 64 20 5b 5d 62 79 74 65 0a 7d 0a 66 75 6e 63 20 | .[]byte...payload.[]byte.}.func. |
32a0 | 28 6d 20 4d 79 4c 61 79 65 72 29 20 4c 61 79 65 72 54 79 70 65 28 29 20 4c 61 79 65 72 54 79 70 | (m.MyLayer).LayerType().LayerTyp |
32c0 | 65 20 7b 20 72 65 74 75 72 6e 20 4d 79 4c 61 79 65 72 54 79 70 65 20 7d 0a 66 75 6e 63 20 28 6d | e.{.return.MyLayerType.}.func.(m |
32e0 | 20 4d 79 4c 61 79 65 72 29 20 4c 61 79 65 72 43 6f 6e 74 65 6e 74 73 28 29 20 5b 5d 62 79 74 65 | .MyLayer).LayerContents().[]byte |
3300 | 20 7b 20 72 65 74 75 72 6e 20 6d 2e 53 74 72 61 6e 67 65 48 65 61 64 65 72 20 7d 0a 66 75 6e 63 | .{.return.m.StrangeHeader.}.func |
3320 | 20 28 6d 20 4d 79 4c 61 79 65 72 29 20 4c 61 79 65 72 50 61 79 6c 6f 61 64 28 29 20 5b 5d 62 79 | .(m.MyLayer).LayerPayload().[]by |
3340 | 74 65 20 7b 20 72 65 74 75 72 6e 20 6d 2e 70 61 79 6c 6f 61 64 20 7d 0a 0a 2f 2f 20 4e 6f 77 20 | te.{.return.m.payload.}..//.Now. |
3360 | 69 6d 70 6c 65 6d 65 6e 74 20 61 20 64 65 63 6f 64 65 72 2e 2e 2e 20 74 68 69 73 20 6f 6e 65 20 | implement.a.decoder....this.one. |
3380 | 73 74 72 69 70 73 20 6f 66 66 20 74 68 65 20 66 69 72 73 74 20 34 20 62 79 74 65 73 20 6f 66 20 | strips.off.the.first.4.bytes.of. |
33a0 | 74 68 65 0a 2f 2f 20 70 61 63 6b 65 74 2e 0a 66 75 6e 63 20 64 65 63 6f 64 65 4d 79 4c 61 79 65 | the.//.packet..func.decodeMyLaye |
33c0 | 72 28 64 61 74 61 20 5b 5d 62 79 74 65 2c 20 70 20 67 6f 70 61 63 6b 65 74 2e 50 61 63 6b 65 74 | r(data.[]byte,.p.gopacket.Packet |
33e0 | 42 75 69 6c 64 65 72 29 20 65 72 72 6f 72 20 7b 0a 20 20 2f 2f 20 43 72 65 61 74 65 20 6d 79 20 | Builder).error.{...//.Create.my. |
3400 | 6c 61 79 65 72 0a 20 20 70 2e 41 64 64 4c 61 79 65 72 28 26 61 6d 70 3b 4d 79 4c 61 79 65 72 7b | layer...p.AddLayer(&MyLayer{ |
3420 | 64 61 74 61 5b 3a 34 5d 2c 20 64 61 74 61 5b 34 3a 5d 7d 29 0a 20 20 2f 2f 20 44 65 74 65 72 6d | data[:4],.data[4:]})...//.Determ |
3440 | 69 6e 65 20 68 6f 77 20 74 6f 20 68 61 6e 64 6c 65 20 74 68 65 20 72 65 73 74 20 6f 66 20 74 68 | ine.how.to.handle.the.rest.of.th |
3460 | 65 20 70 61 63 6b 65 74 0a 20 20 72 65 74 75 72 6e 20 70 2e 4e 65 78 74 44 65 63 6f 64 65 72 28 | e.packet...return.p.NextDecoder( |
3480 | 6c 61 79 65 72 73 2e 4c 61 79 65 72 54 79 70 65 45 74 68 65 72 6e 65 74 29 0a 7d 0a 0a 2f 2f 20 | layers.LayerTypeEthernet).}..//. |
34a0 | 46 69 6e 61 6c 6c 79 2c 20 64 65 63 6f 64 65 20 79 6f 75 72 20 70 61 63 6b 65 74 73 3a 0a 70 20 | Finally,.decode.your.packets:.p. |
34c0 | 3a 3d 20 67 6f 70 61 63 6b 65 74 2e 4e 65 77 50 61 63 6b 65 74 28 64 61 74 61 2c 20 4d 79 4c 61 | :=.gopacket.NewPacket(data,.MyLa |
34e0 | 79 65 72 54 79 70 65 2c 20 67 6f 70 61 63 6b 65 74 2e 4c 61 7a 79 29 0a 3c 2f 70 72 65 3e 0a 3c | yerType,.gopacket.Lazy).</pre>.< |
3500 | 70 3e 0a 53 65 65 20 74 68 65 20 64 6f 63 73 20 66 6f 72 20 44 65 63 6f 64 65 72 20 61 6e 64 20 | p>.See.the.docs.for.Decoder.and. |
3520 | 50 61 63 6b 65 74 42 75 69 6c 64 65 72 20 66 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 20 6f | PacketBuilder.for.more.details.o |
3540 | 6e 20 68 6f 77 20 63 6f 64 69 6e 67 0a 64 65 63 6f 64 65 72 73 20 77 6f 72 6b 73 2c 20 6f 72 20 | n.how.coding.decoders.works,.or. |
3560 | 6c 6f 6f 6b 20 61 74 20 52 65 67 69 73 74 65 72 4c 61 79 65 72 54 79 70 65 20 61 6e 64 20 52 65 | look.at.RegisterLayerType.and.Re |
3580 | 67 69 73 74 65 72 45 6e 64 70 6f 69 6e 74 54 79 70 65 20 74 6f 20 73 65 65 20 68 6f 77 0a 74 6f | gisterEndpointType.to.see.how.to |
35a0 | 20 61 64 64 20 6c 61 79 65 72 2f 65 6e 64 70 6f 69 6e 74 20 74 79 70 65 73 20 74 6f 20 67 6f 70 | .add.layer/endpoint.types.to.gop |
35c0 | 61 63 6b 65 74 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 3c 2f 64 69 76 3e 0a 09 09 3c 2f 64 69 76 3e 0a | acket..</p>.....</div>...</div>. |
35e0 | 09 09 0a 09 0a 09 09 3c 68 32 20 69 64 3d 22 70 6b 67 2d 69 6e 64 65 78 22 3e 49 6e 64 65 78 3c | .......<h2.id="pkg-index">Index< |
3600 | 2f 68 32 3e 0a 09 09 3c 21 2d 2d 20 54 61 62 6c 65 20 6f 66 20 63 6f 6e 74 65 6e 74 73 20 66 6f | /h2>...<!--.Table.of.contents.fo |
3620 | 72 20 41 50 49 3b 20 6d 75 73 74 20 62 65 20 6e 61 6d 65 64 20 6d 61 6e 75 61 6c 2d 6e 61 76 20 | r.API;.must.be.named.manual-nav. |
3640 | 74 6f 20 74 75 72 6e 20 6f 66 66 20 61 75 74 6f 20 6e 61 76 2e 20 2d 2d 3e 0a 09 09 3c 64 69 76 | to.turn.off.auto.nav..-->...<div |
3660 | 20 69 64 3d 22 6d 61 6e 75 61 6c 2d 6e 61 76 22 3e 0a 09 09 09 3c 64 6c 3e 0a 09 09 09 0a 09 09 | .id="manual-nav">....<dl>....... |
3680 | 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 70 6b 67 2d 76 61 72 69 61 62 6c 65 | ......<dd><a.href="#pkg-variable |
36a0 | 73 22 3e 56 61 72 69 61 62 6c 65 73 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 0a 09 09 09 0a 09 09 | s">Variables</a></dd>........... |
36c0 | 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 41 70 70 6c 69 63 61 | ...........<dd><a.href="#Applica |
36e0 | 74 69 6f 6e 4c 61 79 65 72 22 3e 74 79 70 65 20 41 70 70 6c 69 63 61 74 69 6f 6e 4c 61 79 65 72 | tionLayer">type.ApplicationLayer |
3700 | 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 | </a></dd>....................... |
3720 | 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 43 61 70 74 75 72 65 49 6e 66 6f 22 3e 74 79 70 65 | .<dd><a.href="#CaptureInfo">type |
3740 | 20 43 61 70 74 75 72 65 49 6e 66 6f 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a | .CaptureInfo</a></dd>........... |
3760 | 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 44 65 63 6f 64 | .............<dd><a.href="#Decod |
3780 | 65 46 61 69 6c 75 72 65 22 3e 74 79 70 65 20 44 65 63 6f 64 65 46 61 69 6c 75 72 65 3c 2f 61 3e | eFailure">type.DecodeFailure</a> |
37a0 | 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 | </dd>......................<dd>& |
37c0 | 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 44 65 63 6f 64 65 46 61 69 | nbsp;. .<a.href="#DecodeFai |
37e0 | 6c 75 72 65 2e 45 72 72 6f 72 22 3e 66 75 6e 63 20 28 64 20 2a 44 65 63 6f 64 65 46 61 69 6c 75 | lure.Error">func.(d.*DecodeFailu |
3800 | 72 65 29 20 45 72 72 6f 72 28 29 20 65 72 72 6f 72 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a | re).Error().error</a></dd>...... |
3820 | 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 | ...........<dd> . .<a. |
3840 | 68 72 65 66 3d 22 23 44 65 63 6f 64 65 46 61 69 6c 75 72 65 2e 4c 61 79 65 72 43 6f 6e 74 65 6e | href="#DecodeFailure.LayerConten |
3860 | 74 73 22 3e 66 75 6e 63 20 28 64 20 2a 44 65 63 6f 64 65 46 61 69 6c 75 72 65 29 20 4c 61 79 65 | ts">func.(d.*DecodeFailure).Laye |
3880 | 72 43 6f 6e 74 65 6e 74 73 28 29 20 5b 5d 62 79 74 65 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 | rContents().[]byte</a></dd>..... |
38a0 | 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 | ............<dd> . .<a |
38c0 | 20 68 72 65 66 3d 22 23 44 65 63 6f 64 65 46 61 69 6c 75 72 65 2e 4c 61 79 65 72 50 61 79 6c 6f | .href="#DecodeFailure.LayerPaylo |
38e0 | 61 64 22 3e 66 75 6e 63 20 28 64 20 2a 44 65 63 6f 64 65 46 61 69 6c 75 72 65 29 20 4c 61 79 65 | ad">func.(d.*DecodeFailure).Laye |
3900 | 72 50 61 79 6c 6f 61 64 28 29 20 5b 5d 62 79 74 65 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a | rPayload().[]byte</a></dd>...... |
3920 | 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 | ...........<dd> . .<a. |
3940 | 68 72 65 66 3d 22 23 44 65 63 6f 64 65 46 61 69 6c 75 72 65 2e 4c 61 79 65 72 54 79 70 65 22 3e | href="#DecodeFailure.LayerType"> |
3960 | 66 75 6e 63 20 28 64 20 2a 44 65 63 6f 64 65 46 61 69 6c 75 72 65 29 20 4c 61 79 65 72 54 79 70 | func.(d.*DecodeFailure).LayerTyp |
3980 | 65 28 29 20 4c 61 79 65 72 54 79 70 65 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 | e().LayerType</a></dd>.......... |
39a0 | 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 | .......<dd> . .<a.href |
39c0 | 3d 22 23 44 65 63 6f 64 65 46 61 69 6c 75 72 65 2e 53 74 72 69 6e 67 22 3e 66 75 6e 63 20 28 64 | ="#DecodeFailure.String">func.(d |
39e0 | 20 2a 44 65 63 6f 64 65 46 61 69 6c 75 72 65 29 20 53 74 72 69 6e 67 28 29 20 73 74 72 69 6e 67 | .*DecodeFailure).String().string |
3a00 | 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e | </a></dd>...................<dd> |
3a20 | 3c 61 20 68 72 65 66 3d 22 23 44 65 63 6f 64 65 46 75 6e 63 22 3e 74 79 70 65 20 44 65 63 6f 64 | <a.href="#DecodeFunc">type.Decod |
3a40 | 65 46 75 6e 63 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 | eFunc</a></dd>.................. |
3a60 | 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 | ....<dd> . .<a.href="# |
3a80 | 44 65 63 6f 64 65 46 75 6e 63 2e 44 65 63 6f 64 65 22 3e 66 75 6e 63 20 28 64 20 44 65 63 6f 64 | DecodeFunc.Decode">func.(d.Decod |
3aa0 | 65 46 75 6e 63 29 20 44 65 63 6f 64 65 28 64 61 74 61 20 5b 5d 62 79 74 65 2c 20 70 20 50 61 63 | eFunc).Decode(data.[]byte,.p.Pac |
3ac0 | 6b 65 74 42 75 69 6c 64 65 72 29 20 65 72 72 6f 72 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a | ketBuilder).error</a></dd>...... |
3ae0 | 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 44 65 63 6f 64 | .............<dd><a.href="#Decod |
3b00 | 65 4f 70 74 69 6f 6e 73 22 3e 74 79 70 65 20 44 65 63 6f 64 65 4f 70 74 69 6f 6e 73 3c 2f 61 3e | eOptions">type.DecodeOptions</a> |
3b20 | 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 | </dd>........................<dd |
3b40 | 3e 3c 61 20 68 72 65 66 3d 22 23 44 65 63 6f 64 65 72 22 3e 74 79 70 65 20 44 65 63 6f 64 65 72 | ><a.href="#Decoder">type.Decoder |
3b60 | 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 | </a></dd>....................... |
3b80 | 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 45 6e 64 70 6f 69 6e 74 22 3e 74 79 70 65 20 45 6e | .<dd><a.href="#Endpoint">type.En |
3ba0 | 64 70 6f 69 6e 74 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 | dpoint</a></dd>................. |
3bc0 | 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 4e 65 77 45 | <dd> . .<a.href="#NewE |
3be0 | 6e 64 70 6f 69 6e 74 22 3e 66 75 6e 63 20 4e 65 77 45 6e 64 70 6f 69 6e 74 28 74 79 70 20 45 6e | ndpoint">func.NewEndpoint(typ.En |
3c00 | 64 70 6f 69 6e 74 54 79 70 65 2c 20 72 61 77 20 5b 5d 62 79 74 65 29 20 45 6e 64 70 6f 69 6e 74 | dpointType,.raw.[]byte).Endpoint |
3c20 | 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c | </a></dd>......................< |
3c40 | 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 45 6e 64 70 6f | dd> . .<a.href="#Endpo |
3c60 | 69 6e 74 2e 45 6e 64 70 6f 69 6e 74 54 79 70 65 22 3e 66 75 6e 63 20 28 65 20 45 6e 64 70 6f 69 | int.EndpointType">func.(e.Endpoi |
3c80 | 6e 74 29 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 28 29 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 3c | nt).EndpointType().EndpointType< |
3ca0 | 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 | /a></dd>.................<dd>&nb |
3cc0 | 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 45 6e 64 70 6f 69 6e 74 2e 4c 65 | sp;. .<a.href="#Endpoint.Le |
3ce0 | 73 73 54 68 61 6e 22 3e 66 75 6e 63 20 28 61 20 45 6e 64 70 6f 69 6e 74 29 20 4c 65 73 73 54 68 | ssThan">func.(a.Endpoint).LessTh |
3d00 | 61 6e 28 62 20 45 6e 64 70 6f 69 6e 74 29 20 62 6f 6f 6c 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 | an(b.Endpoint).bool</a></dd>.... |
3d20 | 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c | .............<dd> . .< |
3d40 | 61 20 68 72 65 66 3d 22 23 45 6e 64 70 6f 69 6e 74 2e 52 61 77 22 3e 66 75 6e 63 20 28 65 20 45 | a.href="#Endpoint.Raw">func.(e.E |
3d60 | 6e 64 70 6f 69 6e 74 29 20 52 61 77 28 29 20 5b 5d 62 79 74 65 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 | ndpoint).Raw().[]byte</a></dd>.. |
3d80 | 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b | ...............<dd> . |
3da0 | 20 3c 61 20 68 72 65 66 3d 22 23 45 6e 64 70 6f 69 6e 74 2e 53 74 72 69 6e 67 22 3e 66 75 6e 63 | .<a.href="#Endpoint.String">func |
3dc0 | 20 28 65 20 45 6e 64 70 6f 69 6e 74 29 20 53 74 72 69 6e 67 28 29 20 73 74 72 69 6e 67 3c 2f 61 | .(e.Endpoint).String().string</a |
3de0 | 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 | ></dd>...................<dd><a. |
3e00 | 68 72 65 66 3d 22 23 45 6e 64 70 6f 69 6e 74 54 79 70 65 22 3e 74 79 70 65 20 45 6e 64 70 6f 69 | href="#EndpointType">type.Endpoi |
3e20 | 6e 74 54 79 70 65 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 | ntType</a></dd>................. |
3e40 | 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 52 65 67 69 | <dd> . .<a.href="#Regi |
3e60 | 73 74 65 72 45 6e 64 70 6f 69 6e 74 54 79 70 65 22 3e 66 75 6e 63 20 52 65 67 69 73 74 65 72 45 | sterEndpointType">func.RegisterE |
3e80 | 6e 64 70 6f 69 6e 74 54 79 70 65 28 6e 75 6d 20 69 6e 74 2c 20 6d 65 74 61 20 45 6e 64 70 6f 69 | ndpointType(num.int,.meta.Endpoi |
3ea0 | 6e 74 54 79 70 65 4d 65 74 61 64 61 74 61 29 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 3c 2f 61 3e | ntTypeMetadata).EndpointType</a> |
3ec0 | 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 | </dd>......................<dd>& |
3ee0 | 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 45 6e 64 70 6f 69 6e 74 54 | nbsp;. .<a.href="#EndpointT |
3f00 | 79 70 65 2e 53 74 72 69 6e 67 22 3e 66 75 6e 63 20 28 65 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 | ype.String">func.(e.EndpointType |
3f20 | 29 20 53 74 72 69 6e 67 28 29 20 73 74 72 69 6e 67 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a | ).String().string</a></dd>...... |
3f40 | 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 45 6e 64 70 6f | .............<dd><a.href="#Endpo |
3f60 | 69 6e 74 54 79 70 65 4d 65 74 61 64 61 74 61 22 3e 74 79 70 65 20 45 6e 64 70 6f 69 6e 74 54 79 | intTypeMetadata">type.EndpointTy |
3f80 | 70 65 4d 65 74 61 64 61 74 61 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 | peMetadata</a></dd>............. |
3fa0 | 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 45 72 72 6f 72 4c 61 | ...........<dd><a.href="#ErrorLa |
3fc0 | 79 65 72 22 3e 74 79 70 65 20 45 72 72 6f 72 4c 61 79 65 72 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 | yer">type.ErrorLayer</a></dd>... |
3fe0 | 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 | .....................<dd><a.href |
4000 | 3d 22 23 46 6c 6f 77 22 3e 74 79 70 65 20 46 6c 6f 77 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 | ="#Flow">type.Flow</a></dd>..... |
4020 | 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 | ............<dd> . .<a |
4040 | 20 68 72 65 66 3d 22 23 46 6c 6f 77 46 72 6f 6d 45 6e 64 70 6f 69 6e 74 73 22 3e 66 75 6e 63 20 | .href="#FlowFromEndpoints">func. |
4060 | 46 6c 6f 77 46 72 6f 6d 45 6e 64 70 6f 69 6e 74 73 28 73 72 63 2c 20 64 73 74 20 45 6e 64 70 6f | FlowFromEndpoints(src,.dst.Endpo |
4080 | 69 6e 74 29 20 28 5f 20 46 6c 6f 77 2c 20 65 72 72 20 65 72 72 6f 72 29 3c 2f 61 3e 3c 2f 64 64 | int).(_.Flow,.err.error)</a></dd |
40a0 | 3e 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 | >.................<dd> .&nb |
40c0 | 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 4e 65 77 46 6c 6f 77 22 3e 66 75 6e 63 20 4e 65 77 46 | sp;.<a.href="#NewFlow">func.NewF |
40e0 | 6c 6f 77 28 74 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 2c 20 73 72 63 2c 20 64 73 74 20 5b 5d 62 | low(t.EndpointType,.src,.dst.[]b |
4100 | 79 74 65 29 20 46 6c 6f 77 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 | yte).Flow</a></dd>.............. |
4120 | 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 | ........<dd> . .<a.hre |
4140 | 66 3d 22 23 46 6c 6f 77 2e 44 73 74 22 3e 66 75 6e 63 20 28 66 20 46 6c 6f 77 29 20 44 73 74 28 | f="#Flow.Dst">func.(f.Flow).Dst( |
4160 | 29 20 28 64 73 74 20 45 6e 64 70 6f 69 6e 74 29 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 | ).(dst.Endpoint)</a></dd>....... |
4180 | 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 | ..........<dd> . .<a.h |
41a0 | 72 65 66 3d 22 23 46 6c 6f 77 2e 45 6e 64 70 6f 69 6e 74 54 79 70 65 22 3e 66 75 6e 63 20 28 66 | ref="#Flow.EndpointType">func.(f |
41c0 | 20 46 6c 6f 77 29 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 28 29 20 45 6e 64 70 6f 69 6e 74 54 79 | .Flow).EndpointType().EndpointTy |
41e0 | 70 65 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e | pe</a></dd>.................<dd> |
4200 | 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 46 6c 6f 77 2e 45 6e 64 | . .<a.href="#Flow.End |
4220 | 70 6f 69 6e 74 73 22 3e 66 75 6e 63 20 28 66 20 46 6c 6f 77 29 20 45 6e 64 70 6f 69 6e 74 73 28 | points">func.(f.Flow).Endpoints( |
4240 | 29 20 28 73 72 63 2c 20 64 73 74 20 45 6e 64 70 6f 69 6e 74 29 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 | ).(src,.dst.Endpoint)</a></dd>.. |
4260 | 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b | ...............<dd> . |
4280 | 20 3c 61 20 68 72 65 66 3d 22 23 46 6c 6f 77 2e 52 65 76 65 72 73 65 22 3e 66 75 6e 63 20 28 66 | .<a.href="#Flow.Reverse">func.(f |
42a0 | 20 46 6c 6f 77 29 20 52 65 76 65 72 73 65 28 29 20 46 6c 6f 77 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 | .Flow).Reverse().Flow</a></dd>.. |
42c0 | 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b | ...............<dd> . |
42e0 | 20 3c 61 20 68 72 65 66 3d 22 23 46 6c 6f 77 2e 53 72 63 22 3e 66 75 6e 63 20 28 66 20 46 6c 6f | .<a.href="#Flow.Src">func.(f.Flo |
4300 | 77 29 20 53 72 63 28 29 20 28 73 72 63 20 45 6e 64 70 6f 69 6e 74 29 3c 2f 61 3e 3c 2f 64 64 3e | w).Src().(src.Endpoint)</a></dd> |
4320 | 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 | .................<dd> .&nbs |
4340 | 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 46 6c 6f 77 2e 53 74 72 69 6e 67 22 3e 66 75 6e 63 20 28 | p;.<a.href="#Flow.String">func.( |
4360 | 66 20 46 6c 6f 77 29 20 53 74 72 69 6e 67 28 29 20 73 74 72 69 6e 67 3c 2f 61 3e 3c 2f 64 64 3e | f.Flow).String().string</a></dd> |
4380 | 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 | ...................<dd><a.href=" |
43a0 | 23 4c 61 79 65 72 22 3e 74 79 70 65 20 4c 61 79 65 72 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 | #Layer">type.Layer</a></dd>..... |
43c0 | 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 | ...................<dd><a.href=" |
43e0 | 23 4c 61 79 65 72 43 6c 61 73 73 22 3e 74 79 70 65 20 4c 61 79 65 72 43 6c 61 73 73 3c 2f 61 3e | #LayerClass">type.LayerClass</a> |
4400 | 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b | </dd>.................<dd> |
4420 | 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 4e 65 77 4c 61 79 65 72 43 6c 61 73 73 22 | . .<a.href="#NewLayerClass" |
4440 | 3e 66 75 6e 63 20 4e 65 77 4c 61 79 65 72 43 6c 61 73 73 28 74 79 70 65 73 20 5b 5d 4c 61 79 65 | >func.NewLayerClass(types.[]Laye |
4460 | 72 54 79 70 65 29 20 4c 61 79 65 72 43 6c 61 73 73 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a | rType).LayerClass</a></dd>...... |
4480 | 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 | ..................<dd><a.href="# |
44a0 | 4c 61 79 65 72 43 6c 61 73 73 4d 61 70 22 3e 74 79 70 65 20 4c 61 79 65 72 43 6c 61 73 73 4d 61 | LayerClassMap">type.LayerClassMa |
44c0 | 70 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 | p</a></dd>.................<dd>& |
44e0 | 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 4e 65 77 4c 61 79 65 72 43 | nbsp;. .<a.href="#NewLayerC |
4500 | 6c 61 73 73 4d 61 70 22 3e 66 75 6e 63 20 4e 65 77 4c 61 79 65 72 43 6c 61 73 73 4d 61 70 28 74 | lassMap">func.NewLayerClassMap(t |
4520 | 79 70 65 73 20 5b 5d 4c 61 79 65 72 54 79 70 65 29 20 4c 61 79 65 72 43 6c 61 73 73 4d 61 70 3c | ypes.[]LayerType).LayerClassMap< |
4540 | 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 | /a></dd>......................<d |
4560 | 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 4c 61 79 65 72 43 | d> . .<a.href="#LayerC |
4580 | 6c 61 73 73 4d 61 70 2e 43 6f 6e 74 61 69 6e 73 22 3e 66 75 6e 63 20 28 6d 20 4c 61 79 65 72 43 | lassMap.Contains">func.(m.LayerC |
45a0 | 6c 61 73 73 4d 61 70 29 20 43 6f 6e 74 61 69 6e 73 28 74 20 4c 61 79 65 72 54 79 70 65 29 20 62 | lassMap).Contains(t.LayerType).b |
45c0 | 6f 6f 6c 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c | ool</a></dd>...................< |
45e0 | 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 4c 61 79 65 72 43 6c 61 73 73 53 6c 69 63 65 22 3e 74 79 | dd><a.href="#LayerClassSlice">ty |
4600 | 70 65 20 4c 61 79 65 72 43 6c 61 73 73 53 6c 69 63 65 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 | pe.LayerClassSlice</a></dd>..... |
4620 | 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 | ............<dd> . .<a |
4640 | 20 68 72 65 66 3d 22 23 4e 65 77 4c 61 79 65 72 43 6c 61 73 73 53 6c 69 63 65 22 3e 66 75 6e 63 | .href="#NewLayerClassSlice">func |
4660 | 20 4e 65 77 4c 61 79 65 72 43 6c 61 73 73 53 6c 69 63 65 28 74 79 70 65 73 20 5b 5d 4c 61 79 65 | .NewLayerClassSlice(types.[]Laye |
4680 | 72 54 79 70 65 29 20 4c 61 79 65 72 43 6c 61 73 73 53 6c 69 63 65 3c 2f 61 3e 3c 2f 64 64 3e 0a | rType).LayerClassSlice</a></dd>. |
46a0 | 09 09 09 09 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 | .....................<dd> . |
46c0 | 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 4c 61 79 65 72 43 6c 61 73 73 53 6c 69 63 65 | .<a.href="#LayerClassSlice |
46e0 | 2e 43 6f 6e 74 61 69 6e 73 22 3e 66 75 6e 63 20 28 73 20 4c 61 79 65 72 43 6c 61 73 73 53 6c 69 | .Contains">func.(s.LayerClassSli |
4700 | 63 65 29 20 43 6f 6e 74 61 69 6e 73 28 74 20 4c 61 79 65 72 54 79 70 65 29 20 62 6f 6f 6c 3c 2f | ce).Contains(t.LayerType).bool</ |
4720 | 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 | a></dd>...................<dd><a |
4740 | 20 68 72 65 66 3d 22 23 4c 61 79 65 72 54 79 70 65 22 3e 74 79 70 65 20 4c 61 79 65 72 54 79 70 | .href="#LayerType">type.LayerTyp |
4760 | 65 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 | e</a></dd>.................<dd>& |
4780 | 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 52 65 67 69 73 74 65 72 4c | nbsp;. .<a.href="#RegisterL |
47a0 | 61 79 65 72 54 79 70 65 22 3e 66 75 6e 63 20 52 65 67 69 73 74 65 72 4c 61 79 65 72 54 79 70 65 | ayerType">func.RegisterLayerType |
47c0 | 28 6e 75 6d 20 69 6e 74 2c 20 6d 65 74 61 20 4c 61 79 65 72 54 79 70 65 4d 65 74 61 64 61 74 61 | (num.int,.meta.LayerTypeMetadata |
47e0 | 29 20 4c 61 79 65 72 54 79 70 65 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 | ).LayerType</a></dd>............ |
4800 | 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 | ..........<dd> . .<a.h |
4820 | 72 65 66 3d 22 23 4c 61 79 65 72 54 79 70 65 2e 44 65 63 6f 64 65 22 3e 66 75 6e 63 20 28 74 20 | ref="#LayerType.Decode">func.(t. |
4840 | 4c 61 79 65 72 54 79 70 65 29 20 44 65 63 6f 64 65 28 64 61 74 61 20 5b 5d 62 79 74 65 2c 20 63 | LayerType).Decode(data.[]byte,.c |
4860 | 20 50 61 63 6b 65 74 42 75 69 6c 64 65 72 29 20 65 72 72 6f 72 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 | .PacketBuilder).error</a></dd>.. |
4880 | 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b | ...............<dd> . |
48a0 | 20 3c 61 20 68 72 65 66 3d 22 23 4c 61 79 65 72 54 79 70 65 2e 53 74 72 69 6e 67 22 3e 66 75 6e | .<a.href="#LayerType.String">fun |
48c0 | 63 20 28 74 20 4c 61 79 65 72 54 79 70 65 29 20 53 74 72 69 6e 67 28 29 20 28 73 20 73 74 72 69 | c.(t.LayerType).String().(s.stri |
48e0 | 6e 67 29 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c | ng)</a></dd>...................< |
4900 | 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 4c 61 79 65 72 54 79 70 65 4d 65 74 61 64 61 74 61 22 3e | dd><a.href="#LayerTypeMetadata"> |
4920 | 74 79 70 65 20 4c 61 79 65 72 54 79 70 65 4d 65 74 61 64 61 74 61 3c 2f 61 3e 3c 2f 64 64 3e 0a | type.LayerTypeMetadata</a></dd>. |
4940 | 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 | .......................<dd><a.hr |
4960 | 65 66 3d 22 23 4c 69 6e 6b 4c 61 79 65 72 22 3e 74 79 70 65 20 4c 69 6e 6b 4c 61 79 65 72 3c 2f | ef="#LinkLayer">type.LinkLayer</ |
4980 | 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c | a></dd>........................< |
49a0 | 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 4e 65 74 77 6f 72 6b 4c 61 79 65 72 22 3e 74 79 70 65 20 | dd><a.href="#NetworkLayer">type. |
49c0 | 4e 65 74 77 6f 72 6b 4c 61 79 65 72 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a | NetworkLayer</a></dd>........... |
49e0 | 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 50 61 63 6b 65 | .............<dd><a.href="#Packe |
4a00 | 74 22 3e 74 79 70 65 20 50 61 63 6b 65 74 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 | t">type.Packet</a></dd>......... |
4a20 | 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 | ........<dd> . .<a.hre |
4a40 | 66 3d 22 23 4e 65 77 50 61 63 6b 65 74 22 3e 66 75 6e 63 20 4e 65 77 50 61 63 6b 65 74 28 64 61 | f="#NewPacket">func.NewPacket(da |
4a60 | 74 61 20 5b 5d 62 79 74 65 2c 20 66 69 72 73 74 4c 61 79 65 72 44 65 63 6f 64 65 72 20 44 65 63 | ta.[]byte,.firstLayerDecoder.Dec |
4a80 | 6f 64 65 72 2c 20 6f 70 74 69 6f 6e 73 20 44 65 63 6f 64 65 4f 70 74 69 6f 6e 73 29 20 50 61 63 | oder,.options.DecodeOptions).Pac |
4aa0 | 6b 65 74 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a | ket</a></dd>.................... |
4ac0 | 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 50 61 63 6b 65 74 42 75 69 6c 64 65 72 22 | ....<dd><a.href="#PacketBuilder" |
4ae0 | 3e 74 79 70 65 20 50 61 63 6b 65 74 42 75 69 6c 64 65 72 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 | >type.PacketBuilder</a></dd>.... |
4b00 | 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d | ....................<dd><a.href= |
4b20 | 22 23 50 61 63 6b 65 74 44 61 74 61 53 6f 75 72 63 65 22 3e 74 79 70 65 20 50 61 63 6b 65 74 44 | "#PacketDataSource">type.PacketD |
4b40 | 61 74 61 53 6f 75 72 63 65 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 | ataSource</a></dd>.............. |
4b60 | 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 50 61 63 6b 65 74 53 6f | ..........<dd><a.href="#PacketSo |
4b80 | 75 72 63 65 22 3e 74 79 70 65 20 50 61 63 6b 65 74 53 6f 75 72 63 65 3c 2f 61 3e 3c 2f 64 64 3e | urce">type.PacketSource</a></dd> |
4ba0 | 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 | .................<dd> .&nbs |
4bc0 | 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 4e 65 77 50 61 63 6b 65 74 53 6f 75 72 63 65 22 3e 66 75 | p;.<a.href="#NewPacketSource">fu |
4be0 | 6e 63 20 4e 65 77 50 61 63 6b 65 74 53 6f 75 72 63 65 28 73 6f 75 72 63 65 20 50 61 63 6b 65 74 | nc.NewPacketSource(source.Packet |
4c00 | 44 61 74 61 53 6f 75 72 63 65 2c 20 64 65 63 6f 64 65 72 20 44 65 63 6f 64 65 72 29 20 2a 50 61 | DataSource,.decoder.Decoder).*Pa |
4c20 | 63 6b 65 74 53 6f 75 72 63 65 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 | cketSource</a></dd>............. |
4c40 | 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 | .........<dd> . .<a.hr |
4c60 | 65 66 3d 22 23 50 61 63 6b 65 74 53 6f 75 72 63 65 2e 4e 65 78 74 50 61 63 6b 65 74 22 3e 66 75 | ef="#PacketSource.NextPacket">fu |
4c80 | 6e 63 20 28 70 20 2a 50 61 63 6b 65 74 53 6f 75 72 63 65 29 20 4e 65 78 74 50 61 63 6b 65 74 28 | nc.(p.*PacketSource).NextPacket( |
4ca0 | 29 20 28 50 61 63 6b 65 74 2c 20 65 72 72 6f 72 29 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a | ).(Packet,.error)</a></dd>...... |
4cc0 | 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 | ...........<dd> . .<a. |
4ce0 | 68 72 65 66 3d 22 23 50 61 63 6b 65 74 53 6f 75 72 63 65 2e 50 61 63 6b 65 74 73 22 3e 66 75 6e | href="#PacketSource.Packets">fun |
4d00 | 63 20 28 70 20 2a 50 61 63 6b 65 74 53 6f 75 72 63 65 29 20 50 61 63 6b 65 74 73 28 29 20 63 68 | c.(p.*PacketSource).Packets().ch |
4d20 | 61 6e 20 50 61 63 6b 65 74 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 | an.Packet</a></dd>.............. |
4d40 | 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 50 61 79 6c 6f 61 64 22 3e 74 79 70 65 | .....<dd><a.href="#Payload">type |
4d60 | 20 50 61 79 6c 6f 61 64 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 09 | .Payload</a></dd>............... |
4d80 | 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 | .......<dd> . .<a.href |
4da0 | 3d 22 23 50 61 79 6c 6f 61 64 2e 4c 61 79 65 72 43 6f 6e 74 65 6e 74 73 22 3e 66 75 6e 63 20 28 | ="#Payload.LayerContents">func.( |
4dc0 | 70 20 2a 50 61 79 6c 6f 61 64 29 20 4c 61 79 65 72 43 6f 6e 74 65 6e 74 73 28 29 20 5b 5d 62 79 | p.*Payload).LayerContents().[]by |
4de0 | 74 65 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e | te</a></dd>.................<dd> |
4e00 | 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 50 61 79 6c 6f 61 64 2e | . .<a.href="#Payload. |
4e20 | 4c 61 79 65 72 50 61 79 6c 6f 61 64 22 3e 66 75 6e 63 20 28 70 20 2a 50 61 79 6c 6f 61 64 29 20 | LayerPayload">func.(p.*Payload). |
4e40 | 4c 61 79 65 72 50 61 79 6c 6f 61 64 28 29 20 5b 5d 62 79 74 65 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 | LayerPayload().[]byte</a></dd>.. |
4e60 | 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b | ...............<dd> . |
4e80 | 20 3c 61 20 68 72 65 66 3d 22 23 50 61 79 6c 6f 61 64 2e 4c 61 79 65 72 54 79 70 65 22 3e 66 75 | .<a.href="#Payload.LayerType">fu |
4ea0 | 6e 63 20 28 70 20 2a 50 61 79 6c 6f 61 64 29 20 4c 61 79 65 72 54 79 70 65 28 29 20 4c 61 79 65 | nc.(p.*Payload).LayerType().Laye |
4ec0 | 72 54 79 70 65 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 09 0a 09 09 09 09 09 3c | rType</a></dd>.................< |
4ee0 | 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 66 3d 22 23 50 61 79 6c 6f | dd> . .<a.href="#Paylo |
4f00 | 61 64 2e 50 61 79 6c 6f 61 64 22 3e 66 75 6e 63 20 28 70 20 2a 50 61 79 6c 6f 61 64 29 20 50 61 | ad.Payload">func.(p.*Payload).Pa |
4f20 | 79 6c 6f 61 64 28 29 20 5b 5d 62 79 74 65 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 | yload().[]byte</a></dd>......... |
4f40 | 09 09 0a 09 09 09 09 09 3c 64 64 3e 26 6e 62 73 70 3b 20 26 6e 62 73 70 3b 20 3c 61 20 68 72 65 | ........<dd> . .<a.hre |
4f60 | 66 3d 22 23 50 61 79 6c 6f 61 64 2e 53 74 72 69 6e 67 22 3e 66 75 6e 63 20 28 70 20 2a 50 61 79 | f="#Payload.String">func.(p.*Pay |
4f80 | 6c 6f 61 64 29 20 53 74 72 69 6e 67 28 29 20 73 74 72 69 6e 67 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 | load).String().string</a></dd>.. |
4fa0 | 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 64 64 3e 3c 61 20 68 72 65 66 3d 22 23 54 | .................<dd><a.href="#T |
4fc0 | 72 61 6e 73 70 6f 72 74 4c 61 79 65 72 22 3e 74 79 70 65 20 54 72 61 6e 73 70 6f 72 74 4c 61 79 | ransportLayer">type.TransportLay |
4fe0 | 65 72 3c 2f 61 3e 3c 2f 64 64 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 | er</a></dd>..................... |
5000 | 3c 2f 64 6c 3e 0a 0a 09 09 0a 0a 09 09 0a 09 09 09 3c 68 34 3e 50 61 63 6b 61 67 65 20 66 69 6c | </dl>............<h4>Package.fil |
5020 | 65 73 3c 2f 68 34 3e 0a 09 09 09 3c 70 3e 0a 09 09 09 3c 73 70 61 6e 20 73 74 79 6c 65 3d 22 66 | es</h4>....<p>....<span.style="f |
5040 | 6f 6e 74 2d 73 69 7a 65 3a 39 30 25 22 3e 0a 09 09 09 0a 09 09 09 09 3c 61 20 68 72 65 66 3d 22 | ont-size:90%">.........<a.href=" |
5060 | 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 | /src/pkg/github.com/gconnell/gop |
5080 | 61 63 6b 65 74 2f 62 61 73 65 2e 67 6f 22 3e 62 61 73 65 2e 67 6f 3c 2f 61 3e 0a 09 09 09 0a 09 | acket/base.go">base.go</a>...... |
50a0 | 09 09 09 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f | ...<a.href="/src/pkg/github.com/ |
50c0 | 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 64 65 63 6f 64 65 2e 67 6f 22 3e 64 65 63 | gconnell/gopacket/decode.go">dec |
50e0 | 6f 64 65 2e 67 6f 3c 2f 61 3e 0a 09 09 09 0a 09 09 09 09 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 | ode.go</a>.........<a.href="/src |
5100 | 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 | /pkg/github.com/gconnell/gopacke |
5120 | 74 2f 64 6f 63 2e 67 6f 22 3e 64 6f 63 2e 67 6f 3c 2f 61 3e 0a 09 09 09 0a 09 09 09 09 3c 61 20 | t/doc.go">doc.go</a>.........<a. |
5140 | 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 | href="/src/pkg/github.com/gconne |
5160 | 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 22 3e 66 6c 6f 77 73 2e 67 6f 3c 2f | ll/gopacket/flows.go">flows.go</ |
5180 | 61 3e 0a 09 09 09 0a 09 09 09 09 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 | a>.........<a.href="/src/pkg/git |
51a0 | 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 6c 61 79 65 72 63 | hub.com/gconnell/gopacket/layerc |
51c0 | 6c 61 73 73 2e 67 6f 22 3e 6c 61 79 65 72 63 6c 61 73 73 2e 67 6f 3c 2f 61 3e 0a 09 09 09 0a 09 | lass.go">layerclass.go</a>...... |
51e0 | 09 09 09 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f | ...<a.href="/src/pkg/github.com/ |
5200 | 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 6c 61 79 65 72 74 79 70 65 2e 67 6f 22 3e | gconnell/gopacket/layertype.go"> |
5220 | 6c 61 79 65 72 74 79 70 65 2e 67 6f 3c 2f 61 3e 0a 09 09 09 0a 09 09 09 09 3c 61 20 68 72 65 66 | layertype.go</a>.........<a.href |
5240 | 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 | ="/src/pkg/github.com/gconnell/g |
5260 | 6f 70 61 63 6b 65 74 2f 70 61 63 6b 65 74 2e 67 6f 22 3e 70 61 63 6b 65 74 2e 67 6f 3c 2f 61 3e | opacket/packet.go">packet.go</a> |
5280 | 0a 09 09 09 0a 09 09 09 09 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 | .........<a.href="/src/pkg/githu |
52a0 | 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 76 61 6c 69 64 5f 6d 61 | b.com/gconnell/gopacket/valid_ma |
52c0 | 63 5f 70 72 65 66 69 78 65 73 2e 67 6f 22 3e 76 61 6c 69 64 5f 6d 61 63 5f 70 72 65 66 69 78 65 | c_prefixes.go">valid_mac_prefixe |
52e0 | 73 2e 67 6f 3c 2f 61 3e 0a 09 09 09 0a 09 09 09 3c 2f 73 70 61 6e 3e 0a 09 09 09 3c 2f 70 3e 0a | s.go</a>........</span>....</p>. |
5300 | 09 09 0a 09 0a 09 09 0a 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 70 6b 67 2d 76 61 72 69 61 62 | ..............<h2.id="pkg-variab |
5320 | 6c 65 73 22 d8 b2 e9 50 88 0c 07 00 04 40 00 00 04 40 00 00 1e 00 00 00 60 01 88 91 3f d8 06 40 | les"...P.....@...@......`...?..@ |
5340 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 | ................................ |
5360 | 1f 90 e5 af 0a 65 b6 a7 08 97 18 4a 80 10 23 02 3f e0 00 00 01 01 08 0a 05 c0 8d b6 05 c0 8c fc | .....e.....J..#.?............... |
5380 | 3e 56 61 72 69 61 62 6c 65 73 3c 2f 68 32 3e 0a 09 09 09 0a 09 09 09 09 3c 70 72 65 3e 76 61 72 | >Variables</h2>.........<pre>var |
53a0 | 20 56 61 6c 69 64 4d 41 43 50 72 65 66 69 78 4d 61 70 20 3d 20 76 61 6c 69 64 4d 41 43 50 72 65 | .ValidMACPrefixMap.=.validMACPre |
53c0 | 66 69 78 4d 61 70 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 56 61 6c 69 64 4d 41 43 50 72 65 | fixMap</pre>.....<p>.ValidMACPre |
53e0 | 66 69 78 4d 61 70 20 6d 61 70 73 20 61 20 76 61 6c 69 64 20 4d 41 43 20 61 64 64 72 65 73 73 20 | fixMap.maps.a.valid.MAC.address. |
5400 | 70 72 65 66 69 78 20 74 6f 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 0a 6f 72 67 61 6e 69 | prefix.to.the.name.of.the.organi |
5420 | 7a 61 74 69 6f 6e 20 74 68 61 74 20 6f 77 6e 73 20 74 68 65 20 72 69 67 68 74 73 20 74 6f 20 75 | zation.that.owns.the.rights.to.u |
5440 | 73 65 20 69 74 2e 20 20 57 65 20 6d 61 70 20 69 74 20 74 6f 20 61 20 68 69 64 64 65 6e 0a 76 61 | se.it...We.map.it.to.a.hidden.va |
5460 | 72 69 61 62 6c 65 20 73 6f 20 69 74 20 77 6f 6e 26 23 33 39 3b 74 20 73 68 6f 77 20 75 70 20 69 | riable.so.it.won't.show.up.i |
5480 | 6e 20 67 6f 64 6f 63 2c 20 73 69 6e 63 65 20 69 74 26 23 33 39 3b 73 20 61 20 76 65 72 79 20 6c | n.godoc,.since.it's.a.very.l |
54a0 | 61 72 67 65 20 6d 61 70 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 0a 09 09 0a 09 09 0a 09 09 0a 09 09 09 | arge.map..</p>.................. |
54c0 | 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 41 70 70 6c 69 63 61 74 69 6f 6e 4c 61 79 65 72 | ........<h2.id="ApplicationLayer |
54e0 | 22 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e | ">type.<a.href="/src/pkg/github. |
5500 | 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 62 61 73 65 2e 67 6f 3f 73 3d | com/gconnell/gopacket/base.go?s= |
5520 | 32 32 30 32 3a 32 32 36 32 23 4c 35 37 22 3e 41 70 70 6c 69 63 61 74 69 6f 6e 4c 61 79 65 72 3c | 2202:2262#L57">ApplicationLayer< |
5540 | 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 65 3e 74 79 70 65 20 41 70 70 6c 69 63 61 74 69 6f | /a></h2>....<pre>type.Applicatio |
5560 | 6e 4c 61 79 65 72 20 69 6e 74 65 72 66 61 63 65 20 7b 0a 20 20 20 20 4c 61 79 65 72 0a 20 20 20 | nLayer.interface.{.....Layer.... |
5580 | 20 50 61 79 6c 6f 61 64 28 29 20 5b 5d 62 79 74 65 0a 7d 3c 2f 70 72 65 3e 0a 09 09 09 3c 70 3e | .Payload().[]byte.}</pre>....<p> |
55a0 | 0a 41 70 70 6c 69 63 61 74 69 6f 6e 4c 61 79 65 72 20 69 73 20 74 68 65 20 70 61 63 6b 65 74 20 | .ApplicationLayer.is.the.packet. |
55c0 | 6c 61 79 65 72 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 74 68 65 20 54 43 50 2f 49 | layer.corresponding.to.the.TCP/I |
55e0 | 50 20 6c 61 79 65 72 20 34 20 28 4f 53 49 0a 6c 61 79 65 72 20 37 29 2c 20 61 6c 73 6f 20 6b 6e | P.layer.4.(OSI.layer.7),.also.kn |
5600 | 6f 77 6e 20 61 73 20 74 68 65 20 70 61 63 6b 65 74 20 70 61 79 6c 6f 61 64 2e 0a 3c 2f 70 3e 0a | own.as.the.packet.payload..</p>. |
5620 | 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 0a 09 09 09 | ................................ |
5640 | 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 43 61 70 74 75 72 65 49 6e 66 6f 22 3e 74 79 70 | ........<h2.id="CaptureInfo">typ |
5660 | 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 | e.<a.href="/src/pkg/github.com/g |
5680 | 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 70 61 63 6b 65 74 2e 67 6f 3f 73 3d 33 32 38 | connell/gopacket/packet.go?s=328 |
56a0 | 3a 36 33 32 23 4c 36 22 3e 43 61 70 74 75 72 65 49 6e 66 6f 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 | :632#L6">CaptureInfo</a></h2>... |
56c0 | 09 3c 70 72 65 3e 74 79 70 65 20 43 61 70 74 75 72 65 49 6e 66 6f 20 73 74 72 75 63 74 20 7b 0a | .<pre>type.CaptureInfo.struct.{. |
56e0 | 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 50 6f 70 | ....<span.class="comment">//.Pop |
5700 | 75 6c 61 74 65 64 20 69 73 20 73 65 74 20 74 6f 20 74 72 75 65 20 69 66 20 74 68 65 20 72 65 73 | ulated.is.set.to.true.if.the.res |
5720 | 74 20 6f 66 20 74 68 65 20 43 61 70 74 75 72 65 49 6e 66 6f 20 68 61 73 20 62 65 65 6e 20 70 6f | t.of.the.CaptureInfo.has.been.po |
5740 | 70 75 6c 61 74 65 64 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 | pulated</span>.....<span.class=" |
5760 | 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 77 69 74 68 20 61 63 74 75 61 6c 20 69 6e 66 6f 72 6d 61 74 | comment">//.with.actual.informat |
5780 | 69 6f 6e 2e 20 20 49 66 20 50 6f 70 75 6c 61 74 65 64 20 69 73 20 66 61 6c 73 65 2c 20 74 68 65 | ion...If.Populated.is.false,.the |
57a0 | 72 65 26 23 33 39 3b 73 20 6e 6f 20 70 6f 69 6e 74 20 69 6e 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 | re's.no.point.in</span>..... |
57c0 | 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 72 65 61 64 69 6e 67 | <span.class="comment">//.reading |
57e0 | 20 61 6e 79 20 6f 66 20 74 68 65 20 6f 74 68 65 72 20 66 69 65 6c 64 73 2e 3c 2f 73 70 61 6e 3e | .any.of.the.other.fields.</span> |
5800 | 0a 20 20 20 20 50 6f 70 75 6c 61 74 65 64 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6f 6f 6c 0a | .....Populated.............bool. |
5820 | 20 20 20 20 54 69 6d 65 73 74 61 6d 70 20 20 20 20 20 20 20 20 20 20 20 20 20 74 69 6d 65 2e 54 | ....Timestamp.............time.T |
5840 | 69 6d 65 0a 20 20 20 20 43 61 70 74 75 72 65 4c 65 6e 67 74 68 2c 20 4c 65 6e 67 74 68 20 69 6e | ime.....CaptureLength,.Length.in |
5860 | 74 0a 7d 3c 2f 70 72 65 3e 0a 09 09 09 3c 70 3e 0a 43 61 70 74 75 72 65 49 6e 66 6f 20 63 6f 6e | t.}</pre>....<p>.CaptureInfo.con |
5880 | 74 61 69 6e 73 20 63 61 70 74 75 72 65 20 6d 65 74 61 64 61 74 61 20 66 6f 72 20 61 20 70 61 63 | tains.capture.metadata.for.a.pac |
58a0 | 6b 65 74 2e 20 20 49 66 20 61 20 70 61 63 6b 65 74 20 77 61 73 20 63 61 70 74 75 72 65 64 0a 6f | ket...If.a.packet.was.captured.o |
58c0 | 66 66 20 74 68 65 20 77 69 72 65 20 6f 72 20 72 65 61 64 20 66 72 6f 6d 20 61 20 70 63 61 70 20 | ff.the.wire.or.read.from.a.pcap. |
58e0 | 66 69 6c 65 20 28 73 65 65 20 74 68 65 20 26 23 33 39 3b 70 63 61 70 26 23 33 39 3b 20 73 75 62 | file.(see.the.'pcap'.sub |
5900 | 64 69 72 65 63 74 6f 72 79 29 2c 20 74 68 69 73 0a 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 77 69 6c | directory),.this.information.wil |
5920 | 6c 20 62 65 20 61 74 74 61 63 68 65 64 20 74 6f 20 74 68 65 20 70 61 63 6b 65 74 2e 0a 3c 2f 70 | l.be.attached.to.the.packet..</p |
5940 | 3e 0a 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 0a 09 | >............................... |
5960 | 09 09 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 44 65 63 6f 64 65 46 61 69 6c 75 72 65 22 | ..........<h2.id="DecodeFailure" |
5980 | 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 | >type.<a.href="/src/pkg/github.c |
59a0 | 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 64 65 63 6f 64 65 2e 67 6f 3f 73 | om/gconnell/gopacket/decode.go?s |
59c0 | 3d 33 33 32 37 3a 33 33 38 31 23 4c 37 33 22 3e 44 65 63 6f 64 65 46 61 69 6c 75 72 65 3c 2f 61 | =3327:3381#L73">DecodeFailure</a |
59e0 | 3e 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 65 3e 74 79 70 65 20 44 65 63 6f 64 65 46 61 69 6c 75 72 | ></h2>....<pre>type.DecodeFailur |
5a00 | 65 20 73 74 72 75 63 74 20 7b 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d | e.struct.{.....<span.class="comm |
5a20 | 65 6e 74 22 3e 2f 2f 20 63 6f 6e 74 61 69 6e 73 20 66 69 6c 74 65 72 65 64 20 6f 72 20 75 6e 65 | ent">//.contains.filtered.or.une |
5a40 | 78 70 6f 72 74 65 64 20 66 69 65 6c 64 73 3c 2f 73 70 61 6e 3e 0a 7d 3c 2f 70 72 65 3e 0a 09 09 | xported.fields</span>.}</pre>... |
5a60 | 09 3c 70 3e 0a 44 65 63 6f 64 65 46 61 69 6c 75 72 65 20 69 73 20 61 20 70 61 63 6b 65 74 20 6c | .<p>.DecodeFailure.is.a.packet.l |
5a80 | 61 79 65 72 20 63 72 65 61 74 65 64 20 69 66 20 64 65 63 6f 64 69 6e 67 20 6f 66 20 74 68 65 20 | ayer.created.if.decoding.of.the. |
5aa0 | 70 61 63 6b 65 74 20 64 61 74 61 20 66 61 69 6c 65 64 0a 66 6f 72 20 73 6f 6d 65 20 72 65 61 73 | packet.data.failed.for.some.reas |
5ac0 | 6f 6e 2e 20 20 49 74 20 69 6d 70 6c 65 6d 65 6e 74 73 20 45 72 72 6f 72 4c 61 79 65 72 2e 20 20 | on...It.implements.ErrorLayer... |
5ae0 | 4c 61 79 65 72 43 6f 6e 74 65 6e 74 73 20 77 69 6c 6c 20 62 65 20 74 68 65 20 65 6e 74 69 72 65 | LayerContents.will.be.the.entire |
5b00 | 0a 73 65 74 20 6f 66 20 62 79 74 65 73 20 74 68 61 74 20 66 61 69 6c 65 64 20 74 6f 20 70 61 72 | .set.of.bytes.that.failed.to.par |
5b20 | 73 65 2c 20 61 6e 64 20 45 72 72 6f 72 20 77 69 6c 6c 20 72 65 74 75 72 6e 20 74 68 65 20 72 65 | se,.and.Error.will.return.the.re |
5b40 | 61 73 6f 6e 20 70 61 72 73 69 6e 67 0a 66 61 69 6c 65 64 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a | ason.parsing.failed..</p>....... |
5b60 | 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 | .............................<h3 |
5b80 | 20 69 64 3d 22 44 65 63 6f 64 65 46 61 69 6c 75 72 65 2e 45 72 72 6f 72 22 3e 66 75 6e 63 20 28 | .id="DecodeFailure.Error">func.( |
5ba0 | 2a 44 65 63 6f 64 65 46 61 69 6c 75 72 65 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b | *DecodeFailure).<a.href="/src/pk |
5bc0 | 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 64 | g/github.com/gconnell/gopacket/d |
5be0 | 65 63 6f 64 65 2e 67 6f 3f 73 3d 33 34 33 39 3a 33 34 37 36 23 4c 37 39 22 3e 45 72 72 6f 72 3c | ecode.go?s=3439:3476#L79">Error< |
5c00 | 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 64 20 2a 44 65 63 6f 64 | /a></h3>.....<pre>func.(d.*Decod |
5c20 | 65 46 61 69 6c 75 72 65 29 20 45 72 72 6f 72 28 29 20 65 72 72 6f 72 3c 2f 70 72 65 3e 0a 09 09 | eFailure).Error().error</pre>... |
5c40 | 09 09 3c 70 3e 0a 45 72 72 6f 72 20 72 65 74 75 72 6e 73 20 74 68 65 20 65 72 72 6f 72 20 65 6e | ..<p>.Error.returns.the.error.en |
5c60 | 63 6f 75 6e 74 65 72 65 64 20 64 75 72 69 6e 67 20 64 65 63 6f 64 69 6e 67 2e 0a 3c 2f 70 3e 0a | countered.during.decoding..</p>. |
5c80 | 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 | ........................<h3.id=" |
5ca0 | 44 65 63 6f 64 65 46 61 69 6c 75 72 65 2e 4c 61 79 65 72 43 6f 6e 74 65 6e 74 73 22 3e 66 75 6e | DecodeFailure.LayerContents">fun |
5cc0 | 63 20 28 2a 44 65 63 6f 64 65 46 61 69 6c 75 72 65 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 | c.(*DecodeFailure).<a.href="/src |
5ce0 | 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 | /pkg/github.com/gconnell/gopacke |
5d00 | 74 2f 64 65 63 6f 64 65 2e 67 6f 3f 73 3d 33 35 30 33 3a 33 35 34 39 23 4c 38 30 22 3e 4c 61 79 | t/decode.go?s=3503:3549#L80">Lay |
5d20 | 65 72 43 6f 6e 74 65 6e 74 73 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e | erContents</a></h3>.....<pre>fun |
5d40 | 63 20 28 64 20 2a 44 65 63 6f 64 65 46 61 69 6c 75 72 65 29 20 4c 61 79 65 72 43 6f 6e 74 65 6e | c.(d.*DecodeFailure).LayerConten |
5d60 | 74 73 28 29 20 5b 5d 62 79 74 65 3c 2f 70 72 65 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 09 | ts().[]byte</pre>............... |
5d80 | 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 44 65 63 6f 64 65 46 61 69 6c | ..............<h3.id="DecodeFail |
5da0 | 75 72 65 2e 4c 61 79 65 72 50 61 79 6c 6f 61 64 22 3e 66 75 6e 63 20 28 2a 44 65 63 6f 64 65 46 | ure.LayerPayload">func.(*DecodeF |
5dc0 | 61 69 6c 75 72 65 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 | ailure).<a.href="/src/pkg/github |
5de0 | 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 64 65 63 6f 64 65 2e 67 6f | .com/gconnell/gopacket/decode.go |
5e00 | 3f 73 3d 33 35 36 38 3a 33 36 31 33 23 4c 38 31 22 3e 4c 61 79 65 72 50 61 79 6c 6f 61 64 3c 2f | ?s=3568:3613#L81">LayerPayload</ |
5e20 | 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 64 20 2a 44 65 63 6f 64 65 | a></h3>.....<pre>func.(d.*Decode |
5e40 | 46 61 69 6c 75 72 65 29 20 4c 61 79 65 72 50 61 79 6c 6f 61 64 28 29 20 5b 5d 62 79 74 65 3c 2f | Failure).LayerPayload().[]byte</ |
5e60 | 70 72 65 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 | pre>............................ |
5e80 | 09 3c 68 33 20 69 64 3d 22 44 65 63 6f 64 65 46 61 69 6c 75 72 65 2e 4c 61 79 65 72 54 79 70 65 | .<h3.id="DecodeFailure.LayerType |
5ea0 | 22 3e 66 75 6e 63 20 28 2a 44 65 63 6f 64 65 46 61 69 6c 75 72 65 29 20 3c 61 20 68 72 65 66 3d | ">func.(*DecodeFailure).<a.href= |
5ec0 | 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f | "/src/pkg/github.com/gconnell/go |
5ee0 | 70 61 63 6b 65 74 2f 64 65 63 6f 64 65 2e 67 6f 3f 73 3d 33 37 35 30 3a 33 37 39 35 23 4c 38 35 | packet/decode.go?s=3750:3795#L85 |
5f00 | 22 3e 4c 61 79 65 72 54 79 70 65 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 | ">LayerType</a></h3>.....<pre>fu |
5f20 | 6e 63 20 28 64 20 2a 44 65 63 6f 64 65 46 61 69 6c 75 72 65 29 20 4c 61 79 65 72 54 79 70 65 28 | nc.(d.*DecodeFailure).LayerType( |
5f40 | 29 20 4c 61 79 65 72 54 79 70 65 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 4c 61 79 65 72 54 | ).LayerType</pre>.....<p>.LayerT |
5f60 | 79 70 65 20 72 65 74 75 72 6e 73 20 4c 61 79 65 72 54 79 70 65 44 65 63 6f 64 65 46 61 69 6c 75 | ype.returns.LayerTypeDecodeFailu |
5f80 | 72 65 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 | re.</p>......................... |
5fa0 | 3c 68 33 20 69 64 3d 22 44 65 63 6f 64 65 46 61 69 6c 75 72 65 2e 53 74 72 69 6e 67 22 3e 66 75 | <h3.id="DecodeFailure.String">fu |
5fc0 | 6e 63 20 28 2a 44 65 63 6f 64 65 46 61 69 6c 75 72 65 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 | nc.(*DecodeFailure).<a.href="/sr |
5fe0 | 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b | c/pkg/github.com/gconnell/gopack |
6000 | 65 74 2f 64 65 63 6f 64 65 2e 67 6f 3f 73 3d 33 36 33 30 3a 33 36 36 39 23 4c 38 32 22 3e 53 74 | et/decode.go?s=3630:3669#L82">St |
6020 | 72 69 6e 67 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 64 20 2a | ring</a></h3>.....<pre>func.(d.* |
6040 | 44 65 63 6f 64 65 46 61 69 6c 75 72 65 29 20 53 74 72 69 6e 67 28 29 20 73 74 72 69 6e 67 3c 2f | DecodeFailure).String().string</ |
6060 | 70 72 65 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 | pre>............................ |
6080 | 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 44 65 63 6f 64 65 46 75 6e 63 22 3e 74 79 70 65 20 3c | ......<h2.id="DecodeFunc">type.< |
60a0 | 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e | a.href="/src/pkg/github.com/gcon |
60c0 | 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 64 65 63 6f 64 65 2e 67 6f 3f 73 3d 32 31 30 34 3a 32 | nell/gopacket/decode.go?s=2104:2 |
60e0 | 31 35 33 23 4c 34 36 22 3e 44 65 63 6f 64 65 46 75 6e 63 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 | 153#L46">DecodeFunc</a></h2>.... |
6100 | 3c 70 72 65 3e 74 79 70 65 20 44 65 63 6f 64 65 46 75 6e 63 20 66 75 6e 63 28 5b 5d 62 79 74 65 | <pre>type.DecodeFunc.func([]byte |
6120 | 2c 20 50 61 63 6b 65 74 42 75 69 6c 64 65 72 29 20 65 72 72 6f 72 3c 2f 70 72 65 3e 0a 09 09 09 | ,.PacketBuilder).error</pre>.... |
6140 | 3c 70 3e 0a 44 65 63 6f 64 65 46 75 6e 63 20 77 72 61 70 73 20 61 20 66 75 6e 63 74 69 6f 6e 20 | <p>.DecodeFunc.wraps.a.function. |
6160 | 74 6f 20 6d 61 6b 65 20 69 74 20 61 20 44 65 63 6f 64 65 72 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 | to.make.it.a.Decoder..</p>...... |
6180 | 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 | ..............................<h |
61a0 | 33 20 69 64 3d 22 44 65 63 6f 64 65 46 75 6e 63 2e 44 65 63 6f 64 65 22 3e 66 75 6e 63 20 28 44 | 3.id="DecodeFunc.Decode">func.(D |
61c0 | 65 63 6f 64 65 46 75 6e 63 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 | ecodeFunc).<a.href="/src/pkg/git |
61e0 | 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 64 65 63 6f 64 65 | hub.com/gconnell/gopacket/decode |
6200 | 2e 67 6f 3f 73 3d 32 31 35 35 3a 32 32 31 37 23 4c 34 38 22 3e 44 65 63 6f 64 65 3c 2f 61 3e 3c | .go?s=2155:2217#L48">Decode</a>< |
6220 | 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 64 20 44 65 63 6f 64 65 46 75 6e 63 | /h3>.....<pre>func.(d.DecodeFunc |
6240 | 29 20 44 65 63 6f 64 65 28 64 61 74 61 20 5b 5d 62 79 74 65 2c 20 70 20 50 61 63 6b 65 74 42 75 | ).Decode(data.[]byte,.p.PacketBu |
6260 | 69 6c 64 65 72 29 20 65 72 72 6f 72 3c 2f 70 72 65 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 | ilder).error</pre>.............. |
6280 | 09 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 44 65 63 6f | ....................<h2.id="Deco |
62a0 | 64 65 4f 70 74 69 6f 6e 73 22 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b | deOptions">type.<a.href="/src/pk |
62c0 | 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 70 | g/github.com/gconnell/gopacket/p |
62e0 | 61 63 6b 65 74 2e 67 6f 3f 73 3d 38 33 31 39 3a 38 39 39 30 23 4c 33 30 38 22 3e 44 65 63 6f 64 | acket.go?s=8319:8990#L308">Decod |
6300 | 65 4f 70 74 69 6f 6e 73 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 65 3e 74 79 70 65 20 44 | eOptions</a></h2>....<pre>type.D |
6320 | 65 63 6f 64 65 4f 70 74 69 6f 6e 73 20 73 74 72 75 63 74 20 7b 0a 20 20 20 20 3c 73 70 61 6e 20 | ecodeOptions.struct.{.....<span. |
6340 | 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 4c 61 7a 79 20 64 65 63 6f 64 69 6e 67 | class="comment">//.Lazy.decoding |
6360 | 20 64 65 63 6f 64 65 73 20 74 68 65 20 6d 69 6e 69 6d 75 6d 20 6e 75 6d 62 65 72 20 6f 66 20 6c | .decodes.the.minimum.number.of.l |
6380 | 61 79 65 72 73 20 6e 65 65 64 65 64 20 74 6f 20 72 65 74 75 72 6e 20 64 61 74 61 3c 2f 73 70 61 | ayers.needed.to.return.data</spa |
63a0 | 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 | n>.....<span.class="comment">//. |
63c0 | 66 6f 72 20 61 20 70 61 63 6b 65 74 20 61 74 20 65 61 63 68 20 66 75 6e 63 74 69 6f 6e 20 63 61 | for.a.packet.at.each.function.ca |
63e0 | 6c 6c 2e 20 20 42 65 20 63 61 72 65 66 75 6c 20 75 73 69 6e 67 20 74 68 69 73 20 77 69 74 68 20 | ll...Be.careful.using.this.with. |
6400 | 63 6f 6e 63 75 72 72 65 6e 74 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 | concurrent</span>.....<span.clas |
6420 | 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 70 61 63 6b 65 74 20 70 72 6f 63 65 73 73 6f 72 73 | s="comment">//.packet.processors |
6440 | 2c 20 61 73 20 65 61 63 68 20 63 61 6c 6c 20 74 6f 20 70 61 63 6b 65 74 2e 2a 20 63 6f 75 6c 64 | ,.as.each.call.to.packet.*.could |
6460 | 20 6d 75 74 61 74 65 20 74 68 65 20 70 61 63 6b 65 74 2c 20 61 6e 64 3c 2f 73 70 61 6e 3e 0a 20 | .mutate.the.packet,.and</span>.. |
6480 | 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 74 77 6f 20 | ...<span.class="comment">//.two. |
64a0 | 63 6f 6e 63 75 72 72 65 6e 74 20 66 75 6e 63 74 69 6f 6e 20 63 61 6c 6c 73 20 63 6f 75 6c 64 20 | concurrent.function.calls.could. |
64c0 | 69 6e 74 65 72 61 63 74 20 70 6f 6f 72 6c 79 2e 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 4c 61 7a 79 | interact.poorly.</span>.....Lazy |
64e0 | 20 62 6f 6f 6c 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e | .bool.....<span.class="comment"> |
6500 | 2f 2f 20 4e 6f 43 6f 70 79 20 64 65 63 6f 64 69 6e 67 20 64 6f 65 73 6e 26 23 33 39 3b 74 20 63 | //.NoCopy.decoding.doesn't.c |
6520 | 6f 70 79 20 69 74 73 20 69 6e 70 75 74 20 62 75 66 66 65 72 20 69 6e 74 6f 20 73 74 6f 72 61 67 | opy.its.input.buffer.into.storag |
6540 | 65 20 74 68 61 74 26 23 33 39 3b 73 20 6f 77 6e 65 64 20 62 79 3c 2f 73 70 61 6e 3e 0a 20 20 20 | e.that's.owned.by</span>.... |
6560 | 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 74 68 65 20 70 61 | .<span.class="comment">//.the.pa |
6580 | 63 6b 65 74 2e 20 20 49 66 20 79 6f 75 20 63 61 6e 20 67 75 61 72 61 6e 74 65 65 20 74 68 61 74 | cket...If.you.can.guarantee.that |
65a0 | 20 74 68 65 20 62 79 74 65 73 20 75 6e 64 65 72 6c 79 69 6e 67 20 74 68 65 20 73 6c 69 63 65 3c | .the.bytes.underlying.the.slice< |
65c0 | 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 | /span>.....<span.class="comment" |
65e0 | 3e 2f 2f 20 70 61 73 73 65 64 20 69 6e 74 6f 20 4e 65 77 50 61 63 6b 65 74 20 61 72 65 6e 26 23 | >//.passed.into.NewPacket.aren&# |
6600 | 33 39 3b 74 20 67 6f 69 6e 67 20 74 6f 20 62 65 20 6d 6f 64 69 66 69 65 64 2c 20 74 68 69 73 20 | 39;t.going.to.be.modified,.this. |
6620 | 63 61 6e 20 62 65 20 66 61 73 74 65 72 2e 20 20 49 66 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 | can.be.faster...If</span>.....<s |
6640 | 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 74 68 65 72 65 26 23 33 39 | pan.class="comment">//.there' |
6660 | 3b 73 20 61 6e 79 20 63 68 61 6e 63 65 20 74 68 61 74 20 74 68 6f 73 65 20 62 79 74 65 73 20 57 | ;s.any.chance.that.those.bytes.W |
6680 | 49 4c 4c 20 62 65 20 63 68 61 6e 67 65 64 2c 20 74 68 69 73 20 77 69 6c 6c 20 69 6e 76 61 6c 69 | ILL.be.changed,.this.will.invali |
66a0 | 64 61 74 65 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d | date</span>.....<span.class="com |
66c0 | 6d 65 6e 74 22 3e 2f 2f 20 79 6f 75 72 20 70 61 63 6b 65 74 73 2e 3c 2f 73 70 61 6e 3e 0a 20 20 | ment">//.your.packets.</span>... |
66e0 | 20 20 4e 6f 43 6f 70 79 20 62 6f 6f 6c 0a 7d 3c 2f 70 72 65 3e 0a 09 09 09 3c 70 3e 0a 44 65 63 | ..NoCopy.bool.}</pre>....<p>.Dec |
6700 | 6f 64 65 4f 70 74 69 6f 6e 73 20 74 65 6c 6c 73 20 67 6f 70 61 63 6b 65 74 20 68 6f 77 20 74 6f | odeOptions.tells.gopacket.how.to |
6720 | 20 64 65 63 6f 64 65 20 61 20 70 61 63 6b 65 74 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a 09 09 | .decode.a.packet..</p>.......... |
6740 | 09 0a 09 09 09 09 3c 70 72 65 3e 76 61 72 20 44 65 66 61 75 6c 74 20 44 65 63 6f 64 65 4f 70 74 | ......<pre>var.Default.DecodeOpt |
6760 | 69 6f 6e 73 20 3d 20 44 65 63 6f 64 65 4f 70 74 69 6f 6e 73 7b 7d 3c 2f 70 72 65 3e 0a 09 09 09 | ions.=.DecodeOptions{}</pre>.... |
6780 | 09 3c 70 3e 0a 44 65 66 61 75 6c 74 20 64 65 63 6f 64 69 6e 67 20 70 72 6f 76 69 64 65 73 20 74 | .<p>.Default.decoding.provides.t |
67a0 | 68 65 20 73 61 66 65 73 74 20 28 62 75 74 20 73 6c 6f 77 65 73 74 29 20 6d 65 74 68 6f 64 20 66 | he.safest.(but.slowest).method.f |
67c0 | 6f 72 20 64 65 63 6f 64 69 6e 67 0a 70 61 63 6b 65 74 73 2e 20 20 49 74 20 65 61 67 65 72 6c 79 | or.decoding.packets...It.eagerly |
67e0 | 20 70 72 6f 63 65 73 73 65 73 20 61 6c 6c 20 6c 61 79 65 72 73 20 28 73 6f 20 69 74 26 23 33 39 | .processes.all.layers.(so.it' |
6800 | 3b 73 20 63 6f 6e 63 75 72 72 65 6e 63 79 2d 73 61 66 65 29 20 61 6e 64 20 69 74 0a 63 6f 70 69 | ;s.concurrency-safe).and.it.copi |
6820 | 65 73 20 69 74 73 20 69 6e 70 75 74 20 62 75 66 66 65 72 20 75 70 6f 6e 20 63 72 65 61 74 69 6f | es.its.input.buffer.upon.creatio |
6840 | 6e 20 6f 66 20 74 68 65 20 70 61 63 6b 65 74 20 28 73 6f 20 74 68 65 20 70 61 63 6b 65 74 20 72 | n.of.the.packet.(so.the.packet.r |
6860 | 65 6d 61 69 6e 73 0a 76 61 6c 69 64 20 69 66 20 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 20 73 | emains.valid.if.the.underlying.s |
6880 | 6c 69 63 65 20 69 73 20 6d 6f 64 69 66 69 65 64 2e 20 20 42 6f 74 68 20 6f 66 20 74 68 65 73 65 | lice.is.modified...Both.of.these |
68a0 | 20 74 61 6b 65 20 74 69 6d 65 2c 0a 74 68 6f 75 67 68 2c 20 73 6f 20 62 65 77 61 72 65 2e 20 20 | .take.time,.though,.so.beware... |
68c0 | 49 66 20 79 6f 75 20 63 61 6e 20 67 75 61 72 61 6e 74 65 65 20 74 68 61 74 20 74 68 65 20 70 61 | If.you.can.guarantee.that.the.pa |
68e0 | 63 6b 65 74 20 77 69 6c 6c 20 6f 6e 6c 79 20 62 65 20 75 73 65 64 0a 62 79 20 6f 6e 65 20 67 6f | cket.will.only.be.used.by.one.go |
6900 | 72 6f 75 74 69 6e 65 20 61 74 20 61 20 74 69 6d 65 2c 20 73 65 74 20 4c 61 7a 79 20 64 65 63 6f | routine.at.a.time,.set.Lazy.deco |
6920 | 64 69 6e 67 2e 20 20 49 66 20 79 6f 75 20 63 61 6e 20 67 75 61 72 61 6e 74 65 65 20 74 68 61 74 | ding...If.you.can.guarantee.that |
6940 | 0a 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 20 73 6c 69 63 65 20 77 6f 6e 26 23 33 39 3b 74 20 | .the.underlying.slice.won't. |
6960 | 63 68 61 6e 67 65 2c 20 73 65 74 20 4e 6f 43 6f 70 79 20 64 65 63 6f 64 69 6e 67 2e 0a 3c 2f 70 | change,.set.NoCopy.decoding..</p |
6980 | 3e 0a 0a 09 09 09 0a 09 09 09 09 3c 70 72 65 3e 76 61 72 20 4c 61 7a 79 20 44 65 63 6f 64 65 4f | >..........<pre>var.Lazy.DecodeO |
69a0 | 70 74 69 6f 6e 73 20 3d 20 44 65 63 6f 64 65 4f 70 74 69 6f 6e 73 7b 4c 61 7a 79 3a 20 74 72 75 | ptions.=.DecodeOptions{Lazy:.tru |
69c0 | 65 7d 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 4c 61 7a 79 20 69 73 20 61 20 44 65 63 6f 64 | e}</pre>.....<p>.Lazy.is.a.Decod |
69e0 | 65 4f 70 74 69 6f 6e 73 20 77 69 74 68 20 6a 75 73 74 20 4c 61 7a 79 20 73 65 74 2e 0a 3c 2f 70 | eOptions.with.just.Lazy.set..</p |
6a00 | 3e 0a 0a 09 09 09 0a 09 09 09 09 3c 70 72 65 3e 76 61 72 20 4e 6f 43 6f 70 79 20 44 65 63 6f 64 | >..........<pre>var.NoCopy.Decod |
6a20 | 65 4f 70 74 69 6f 6e 73 20 3d 20 44 65 63 6f 64 65 4f 70 74 69 6f 6e 73 7b 4e 6f 43 6f 70 79 3a | eOptions.=.DecodeOptions{NoCopy: |
6a40 | 20 74 72 75 65 7d 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 4e 6f 43 6f 70 79 20 69 73 20 61 | .true}</pre>.....<p>.NoCopy.is.a |
6a60 | 20 44 65 63 6f 64 65 4f 70 74 69 6f 6e 73 20 77 69 74 68 20 6a 75 73 74 20 4e 6f 43 6f 70 79 20 | .DecodeOptions.with.just.NoCopy. |
6a80 | 73 65 74 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 | set..</p>....................... |
6aa0 | 0a 09 09 09 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 44 65 63 6f 64 65 72 22 3e 74 79 70 | ............<h2.id="Decoder">typ |
6ac0 | 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 | e.<a.href="/src/pkg/github.com/g |
6ae0 | 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 64 65 63 6f 64 65 2e 67 6f 3f 73 3d 31 37 37 | connell/gopacket/decode.go?s=177 |
6b00 | 38 3a 32 30 34 39 23 4c 33 38 22 3e 44 65 63 6f 64 65 72 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 | 8:2049#L38">Decoder</a></h2>.... |
6b20 | 3c 70 72 65 3e 74 79 70 65 20 44 65 63 6f 64 65 72 20 69 6e 74 65 72 66 61 63 65 20 7b 0a 20 20 | <pre>type.Decoder.interface.{... |
6b40 | 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 44 65 63 6f 64 | ..<span.class="comment">//.Decod |
6b60 | 65 20 64 65 63 6f 64 65 73 20 74 68 65 20 62 79 74 65 73 20 6f 66 20 61 20 70 61 63 6b 65 74 2c | e.decodes.the.bytes.of.a.packet, |
6b80 | 20 73 65 6e 64 69 6e 67 20 64 65 63 6f 64 65 64 20 76 61 6c 75 65 73 20 61 6e 64 20 6f 74 68 65 | .sending.decoded.values.and.othe |
6ba0 | 72 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e | r</span>.....<span.class="commen |
6bc0 | 74 22 3e 2f 2f 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 74 6f 20 50 61 63 6b 65 74 42 75 69 6c 64 | t">//.information.to.PacketBuild |
6be0 | 65 72 2c 20 61 6e 64 20 72 65 74 75 72 6e 69 6e 67 20 61 6e 20 65 72 72 6f 72 20 69 66 20 75 6e | er,.and.returning.an.error.if.un |
6c00 | 73 75 63 63 65 73 73 66 75 6c 2e 20 20 53 65 65 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 | successful...See</span>.....<spa |
6c20 | 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 74 68 65 20 50 61 63 6b 65 74 42 | n.class="comment">//.the.PacketB |
6c40 | 75 69 6c 64 65 72 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 66 6f 72 20 6d 6f 72 65 20 64 65 | uilder.documentation.for.more.de |
6c60 | 74 61 69 6c 73 2e 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 44 65 63 6f 64 65 28 5b 5d 62 79 74 65 2c | tails.</span>.....Decode([]byte, |
6c80 | 20 50 61 63 6b 65 74 42 75 69 6c 64 65 72 29 20 65 72 72 6f 72 0a 7d 3c 2f 70 72 65 3e 0a 09 09 | .PacketBuilder).error.}</pre>... |
6ca0 | 09 3c 70 3e 0a 44 65 63 6f 64 65 72 20 69 73 20 61 6e 20 69 6e 74 65 72 66 61 63 65 20 66 6f 72 | .<p>.Decoder.is.an.interface.for |
6cc0 | 20 6c 6f 67 69 63 20 74 6f 20 64 65 63 6f 64 65 20 61 20 70 61 63 6b 65 74 20 6c 61 79 65 72 2e | .logic.to.decode.a.packet.layer. |
6ce0 | 20 20 55 73 65 72 73 20 6d 61 79 0a 69 6d 70 6c 65 6d 65 6e 74 20 61 20 44 65 63 6f 64 65 72 20 | ..Users.may.implement.a.Decoder. |
6d00 | 74 6f 20 68 61 6e 64 6c 65 20 74 68 65 69 72 20 6f 77 6e 20 73 74 72 61 6e 67 65 20 70 61 63 6b | to.handle.their.own.strange.pack |
6d20 | 65 74 20 74 79 70 65 73 2c 20 6f 72 20 6d 61 79 20 75 73 65 20 6f 6e 65 0a 6f 66 20 74 68 65 20 | et.types,.or.may.use.one.of.the. |
6d40 | 6d 61 6e 79 20 64 65 63 6f 64 65 72 73 20 61 76 61 69 6c 61 62 6c 65 20 69 6e 20 74 68 65 20 26 | many.decoders.available.in.the.& |
6d60 | 23 33 39 3b 6c 61 79 65 72 73 26 23 33 39 3b 20 73 75 62 70 61 63 6b 61 67 65 20 74 6f 20 64 65 | #39;layers'.subpackage.to.de |
6d80 | 63 6f 64 65 20 74 68 69 6e 67 73 0a 66 6f 72 20 74 68 65 6d 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 | code.things.for.them..</p>...... |
6da0 | 0a 0a 09 09 09 0a 09 09 09 09 3c 70 72 65 3e 76 61 72 20 44 65 63 6f 64 65 50 61 79 6c 6f 61 64 | ..........<pre>var.DecodePayload |
6dc0 | 20 44 65 63 6f 64 65 72 20 3d 20 44 65 63 6f 64 65 46 75 6e 63 28 64 65 63 6f 64 65 50 61 79 6c | .Decoder.=.DecodeFunc(decodePayl |
6de0 | 6f 61 64 29 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 44 65 63 6f 64 65 50 61 79 6c 6f 61 64 | oad)</pre>.....<p>.DecodePayload |
6e00 | 20 69 73 20 61 20 44 65 63 6f 64 65 72 20 74 68 61 74 20 72 65 74 75 72 6e 73 20 61 20 50 61 79 | .is.a.Decoder.that.returns.a.Pay |
6e20 | 6c 6f 61 64 20 6c 61 79 65 72 20 63 6f 6e 74 61 69 6e 69 6e 67 20 61 6c 6c 0a 72 65 6d 61 69 6e | load.layer.containing.all.remain |
6e40 | 69 6e 67 20 62 79 74 65 73 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 0a 09 09 09 09 3c 70 72 65 3e 76 61 | ing.bytes..</p>..........<pre>va |
6e60 | 72 20 44 65 63 6f 64 65 55 6e 6b 6e 6f 77 6e 20 44 65 63 6f 64 65 72 20 3d 20 44 65 63 6f 64 65 | r.DecodeUnknown.Decoder.=.Decode |
6e80 | 46 75 6e 63 28 64 65 63 6f 64 65 55 6e 6b 6e 6f 77 6e 29 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 | Func(decodeUnknown)</pre>.....<p |
6ea0 | 3e 0a 44 65 63 6f 64 65 55 6e 6b 6e 6f 77 6e 20 69 73 20 61 20 44 65 63 6f 64 65 72 20 74 68 61 | >.DecodeUnknown.is.a.Decoder.tha |
6ec0 | 74 20 72 65 74 75 72 6e 73 20 61 20 44 65 63 6f 64 65 46 61 69 6c 75 72 65 20 6c 61 79 65 72 20 | t.returns.a.DecodeFailure.layer. |
6ee0 | 63 6f 6e 74 61 69 6e 69 6e 67 20 61 6c 6c 0a 72 65 6d 61 69 6e 69 6e 67 20 62 79 74 65 73 2c 20 | containing.all.remaining.bytes,. |
6f00 | 75 73 65 66 75 6c 20 69 66 20 79 6f 75 20 72 75 6e 20 75 70 20 61 67 61 69 6e 73 74 20 61 20 6c | useful.if.you.run.up.against.a.l |
6f20 | 61 79 65 72 20 74 68 61 74 20 79 6f 75 26 23 33 39 3b 72 65 20 75 6e 61 62 6c 65 20 74 6f 0a 64 | ayer.that.you're.unable.to.d |
6f40 | 65 63 6f 64 65 20 79 65 74 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a | ecode.yet..</p>................. |
6f60 | 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 45 6e 64 70 6f 69 | ..................<h2.id="Endpoi |
6f80 | 6e 74 22 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 | nt">type.<a.href="/src/pkg/githu |
6fa0 | 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f | b.com/gconnell/gopacket/flows.go |
6fc0 | 3f 73 3d 33 31 30 3a 33 36 34 23 4c 35 22 3e 45 6e 64 70 6f 69 6e 74 3c 2f 61 3e 3c 2f 68 32 3e | ?s=310:364#L5">Endpoint</a></h2> |
6fe0 | 0a 09 09 09 3c 70 72 65 3e 74 79 70 65 20 45 6e 64 70 6f 69 6e 74 20 73 74 72 75 63 74 20 7b 0a | ....<pre>type.Endpoint.struct.{. |
7000 | 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 63 6f 6e | ....<span.class="comment">//.con |
7020 | 74 61 69 6e 73 20 66 69 6c 74 65 72 65 64 20 6f 72 20 75 6e 65 78 70 6f 72 74 65 64 20 66 69 65 | tains.filtered.or.unexported.fie |
7040 | 6c 64 73 3c 2f 73 70 61 6e 3e 0a 7d 3c 2f 70 72 65 3e 0a 09 09 09 3c 70 3e 0a 45 6e 64 70 6f 69 | lds</span>.}</pre>....<p>.Endpoi |
7060 | 6e 74 20 69 73 20 74 68 65 20 73 65 74 20 6f 66 20 62 79 74 65 73 20 75 73 65 64 20 74 6f 20 61 | nt.is.the.set.of.bytes.used.to.a |
7080 | 64 64 72 65 73 73 20 70 61 63 6b 65 74 73 20 61 74 20 76 61 72 69 6f 75 73 20 6c 61 79 65 72 73 | ddress.packets.at.various.layers |
70a0 | 2e 0a 53 65 65 20 4c 69 6e 6b 4c 61 79 65 72 2c 20 4e 65 74 77 6f 72 6b 4c 61 79 65 72 2c 20 61 | ..See.LinkLayer,.NetworkLayer,.a |
70c0 | 6e 64 20 54 72 61 6e 73 70 6f 72 74 4c 61 79 65 72 20 73 70 65 63 69 66 69 63 61 74 69 6f 6e 73 | nd.TransportLayer.specifications |
70e0 | 2e 0a 45 6e 64 70 6f 69 6e 74 73 20 61 72 65 20 75 73 61 62 6c 65 20 61 73 20 6d 61 70 20 6b 65 | ..Endpoints.are.usable.as.map.ke |
7100 | 79 73 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 | ys..</p>........................ |
7120 | 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 4e 65 77 45 6e 64 70 6f 69 6e 74 22 3e 66 75 6e 63 | .......<h3.id="NewEndpoint">func |
7140 | 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 | .<a.href="/src/pkg/github.com/gc |
7160 | 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 3f 73 3d 31 31 36 34 3a | onnell/gopacket/flows.go?s=1164: |
7180 | 31 32 31 39 23 4c 32 36 22 3e 4e 65 77 45 6e 64 70 6f 69 6e 74 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 | 1219#L26">NewEndpoint</a></h3>.. |
71a0 | 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 4e 65 77 45 6e 64 70 6f 69 6e 74 28 74 79 70 20 45 6e 64 | ...<pre>func.NewEndpoint(typ.End |
71c0 | 70 6f 69 6e 74 54 79 70 65 2c 20 72 61 77 20 5b 5d 62 79 74 65 29 20 45 6e 64 70 6f 69 6e 74 3c | pointType,.raw.[]byte).Endpoint< |
71e0 | 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 4e 65 77 45 6e 64 70 6f 69 6e 74 20 63 72 65 61 74 65 | /pre>.....<p>.NewEndpoint.create |
7200 | 73 20 61 20 6e 65 77 20 45 6e 64 70 6f 69 6e 74 20 6f 62 6a 65 63 74 2e 0a 3c 2f 70 3e 0a 0a 09 | s.a.new.Endpoint.object..</p>... |
7220 | 09 09 09 0a 09 09 09 0a 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 45 6e | ......................<h3.id="En |
7240 | 64 70 6f 69 6e 74 2e 45 6e 64 70 6f 69 6e 74 54 79 70 65 22 3e 66 75 6e 63 20 28 45 6e 64 70 6f | dpoint.EndpointType">func.(Endpo |
7260 | 69 6e 74 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f | int).<a.href="/src/pkg/github.co |
7280 | 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 3f 73 3d 34 | m/gconnell/gopacket/flows.go?s=4 |
72a0 | 33 39 3a 34 38 34 23 4c 31 31 22 3e 45 6e 64 70 6f 69 6e 74 54 79 70 65 3c 2f 61 3e 3c 2f 68 33 | 39:484#L11">EndpointType</a></h3 |
72c0 | 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 65 20 45 6e 64 70 6f 69 6e 74 29 20 45 6e 64 | >.....<pre>func.(e.Endpoint).End |
72e0 | 70 6f 69 6e 74 54 79 70 65 28 29 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 3c 2f 70 72 65 3e 0a 09 | pointType().EndpointType</pre>.. |
7300 | 09 09 09 3c 70 3e 0a 45 6e 64 70 6f 69 6e 74 54 79 70 65 20 72 65 74 75 72 6e 73 20 74 68 65 20 | ...<p>.EndpointType.returns.the. |
7320 | 65 6e 64 70 6f 69 6e 74 20 74 79 70 65 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 74 68 | endpoint.type.associated.with.th |
7340 | 69 73 20 65 6e 64 70 6f 69 6e 74 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 | is.endpoint..</p>............... |
7360 | 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 45 6e 64 70 6f 69 6e 74 2e 4c 65 73 73 54 | ..........<h3.id="Endpoint.LessT |
7380 | 68 61 6e 22 3e 66 75 6e 63 20 28 45 6e 64 70 6f 69 6e 74 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 | han">func.(Endpoint).<a.href="/s |
73a0 | 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 | rc/pkg/github.com/gconnell/gopac |
73c0 | 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 3f 73 3d 31 30 31 30 3a 31 30 35 33 23 4c 32 31 22 3e 4c 65 | ket/flows.go?s=1010:1053#L21">Le |
73e0 | 73 73 54 68 61 6e 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 61 | ssThan</a></h3>.....<pre>func.(a |
7400 | 20 45 6e 64 70 6f 69 6e 74 29 20 4c 65 73 73 54 68 61 6e 28 62 20 45 6e 64 70 6f 69 6e 74 29 20 | .Endpoint).LessThan(b.Endpoint). |
7420 | 62 6f 6f 6c 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 4c 65 73 73 54 68 61 6e 20 70 72 6f 76 | bool</pre>.....<p>.LessThan.prov |
7440 | 69 64 65 73 20 61 20 73 74 61 62 6c 65 20 6f 72 64 65 72 69 6e 67 20 66 6f 72 20 61 6c 6c 20 65 | ides.a.stable.ordering.for.all.e |
7460 | 6e 64 70 6f 69 6e 74 73 2e 20 20 49 74 20 73 6f 72 74 73 20 66 69 72 73 74 20 62 61 73 65 64 0a | ndpoints...It.sorts.first.based. |
7480 | 6f 6e 20 74 68 65 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 20 6f 66 20 61 6e 20 65 6e 64 70 6f 69 | on.the.EndpointType.of.an.endpoi |
74a0 | 6e 74 2c 20 74 68 65 6e 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 72 61 77 20 62 79 74 65 73 20 | nt,.then.based.on.the.raw.bytes. |
74c0 | 6f 66 20 74 68 61 74 20 65 6e 64 70 6f 69 6e 74 2e 0a 46 6f 72 20 73 6f 6d 65 20 65 6e 64 70 6f | of.that.endpoint..For.some.endpo |
74e0 | 69 6e 74 73 2c 20 74 68 65 20 61 63 74 75 61 6c 20 63 6f 6d 70 61 72 69 73 6f 6e 20 6d 61 79 20 | ints,.the.actual.comparison.may. |
7500 | 6e 6f 74 20 6d 61 6b 65 20 73 65 6e 73 65 2c 20 68 6f 77 65 76 65 72 20 74 68 69 73 0a 6f 72 64 | not.make.sense,.however.this.ord |
7520 | 65 72 69 6e 67 20 64 6f 65 73 20 70 72 6f 76 69 64 65 20 75 73 65 66 75 6c 20 69 6e 66 6f 72 6d | ering.does.provide.useful.inform |
7540 | 61 74 69 6f 6e 20 66 6f 72 20 6d 6f 73 74 20 45 6e 64 70 6f 69 6e 74 20 74 79 70 65 73 2e 0a 3c | ation.for.most.Endpoint.types..< |
7560 | 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 | /p>.........................<h3. |
7580 | 69 64 3d 22 45 6e 64 70 6f 69 6e 74 2e 52 61 77 22 3e 66 75 6e 63 20 28 45 6e 64 70 6f 69 6e 74 | id="Endpoint.Raw">func.(Endpoint |
75a0 | 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 | ).<a.href="/src/pkg/github.com/g |
75c0 | 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 3f 73 3d 36 34 31 3a | connell/gopacket/flows.go?s=641: |
75e0 | 36 37 31 23 4c 31 35 22 3e 52 61 77 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 | 671#L15">Raw</a></h3>.....<pre>f |
7600 | 75 6e 63 20 28 65 20 45 6e 64 70 6f 69 6e 74 29 20 52 61 77 28 29 20 5b 5d 62 79 74 65 3c 2f 70 | unc.(e.Endpoint).Raw().[]byte</p |
7620 | 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 52 61 77 20 72 65 74 75 72 6e 73 20 74 68 65 20 72 61 77 20 | re>.....<p>.Raw.returns.the.raw. |
7640 | 62 79 74 65 73 20 6f 66 20 74 68 69 73 20 65 6e 64 70 6f 69 6e 74 2e 20 20 54 68 65 73 65 20 61 | bytes.of.this.endpoint...These.a |
7660 | 72 65 6e 26 23 33 39 3b 74 20 68 75 6d 61 6e 2d 72 65 61 64 61 62 6c 65 0a 6d 6f 73 74 20 6f 66 | ren't.human-readable.most.of |
7680 | 20 74 68 65 20 74 69 6d 65 2c 20 62 75 74 20 74 68 65 79 20 61 72 65 20 66 61 73 74 65 72 20 74 | .the.time,.but.they.are.faster.t |
76a0 | 68 61 6e 20 63 61 6c 6c 69 6e 67 20 53 74 72 69 6e 67 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 | han.calling.String..</p>........ |
76c0 | 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 45 6e 64 70 6f 69 6e | .................<h3.id="Endpoin |
76e0 | 74 2e 53 74 72 69 6e 67 22 3e 66 75 6e 63 20 28 45 6e 64 70 6f 69 6e 74 29 20 3c 61 20 68 72 65 | t.String">func.(Endpoint).<a.hre |
7700 | 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f | f="/src/pkg/github.com/gconnell/ |
7720 | 67 6f 70 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 3f 73 3d 32 33 36 39 3a 32 34 30 32 23 4c 36 | gopacket/flows.go?s=2369:2402#L6 |
7740 | 34 22 3e 53 74 72 69 6e 67 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 | 4">String</a></h3>.....<pre>func |
7760 | 20 28 65 20 45 6e 64 70 6f 69 6e 74 29 20 53 74 72 69 6e 67 28 29 20 73 74 72 69 6e 67 3c 2f 70 | .(e.Endpoint).String().string</p |
7780 | 72 65 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 | re>............................. |
77a0 | 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 45 6e 64 70 6f 69 6e 74 54 79 70 65 22 3e 74 79 70 65 20 | .....<h2.id="EndpointType">type. |
77c0 | 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f | <a.href="/src/pkg/github.com/gco |
77e0 | 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 3f 73 3d 31 37 34 36 3a 31 | nnell/gopacket/flows.go?s=1746:1 |
7800 | 37 36 39 23 4c 34 31 22 3e 45 6e 64 70 6f 69 6e 74 54 79 70 65 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 | 769#L41">EndpointType</a></h2>.. |
7820 | 09 09 3c 70 72 65 3e 74 79 70 65 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 20 69 6e 74 36 34 3c 2f | ..<pre>type.EndpointType.int64</ |
7840 | 70 72 65 3e 0a 09 09 09 3c 70 3e 0a 45 6e 64 70 6f 69 6e 74 54 79 70 65 20 69 73 20 74 68 65 20 | pre>....<p>.EndpointType.is.the. |
7860 | 74 79 70 65 20 6f 66 20 61 20 67 6f 70 61 63 6b 65 74 20 45 6e 64 70 6f 69 6e 74 2e 20 20 54 68 | type.of.a.gopacket.Endpoint...Th |
7880 | 69 73 20 74 79 70 65 20 64 65 74 65 72 6d 69 6e 65 73 20 68 6f 77 0a 74 68 65 20 62 79 74 65 73 | is.type.determines.how.the.bytes |
78a0 | 20 73 74 6f 72 65 64 20 69 6e 20 74 68 65 20 65 6e 64 70 6f 69 6e 74 20 73 68 6f 75 6c 64 20 62 | .stored.in.the.endpoint.should.b |
78c0 | 65 20 69 6e 74 65 72 70 72 65 74 65 64 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a | e.interpreted..</p>............. |
78e0 | 09 09 09 0a 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 52 65 67 69 73 74 | ..................<h3.id="Regist |
7900 | 65 72 45 6e 64 70 6f 69 6e 74 54 79 70 65 22 3e 66 75 6e 63 20 3c 61 20 68 72 65 66 3d 22 2f 73 | erEndpointType">func.<a.href="/s |
7920 | 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 | rc/pkg/github.com/gconnell/gopac |
7940 | 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 3f 73 3d 32 30 31 37 3a 32 30 39 31 23 4c 34 38 22 3e 52 65 | ket/flows.go?s=2017:2091#L48">Re |
7960 | 67 69 73 74 65 72 45 6e 64 70 6f 69 6e 74 54 79 70 65 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 | gisterEndpointType</a></h3>..... |
7980 | 3c 70 72 65 3e 66 75 6e 63 20 52 65 67 69 73 74 65 72 45 6e 64 70 6f 69 6e 74 54 79 70 65 28 6e | <pre>func.RegisterEndpointType(n |
79a0 | 75 6d 20 69 6e 74 2c 20 6d 65 74 61 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 4d 65 74 61 64 61 74 | um.int,.meta.EndpointTypeMetadat |
79c0 | 61 29 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 52 65 | a).EndpointType</pre>.....<p>.Re |
79e0 | 67 69 73 74 65 72 45 6e 64 70 6f 69 6e 74 54 79 70 65 20 63 72 65 61 74 65 73 20 61 20 6e 65 77 | gisterEndpointType.creates.a.new |
7a00 | 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 20 61 6e 64 20 72 65 67 69 73 74 65 72 73 20 69 74 20 67 | .EndpointType.and.registers.it.g |
7a20 | 6c 6f 62 61 6c 6c 79 2e 0a 49 74 20 4d 55 53 54 20 62 65 20 70 61 73 73 65 64 20 61 20 75 6e 69 | lobally..It.MUST.be.passed.a.uni |
7a40 | 71 75 65 20 6e 75 6d 62 65 72 2c 20 6f 72 20 69 74 20 77 69 6c 6c 20 70 61 6e 69 63 2e 20 20 4e | que.number,.or.it.will.panic...N |
7a60 | 75 6d 62 65 72 73 20 30 2d 39 39 39 20 61 72 65 0a 72 65 73 65 72 76 65 64 20 66 6f 72 20 67 6f | umbers.0-999.are.reserved.for.go |
7a80 | 70 61 63 6b 65 74 26 23 33 39 3b 73 20 75 73 65 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 | packet's.use..</p>.......... |
7aa0 | 0a 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 45 6e 64 70 6f 69 6e 74 54 | ...............<h3.id="EndpointT |
7ac0 | 79 70 65 2e 53 74 72 69 6e 67 22 3e 66 75 6e 63 20 28 45 6e 64 70 6f 69 6e 74 54 79 70 65 29 20 | ype.String">func.(EndpointType). |
7ae0 | 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f | <a.href="/src/pkg/github.com/gco |
7b00 | 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 3f 73 3d 32 32 34 32 3a 32 | nnell/gopacket/flows.go?s=2242:2 |
7b20 | 32 37 39 23 4c 35 37 22 3e 53 74 72 69 6e 67 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 | 279#L57">String</a></h3>.....<pr |
7b40 | 65 3e 66 75 6e 63 20 28 65 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 29 20 53 74 72 69 6e 67 28 29 | e>func.(e.EndpointType).String() |
7b60 | 20 73 74 72 69 6e 67 3c 2f 70 72 65 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 | .string</pre>................... |
7b80 | 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 45 6e 64 70 6f 69 6e 74 54 | ...............<h2.id="EndpointT |
7ba0 | 79 70 65 4d 65 74 61 64 61 74 61 22 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f | ypeMetadata">type.<a.href="/src/ |
7bc0 | 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 | pkg/github.com/gconnell/gopacket |
7be0 | 2f 66 6c 6f 77 73 2e 67 6f 3f 73 3d 31 33 32 35 3a 31 36 30 37 23 4c 33 31 22 3e 45 6e 64 70 6f | /flows.go?s=1325:1607#L31">Endpo |
7c00 | 69 6e 74 54 79 70 65 4d 65 74 61 64 61 74 61 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 65 | intTypeMetadata</a></h2>....<pre |
7c20 | 3e 74 79 70 65 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 4d 65 74 61 64 61 74 61 20 73 74 72 75 63 | >type.EndpointTypeMetadata.struc |
7c40 | 74 20 7b 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f | t.{.....<span.class="comment">// |
7c60 | 20 4e 61 6d 65 20 69 73 20 74 68 65 20 73 74 72 69 6e 67 20 72 65 74 75 72 6e 65 64 20 62 79 20 | .Name.is.the.string.returned.by. |
7c80 | 61 6e 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 26 23 33 39 3b 73 20 53 74 72 69 6e 67 20 66 75 6e | an.EndpointType's.String.fun |
7ca0 | 63 74 69 6f 6e 2e 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 4e 61 6d 65 20 73 74 72 69 6e 67 0a 20 20 | ction.</span>.....Name.string... |
7cc0 | 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 46 6f 72 6d 61 | ..<span.class="comment">//.Forma |
7ce0 | 74 74 65 72 20 69 73 20 63 61 6c 6c 65 64 20 66 72 6f 6d 20 61 6e 20 45 6e 64 70 6f 69 6e 74 26 | tter.is.called.from.an.Endpoint& |
7d00 | 23 33 39 3b 73 20 53 74 72 69 6e 67 20 66 75 6e 63 74 69 6f 6e 20 74 6f 20 66 6f 72 6d 61 74 20 | #39;s.String.function.to.format. |
7d20 | 74 68 65 20 72 61 77 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 | the.raw</span>.....<span.class=" |
7d40 | 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 62 79 74 65 73 20 69 6e 20 61 6e 20 45 6e 64 70 6f 69 6e 74 | comment">//.bytes.in.an.Endpoint |
7d60 | 20 69 6e 74 6f 20 61 20 68 75 6d 61 6e 2d 72 65 61 64 61 62 6c 65 20 73 74 72 69 6e 67 2e 3c 2f | .into.a.human-readable.string.</ |
7d80 | 73 70 61 6e 3e 0a 20 20 20 20 46 6f 72 6d 61 74 74 65 72 20 66 75 6e 63 28 5b 5d 62 79 74 65 29 | span>.....Formatter.func([]byte) |
7da0 | 20 73 74 72 69 6e 67 0a 7d 3c 2f 70 72 65 3e 0a 09 09 09 3c 70 3e 0a 45 6e 64 70 6f 69 6e 74 54 | .string.}</pre>....<p>.EndpointT |
7dc0 | 79 70 65 4d 65 74 61 64 61 74 61 20 69 73 20 75 73 65 64 20 74 6f 20 72 65 67 69 73 74 65 72 20 | ypeMetadata.is.used.to.register. |
7de0 | 61 20 6e 65 77 20 65 6e 64 70 6f 69 6e 74 20 74 79 70 65 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a | a.new.endpoint.type..</p>....... |
7e00 | 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 | ................................ |
7e20 | 09 09 3c 68 32 20 69 64 3d 22 45 72 72 6f 72 4c 61 79 65 72 22 3e 74 79 70 65 20 3c 61 20 68 72 | ..<h2.id="ErrorLayer">type.<a.hr |
7e40 | 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c | ef="/src/pkg/github.com/gconnell |
7e60 | 2f 67 6f 70 61 63 6b 65 74 2f 62 61 73 65 2e 67 6f 3f 73 3d 32 34 36 36 3a 32 35 31 37 23 4c 36 | /gopacket/base.go?s=2466:2517#L6 |
7e80 | 35 22 3e 45 72 72 6f 72 4c 61 79 65 72 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 65 3e 74 | 5">ErrorLayer</a></h2>....<pre>t |
7ea0 | 79 70 65 20 45 72 72 6f 72 4c 61 79 65 72 20 69 6e 74 65 72 66 61 63 65 20 7b 0a 20 20 20 20 4c | ype.ErrorLayer.interface.{.....L |
7ec0 | 61 79 65 72 0a 20 20 20 20 45 72 72 6f 72 28 29 20 65 72 72 6f 72 0a 7d 3c 2f 70 72 65 3e 0a 09 | ayer.....Error().error.}</pre>.. |
7ee0 | 09 09 3c 70 3e 0a 45 72 72 6f 72 4c 61 79 65 72 20 69 73 20 61 20 70 61 63 6b 65 74 20 6c 61 79 | ..<p>.ErrorLayer.is.a.packet.lay |
7f00 | 65 72 20 63 72 65 61 74 65 64 20 77 68 65 6e 20 64 65 63 6f 64 69 6e 67 20 6f 66 20 74 68 65 20 | er.created.when.decoding.of.the. |
7f20 | 70 61 63 6b 65 74 20 68 61 73 20 66 61 69 6c 65 64 2e 0a 49 74 73 20 70 61 79 6c 6f 61 64 20 69 | packet.has.failed..Its.payload.i |
7f40 | 73 20 61 6c 6c 20 74 68 65 20 62 79 74 65 73 20 74 68 61 74 20 77 65 20 77 65 72 65 20 75 6e 61 | s.all.the.bytes.that.we.were.una |
7f60 | 62 6c 65 20 74 6f 20 64 65 63 6f 64 65 2c 20 61 6e 64 20 74 68 65 20 72 65 74 75 72 6e 65 64 0a | ble.to.decode,.and.the.returned. |
7f80 | 65 72 72 6f 72 20 64 65 74 61 69 6c 73 20 77 68 79 20 74 68 65 20 64 65 63 6f 64 69 6e 67 20 66 | error.details.why.the.decoding.f |
7fa0 | 61 69 6c 65 64 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 | ailed..</p>..................... |
7fc0 | 0a 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 46 6c 6f 77 | ....................<h2.id="Flow |
7fe0 | 22 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e | ">type.<a.href="/src/pkg/github. |
8000 | 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 3f 73 | com/gconnell/gopacket/flows.go?s |
8020 | 3d 32 36 38 37 3a 32 37 34 37 23 4c 37 33 22 3e 46 6c 6f 77 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 | =2687:2747#L73">Flow</a></h2>... |
8040 | 09 3c 70 72 65 3e 74 79 70 65 20 46 6c 6f 77 20 73 74 72 75 63 74 20 7b 0a 20 20 20 20 3c 73 70 | .<pre>type.Flow.struct.{.....<sp |
8060 | 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 63 6f 6e 74 61 69 6e 73 20 66 | an.class="comment">//.contains.f |
8080 | 69 6c 74 65 72 65 64 20 6f 72 20 75 6e 65 78 70 6f 72 74 65 64 20 66 69 65 6c 64 73 3c 2f 73 70 | iltered.or.unexported.fields</sp |
80a0 | 61 6e 3e 0a 7d 3c 2f 70 72 65 3e 0a 09 09 09 3c 70 3e 0a 46 6c 6f 77 20 72 65 70 72 65 73 65 6e | an>.}</pre>....<p>.Flow.represen |
80c0 | 74 73 20 74 68 65 20 64 69 72 65 63 74 69 6f 6e 20 6f 66 20 74 72 61 66 66 69 63 20 66 6f 72 20 | ts.the.direction.of.traffic.for. |
80e0 | 61 20 70 61 63 6b 65 74 20 6c 61 79 65 72 2c 20 61 73 20 61 20 73 6f 75 72 63 65 20 61 6e 64 20 | a.packet.layer,.as.a.source.and. |
8100 | 64 65 73 74 69 6e 61 74 69 6f 6e 20 45 6e 64 70 6f 69 6e 74 2e 0a 46 6c 6f 77 73 20 61 72 65 20 | destination.Endpoint..Flows.are. |
8120 | 75 73 61 62 6c 65 20 61 73 20 6d 61 70 20 6b 65 79 73 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a | usable.as.map.keys..</p>........ |
8140 | 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 46 | .......................<h3.id="F |
8160 | 6c 6f 77 46 72 6f 6d 45 6e 64 70 6f 69 6e 74 73 22 3e 66 75 6e 63 20 3c 61 20 68 72 65 66 3d 22 | lowFromEndpoints">func.<a.href=" |
8180 | 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 | /src/pkg/github.com/gconnell/gop |
81a0 | 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 3f 73 3d 32 39 31 36 3a 32 39 37 37 23 4c 38 31 22 3e | acket/flows.go?s=2916:2977#L81"> |
81c0 | 46 6c 6f 77 46 72 6f 6d 45 6e 64 70 6f 69 6e 74 73 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c | FlowFromEndpoints</a></h3>.....< |
81e0 | 70 72 65 3e 66 75 6e 63 20 46 6c 6f 77 46 72 6f 6d 45 6e 64 70 6f 69 6e 74 73 28 73 72 63 2c 20 | pre>func.FlowFromEndpoints(src,. |
8200 | 64 73 74 20 45 6e 64 70 6f 69 6e 74 29 20 28 5f 20 46 6c 6f 77 2c 20 65 72 72 20 65 72 72 6f 72 | dst.Endpoint).(_.Flow,.err.error |
8220 | 29 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 46 6c 6f 77 46 72 6f 6d 45 6e 64 70 6f 69 6e 74 | )</pre>.....<p>.FlowFromEndpoint |
8240 | 73 20 63 72 65 61 74 65 73 20 61 20 6e 65 77 20 66 6c 6f 77 20 62 79 20 70 61 73 74 69 6e 67 20 | s.creates.a.new.flow.by.pasting. |
8260 | 74 6f 67 65 74 68 65 72 20 74 77 6f 20 65 6e 64 70 6f 69 6e 74 73 2e 0a 54 68 65 20 65 6e 64 70 | together.two.endpoints..The.endp |
8280 | 6f 69 6e 74 73 20 6d 75 73 74 20 68 61 76 65 20 74 68 65 20 73 61 6d 65 20 45 6e 64 70 6f 69 6e | oints.must.have.the.same.Endpoin |
82a0 | 74 54 79 70 65 2c 20 6f 72 20 74 68 69 73 20 66 75 6e 63 74 69 6f 6e 20 77 69 6c 6c 20 72 65 74 | tType,.or.this.function.will.ret |
82c0 | 75 72 6e 0a 61 6e 20 65 72 72 6f 72 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 | urn.an.error..</p>.............. |
82e0 | 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 4e 65 77 46 6c 6f 77 22 3e 66 75 6e 63 20 3c 61 20 68 | ......<h3.id="NewFlow">func.<a.h |
8300 | 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c | ref="/src/pkg/github.com/gconnel |
8320 | 6c 2f 67 6f 70 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 3f 73 3d 33 39 38 38 3a 34 30 33 38 23 | l/gopacket/flows.go?s=3988:4038# |
8340 | 4c 31 32 33 22 3e 4e 65 77 46 6c 6f 77 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e | L123">NewFlow</a></h3>.....<pre> |
8360 | 66 75 6e 63 20 4e 65 77 46 6c 6f 77 28 74 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 2c 20 73 72 63 | func.NewFlow(t.EndpointType,.src |
8380 | 2c 20 64 73 74 20 5b 5d 62 79 74 65 29 20 46 6c 6f 77 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e | ,.dst.[]byte).Flow</pre>.....<p> |
83a0 | 0a 4e 65 77 46 6c 6f 77 20 63 72 65 61 74 65 73 20 61 20 6e 65 77 20 66 6c 6f 77 2e 0a 3c 2f 70 | .NewFlow.creates.a.new.flow..</p |
83c0 | 3e 0a 0a 09 09 09 09 0a 09 09 09 0a 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 | >.........................<h3.id |
83e0 | 3d 22 46 6c 6f 77 2e 44 73 74 22 3e 66 75 6e 63 20 28 46 6c 6f 77 29 20 3c 61 20 68 72 65 66 3d | ="Flow.Dst">func.(Flow).<a.href= |
8400 | 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f | "/src/pkg/github.com/gconnell/go |
8420 | 70 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 3f 73 3d 33 37 36 32 3a 33 37 39 36 23 4c 31 31 32 | packet/flows.go?s=3762:3796#L112 |
8440 | 22 3e 44 73 74 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 66 20 | ">Dst</a></h3>.....<pre>func.(f. |
8460 | 46 6c 6f 77 29 20 44 73 74 28 29 20 28 64 73 74 20 45 6e 64 70 6f 69 6e 74 29 3c 2f 70 72 65 3e | Flow).Dst().(dst.Endpoint)</pre> |
8480 | 0a 09 09 09 09 3c 70 3e 0a 44 73 74 20 72 65 74 75 72 6e 73 20 74 68 65 20 64 65 73 74 69 6e 61 | .....<p>.Dst.returns.the.destina |
84a0 | 74 69 6f 6e 20 45 6e 64 70 6f 69 6e 74 20 66 6f 72 20 74 68 69 73 20 66 6c 6f 77 2e 0a 3c 2f 70 | tion.Endpoint.for.this.flow..</p |
84c0 | 3e 0a 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 | >.........................<h3.id |
84e0 | 3d 22 46 6c 6f 77 2e 45 6e 64 70 6f 69 6e 74 54 79 70 65 22 3e 66 75 6e 63 20 28 46 6c 6f 77 29 | ="Flow.EndpointType">func.(Flow) |
8500 | 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 | .<a.href="/src/pkg/github.com/gc |
8520 | 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 3f 73 3d 33 33 36 34 3a | onnell/gopacket/flows.go?s=3364: |
8540 | 33 34 30 35 23 4c 39 36 22 3e 45 6e 64 70 6f 69 6e 74 54 79 70 65 3c 2f 61 3e 3c 2f 68 33 3e 0a | 3405#L96">EndpointType</a></h3>. |
8560 | 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 66 20 46 6c 6f 77 29 20 45 6e 64 70 6f 69 6e 74 54 | ....<pre>func.(f.Flow).EndpointT |
8580 | 79 70 65 28 29 20 45 6e 64 70 6f 69 6e 74 54 79 70 65 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e | ype().EndpointType</pre>.....<p> |
85a0 | 0a 45 6e 64 70 6f 69 6e 74 54 79 70 65 20 72 65 74 75 72 6e 73 20 74 68 65 20 45 6e 64 70 6f 69 | .EndpointType.returns.the.Endpoi |
85c0 | 6e 74 54 79 70 65 20 66 6f 72 20 74 68 69 73 20 46 6c 6f 77 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 09 | ntType.for.this.Flow..</p>...... |
85e0 | 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 46 6c 6f 77 2e | ...................<h3.id="Flow. |
8600 | 45 6e 64 70 6f 69 6e 74 73 22 3e 66 75 6e 63 20 28 46 6c 6f 77 29 20 3c 61 20 68 72 65 66 3d 22 | Endpoints">func.(Flow).<a.href=" |
8620 | 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 | /src/pkg/github.com/gconnell/gop |
8640 | 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 3f 73 3d 33 34 37 39 3a 33 35 32 34 23 4c 31 30 31 22 | acket/flows.go?s=3479:3524#L101" |
8660 | 3e 45 6e 64 70 6f 69 6e 74 73 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e | >Endpoints</a></h3>.....<pre>fun |
8680 | 63 20 28 66 20 46 6c 6f 77 29 20 45 6e 64 70 6f 69 6e 74 73 28 29 20 28 73 72 63 2c 20 64 73 74 | c.(f.Flow).Endpoints().(src,.dst |
86a0 | 20 45 6e 64 70 6f 69 6e 74 29 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 45 6e 64 70 6f 69 6e | .Endpoint)</pre>.....<p>.Endpoin |
86c0 | 74 73 20 72 65 74 75 72 6e 73 20 74 68 65 20 74 77 6f 20 45 6e 64 70 6f 69 6e 74 73 20 66 6f 72 | ts.returns.the.two.Endpoints.for |
86e0 | 20 74 68 69 73 20 66 6c 6f 77 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a | .this.flow..</p>................ |
8700 | 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 46 6c 6f 77 2e 52 65 76 65 72 73 65 22 3e 66 | .........<h3.id="Flow.Reverse">f |
8720 | 75 6e 63 20 28 46 6c 6f 77 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 | unc.(Flow).<a.href="/src/pkg/git |
8740 | 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 66 6c 6f 77 73 2e | hub.com/gconnell/gopacket/flows. |
8760 | 67 6f 3f 73 3d 33 38 38 39 3a 33 39 31 37 23 4c 31 31 38 22 3e 52 65 76 65 72 73 65 3c 2f 61 3e | go?s=3889:3917#L118">Reverse</a> |
8780 | 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 66 20 46 6c 6f 77 29 20 52 65 76 | </h3>.....<pre>func.(f.Flow).Rev |
87a0 | 65 72 73 65 28 29 20 46 6c 6f 77 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 52 65 76 65 72 73 | erse().Flow</pre>.....<p>.Revers |
87c0 | 65 20 72 65 74 75 72 6e 73 20 61 20 6e 65 77 20 66 6c 6f 77 20 77 69 74 68 20 65 6e 64 70 6f 69 | e.returns.a.new.flow.with.endpoi |
87e0 | 6e 74 73 20 72 65 76 65 72 73 65 64 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 | nts.reversed..</p>.............. |
8800 | 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 46 6c 6f 77 2e 53 72 63 22 3e 66 75 6e | ...........<h3.id="Flow.Src">fun |
8820 | 63 20 28 46 6c 6f 77 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 | c.(Flow).<a.href="/src/pkg/githu |
8840 | 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f | b.com/gconnell/gopacket/flows.go |
8860 | 3f 73 3d 33 36 33 35 3a 33 36 36 39 23 4c 31 30 36 22 3e 53 72 63 3c 2f 61 3e 3c 2f 68 33 3e 0a | ?s=3635:3669#L106">Src</a></h3>. |
8880 | 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 66 20 46 6c 6f 77 29 20 53 72 63 28 29 20 28 73 72 | ....<pre>func.(f.Flow).Src().(sr |
88a0 | 63 20 45 6e 64 70 6f 69 6e 74 29 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 53 72 63 20 72 65 | c.Endpoint)</pre>.....<p>.Src.re |
88c0 | 74 75 72 6e 73 20 74 68 65 20 73 6f 75 72 63 65 20 45 6e 64 70 6f 69 6e 74 20 66 6f 72 20 74 68 | turns.the.source.Endpoint.for.th |
88e0 | 69 73 20 66 6c 6f 77 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 | is.flow..</p>................... |
8900 | 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 46 6c 6f 77 2e 53 74 72 69 6e 67 22 3e 66 75 6e 63 20 | ......<h3.id="Flow.String">func. |
8920 | 28 46 6c 6f 77 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e | (Flow).<a.href="/src/pkg/github. |
8940 | 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 66 6c 6f 77 73 2e 67 6f 3f 73 | com/gconnell/gopacket/flows.go?s |
8960 | 3d 33 32 32 39 3a 33 32 35 38 23 4c 39 31 22 3e 53 74 72 69 6e 67 3c 2f 61 3e 3c 2f 68 33 3e 0a | =3229:3258#L91">String</a></h3>. |
8980 | 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 66 20 46 6c 6f 77 29 20 53 74 72 69 6e 67 28 29 20 | ....<pre>func.(f.Flow).String(). |
89a0 | 73 74 72 69 6e 67 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 53 74 72 69 6e 67 20 72 65 74 75 | string</pre>.....<p>.String.retu |
89c0 | 72 6e 73 20 61 20 68 75 6d 61 6e 2d 72 65 61 64 61 62 6c 65 20 72 65 70 72 65 73 65 6e 74 61 74 | rns.a.human-readable.representat |
89e0 | 69 6f 6e 20 6f 66 20 74 68 69 73 20 66 6c 6f 77 2c 20 69 6e 20 74 68 65 20 66 6f 72 6d 0a 26 23 | ion.of.this.flow,.in.the.form.&# |
8a00 | 33 34 3b 53 72 63 2d 26 67 74 3b 44 73 74 26 23 33 34 3b 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 | 34;Src->Dst".</p>........ |
8a20 | 09 09 09 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 4c 61 | ......................<h2.id="La |
8a40 | 79 65 72 22 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 | yer">type.<a.href="/src/pkg/gith |
8a60 | 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 62 61 73 65 2e 67 6f | ub.com/gconnell/gopacket/base.go |
8a80 | 3f 73 3d 35 30 33 3a 38 33 37 23 4c 36 22 3e 4c 61 79 65 72 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 | ?s=503:837#L6">Layer</a></h2>... |
8aa0 | 09 3c 70 72 65 3e 74 79 70 65 20 4c 61 79 65 72 20 69 6e 74 65 72 66 61 63 65 20 7b 0a 20 20 20 | .<pre>type.Layer.interface.{.... |
8ac0 | 20 66 6d 74 2e 53 74 72 69 6e 67 65 72 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 | .fmt.Stringer.....<span.class="c |
8ae0 | 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 4c 61 79 65 72 54 79 70 65 20 69 73 20 74 68 65 20 67 6f 70 61 | omment">//.LayerType.is.the.gopa |
8b00 | 63 6b 65 74 20 74 79 70 65 20 66 6f 72 20 74 68 69 73 20 6c 61 79 65 72 2e 3c 2f 73 70 61 6e 3e | cket.type.for.this.layer.</span> |
8b20 | 0a 20 20 20 20 4c 61 79 65 72 54 79 70 65 28 29 20 4c 61 79 65 72 54 79 70 65 0a 20 20 20 20 3c | .....LayerType().LayerType.....< |
8b40 | 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 4c 61 79 65 72 43 6f 6e | span.class="comment">//.LayerCon |
8b60 | 74 65 6e 74 73 20 72 65 74 75 72 6e 73 20 74 68 65 20 73 65 74 20 6f 66 20 62 79 74 65 73 20 74 | tents.returns.the.set.of.bytes.t |
8b80 | 68 61 74 20 6d 61 6b 65 20 75 70 20 74 68 69 73 20 6c 61 79 65 72 2e 3c 2f 73 70 61 6e 3e 0a 20 | hat.make.up.this.layer.</span>.. |
8ba0 | 20 20 20 4c 61 79 65 72 43 6f 6e 74 65 6e 74 73 28 29 20 5b 5d 62 79 74 65 0a 20 20 20 20 3c 73 | ...LayerContents().[]byte.....<s |
8bc0 | 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 4c 61 79 65 72 50 61 79 6c | pan.class="comment">//.LayerPayl |
8be0 | 6f 61 64 20 72 65 74 75 72 6e 73 20 74 68 65 20 73 65 74 20 6f 66 20 62 79 74 65 73 20 63 6f 6e | oad.returns.the.set.of.bytes.con |
8c00 | 74 61 69 6e 65 64 20 77 69 74 68 69 6e 20 74 68 69 73 20 6c 61 79 65 72 2c 20 6e 6f 74 3c 2f 73 | tained.within.this.layer,.not</s |
8c20 | 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f | pan>.....<span.class="comment">/ |
8c40 | 2f 20 69 6e 63 6c 75 64 69 6e 67 20 74 68 65 20 6c 61 79 65 72 20 69 74 73 65 6c 66 2e 3c 2f 73 | /.including.the.layer.itself.</s |
8c60 | 70 61 6e 3e 0a 20 20 20 20 4c 61 79 65 72 50 61 79 6c 6f 61 64 28 29 20 5b 5d 62 79 74 65 0a 7d | pan>.....LayerPayload().[]byte.} |
8c80 | 3c 2f 70 72 65 3e 0a 09 09 09 3c 70 3e 0a 4c 61 79 65 72 20 72 65 70 72 65 73 65 6e 74 73 20 61 | </pre>....<p>.Layer.represents.a |
8ca0 | 20 73 69 6e 67 6c 65 20 64 65 63 6f 64 65 64 20 70 61 63 6b 65 74 20 6c 61 79 65 72 20 28 75 73 | .single.decoded.packet.layer.(us |
8cc0 | 69 6e 67 20 65 69 74 68 65 72 20 74 68 65 0a 4f 53 49 20 6f 72 20 54 43 50 2f 49 50 20 64 65 66 | ing.either.the.OSI.or.TCP/IP.def |
8ce0 | 69 6e 69 74 69 6f 6e 20 6f 66 20 61 20 6c 61 79 65 72 29 2e 20 20 57 68 65 6e 20 64 65 63 6f 64 | inition.of.a.layer)...When.decod |
8d00 | 69 6e 67 2c 20 61 20 70 61 63 6b 65 74 26 23 33 39 3b 73 20 64 61 74 61 20 69 73 0a 62 72 6f 6b | ing,.a.packet's.data.is.brok |
8d20 | 65 6e 20 75 70 20 69 6e 74 6f 20 61 20 6e 75 6d 62 65 72 20 6f 66 20 6c 61 79 65 72 73 2e 20 20 | en.up.into.a.number.of.layers... |
8d40 | 54 68 65 20 63 61 6c 6c 65 72 20 6d 61 79 20 63 61 6c 6c 20 4c 61 79 65 72 54 79 70 65 28 29 20 | The.caller.may.call.LayerType(). |
8d60 | 74 6f 0a 66 69 67 75 72 65 20 6f 75 74 20 77 68 69 63 68 20 74 79 70 65 20 6f 66 20 6c 61 79 65 | to.figure.out.which.type.of.laye |
8d80 | 72 20 68 65 26 23 33 39 3b 73 20 72 65 63 65 69 76 65 64 20 66 72 6f 6d 20 74 68 65 20 70 61 63 | r.he's.received.from.the.pac |
8da0 | 6b 65 74 2e 20 20 4f 70 74 69 6f 6e 61 6c 6c 79 2c 0a 68 65 20 6d 61 79 20 74 68 65 6e 20 75 73 | ket...Optionally,.he.may.then.us |
8dc0 | 65 20 61 20 74 79 70 65 20 61 73 73 65 72 74 69 6f 6e 20 74 6f 20 67 65 74 20 74 68 65 20 61 63 | e.a.type.assertion.to.get.the.ac |
8de0 | 74 75 61 6c 20 6c 61 79 65 72 20 74 79 70 65 20 66 6f 72 20 64 65 65 70 0a 69 6e 73 70 65 63 74 | tual.layer.type.for.deep.inspect |
8e00 | 69 6f 6e 20 6f 66 20 74 68 65 20 64 61 74 61 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a 09 09 09 | ion.of.the.data..</p>........... |
8e20 | 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 3c 68 | ..............................<h |
8e40 | 32 20 69 64 3d 22 4c 61 79 65 72 43 6c 61 73 73 22 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 | 2.id="LayerClass">type.<a.href=" |
8e60 | 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 | /src/pkg/github.com/gconnell/gop |
8e80 | 61 63 6b 65 74 2f 6c 61 79 65 72 63 6c 61 73 73 2e 67 6f 3f 73 3d 31 38 30 3a 33 33 36 23 4c 31 | acket/layerclass.go?s=180:336#L1 |
8ea0 | 22 3e 4c 61 79 65 72 43 6c 61 73 73 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 65 3e 74 79 | ">LayerClass</a></h2>....<pre>ty |
8ec0 | 70 65 20 4c 61 79 65 72 43 6c 61 73 73 20 69 6e 74 65 72 66 61 63 65 20 7b 0a 20 20 20 20 3c 73 | pe.LayerClass.interface.{.....<s |
8ee0 | 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 43 6f 6e 74 61 69 6e 73 20 | pan.class="comment">//.Contains. |
8f00 | 72 65 74 75 72 6e 73 20 74 72 75 65 20 69 66 20 74 68 65 20 67 69 76 65 6e 20 6c 61 79 65 72 20 | returns.true.if.the.given.layer. |
8f20 | 74 79 70 65 20 73 68 6f 75 6c 64 20 62 65 20 63 6f 6e 73 69 64 65 72 65 64 20 70 61 72 74 3c 2f | type.should.be.considered.part</ |
8f40 | 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e | span>.....<span.class="comment"> |
8f60 | 2f 2f 20 6f 66 20 74 68 69 73 20 6c 61 79 65 72 20 63 6c 61 73 73 2e 3c 2f 73 70 61 6e 3e 0a 20 | //.of.this.layer.class.</span>.. |
8f80 | 20 20 20 43 6f 6e 74 61 69 6e 73 28 4c 61 79 65 72 54 79 70 65 29 20 62 6f 6f 6c 0a 7d 3c 2f 70 | ...Contains(LayerType).bool.}</p |
8fa0 | 72 65 3e 0a 09 09 09 3c 70 3e 0a 4c 61 79 65 72 43 6c 61 73 73 20 69 73 20 61 20 73 65 74 20 6f | re>....<p>.LayerClass.is.a.set.o |
8fc0 | 66 20 4c 61 79 65 72 54 79 70 65 73 2c 20 75 73 65 64 20 66 6f 72 20 67 72 61 62 62 69 6e 67 20 | f.LayerTypes,.used.for.grabbing. |
8fe0 | 6f 6e 65 20 6f 66 20 61 20 6e 75 6d 62 65 72 20 6f 66 0a 64 69 66 66 65 72 65 6e 74 20 74 79 70 | one.of.a.number.of.different.typ |
9000 | 65 73 20 66 72 6f 6d 20 61 20 70 61 63 6b 65 74 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a 09 09 | es.from.a.packet..</p>.......... |
9020 | 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 4e 65 77 | .....................<h3.id="New |
9040 | 4c 61 79 65 72 43 6c 61 73 73 22 3e 66 75 6e 63 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 | LayerClass">func.<a.href="/src/p |
9060 | 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f | kg/github.com/gconnell/gopacket/ |
9080 | 6c 61 79 65 72 63 6c 61 73 73 2e 67 6f 3f 73 3d 31 37 32 32 3a 31 37 37 30 23 4c 35 31 22 3e 4e | layerclass.go?s=1722:1770#L51">N |
90a0 | 65 77 4c 61 79 65 72 43 6c 61 73 73 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 | ewLayerClass</a></h3>.....<pre>f |
90c0 | 75 6e 63 20 4e 65 77 4c 61 79 65 72 43 6c 61 73 73 28 74 79 70 65 73 20 5b 5d 4c 61 79 65 72 54 | unc.NewLayerClass(types.[]LayerT |
90e0 | 79 70 65 29 20 4c 61 79 65 72 43 6c 61 73 73 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 4e 65 | ype).LayerClass</pre>.....<p>.Ne |
9100 | 77 4c 61 79 65 72 43 6c 61 73 73 20 63 72 65 61 74 65 73 20 61 20 4c 61 79 65 72 43 6c 61 73 73 | wLayerClass.creates.a.LayerClass |
9120 | 2c 20 61 74 74 65 6d 70 74 69 6e 67 20 74 6f 20 62 65 20 73 6d 61 72 74 20 61 62 6f 75 74 20 77 | ,.attempting.to.be.smart.about.w |
9140 | 68 69 63 68 20 74 79 70 65 0a 69 74 20 63 72 65 61 74 65 73 20 62 61 73 65 64 20 6f 6e 20 77 68 | hich.type.it.creates.based.on.wh |
9160 | 69 63 68 20 74 79 70 65 73 20 61 72 65 20 70 61 73 73 65 64 20 69 6e 2e 0a 3c 2f 70 3e 0a 0a 09 | ich.types.are.passed.in..</p>... |
9180 | 09 09 09 0a 09 09 09 0a 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 | ...........................<h2.i |
91a0 | 64 3d 22 4c 61 79 65 72 43 6c 61 73 73 4d 61 70 22 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 | d="LayerClassMap">type.<a.href=" |
91c0 | 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 | /src/pkg/github.com/gconnell/gop |
91e0 | 61 63 6b 65 74 2f 6c 61 79 65 72 63 6c 61 73 73 2e 67 6f 3f 73 3d 31 31 35 32 3a 31 31 38 39 23 | acket/layerclass.go?s=1152:1189# |
9200 | 4c 33 31 22 3e 4c 61 79 65 72 43 6c 61 73 73 4d 61 70 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 3c | L31">LayerClassMap</a></h2>....< |
9220 | 70 72 65 3e 74 79 70 65 20 4c 61 79 65 72 43 6c 61 73 73 4d 61 70 20 6d 61 70 5b 4c 61 79 65 72 | pre>type.LayerClassMap.map[Layer |
9240 | 54 79 70 65 5d 62 6f 6f 6c 3c 2f 70 72 65 3e 0a 09 09 09 3c 70 3e 0a 4c 61 79 65 72 43 6c 61 73 | Type]bool</pre>....<p>.LayerClas |
9260 | 73 4d 61 70 20 69 6d 70 6c 65 6d 65 6e 74 73 20 61 20 4c 61 79 65 72 43 6c 61 73 73 20 77 69 74 | sMap.implements.a.LayerClass.wit |
9280 | 68 20 61 20 6d 61 70 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 | h.a.map..</p>................... |
92a0 | 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 4e 65 77 4c 61 79 65 72 43 6c 61 73 | ............<h3.id="NewLayerClas |
92c0 | 73 4d 61 70 22 3e 66 75 6e 63 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 | sMap">func.<a.href="/src/pkg/git |
92e0 | 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 6c 61 79 65 72 63 | hub.com/gconnell/gopacket/layerc |
9300 | 6c 61 73 73 2e 67 6f 3f 73 3d 31 34 35 33 3a 31 35 30 37 23 4c 34 31 22 3e 4e 65 77 4c 61 79 65 | lass.go?s=1453:1507#L41">NewLaye |
9320 | 72 43 6c 61 73 73 4d 61 70 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c d8 b2 e9 50 8f 0c 07 00 | rClassMap</a></h3>.....<...P.... |
9340 | 04 40 00 00 04 40 00 00 1e 00 00 00 60 01 88 91 3f d8 06 40 00 00 00 00 00 00 00 00 00 00 00 00 | .@...@......`...?..@............ |
9360 | 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 1f 90 e5 af 0a 65 f6 5f 08 97 18 4a | .........................e._...J |
9380 | 80 10 23 02 3f e0 00 00 01 01 08 0a 05 c0 8d b6 05 c0 8c fc 70 72 65 3e 66 75 6e 63 20 4e 65 77 | ..#.?...............pre>func.New |
93a0 | 4c 61 79 65 72 43 6c 61 73 73 4d 61 70 28 74 79 70 65 73 20 5b 5d 4c 61 79 65 72 54 79 70 65 29 | LayerClassMap(types.[]LayerType) |
93c0 | 20 4c 61 79 65 72 43 6c 61 73 73 4d 61 70 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 4e 65 77 | .LayerClassMap</pre>.....<p>.New |
93e0 | 4c 61 79 65 72 43 6c 61 73 73 4d 61 70 20 63 72 65 61 74 65 73 20 61 20 4c 61 79 65 72 43 6c 61 | LayerClassMap.creates.a.LayerCla |
9400 | 73 73 4d 61 70 20 61 6e 64 20 73 65 74 73 20 6d 61 70 5b 74 5d 20 74 6f 20 74 72 75 65 20 66 6f | ssMap.and.sets.map[t].to.true.fo |
9420 | 72 20 65 61 63 68 0a 74 79 70 65 20 69 6e 20 74 79 70 65 73 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 09 | r.each.type.in.types..</p>...... |
9440 | 0a 09 09 09 0a 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 4c 61 79 65 72 | ...................<h3.id="Layer |
9460 | 43 6c 61 73 73 4d 61 70 2e 43 6f 6e 74 61 69 6e 73 22 3e 66 75 6e 63 20 28 4c 61 79 65 72 43 6c | ClassMap.Contains">func.(LayerCl |
9480 | 61 73 73 4d 61 70 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 | assMap).<a.href="/src/pkg/github |
94a0 | 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 6c 61 79 65 72 63 6c 61 73 | .com/gconnell/gopacket/layerclas |
94c0 | 73 2e 67 6f 3f 73 3d 31 32 39 30 3a 31 33 33 39 23 4c 33 35 22 3e 43 6f 6e 74 61 69 6e 73 3c 2f | s.go?s=1290:1339#L35">Contains</ |
94e0 | 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 6d 20 4c 61 79 65 72 43 6c | a></h3>.....<pre>func.(m.LayerCl |
9500 | 61 73 73 4d 61 70 29 20 43 6f 6e 74 61 69 6e 73 28 74 20 4c 61 79 65 72 54 79 70 65 29 20 62 6f | assMap).Contains(t.LayerType).bo |
9520 | 6f 6c 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 43 6f 6e 74 61 69 6e 73 20 72 65 74 75 72 6e | ol</pre>.....<p>.Contains.return |
9540 | 73 20 74 72 75 65 20 69 66 20 74 68 65 20 67 69 76 65 6e 20 6c 61 79 65 72 20 74 79 70 65 20 73 | s.true.if.the.given.layer.type.s |
9560 | 68 6f 75 6c 64 20 62 65 20 63 6f 6e 73 69 64 65 72 65 64 20 70 61 72 74 0a 6f 66 20 74 68 69 73 | hould.be.considered.part.of.this |
9580 | 20 6c 61 79 65 72 20 63 6c 61 73 73 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 | .layer.class..</p>.............. |
95a0 | 09 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 4c 61 79 65 72 43 6c 61 | ................<h2.id="LayerCla |
95c0 | 73 73 53 6c 69 63 65 22 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f | ssSlice">type.<a.href="/src/pkg/ |
95e0 | 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 6c 61 79 | github.com/gconnell/gopacket/lay |
9600 | 65 72 63 6c 61 73 73 2e 67 6f 3f 73 3d 33 39 35 3a 34 32 32 23 4c 34 22 3e 4c 61 79 65 72 43 6c | erclass.go?s=395:422#L4">LayerCl |
9620 | 61 73 73 53 6c 69 63 65 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 65 3e 74 79 70 65 20 4c | assSlice</a></h2>....<pre>type.L |
9640 | 61 79 65 72 43 6c 61 73 73 53 6c 69 63 65 20 5b 5d 62 6f 6f 6c 3c 2f 70 72 65 3e 0a 09 09 09 3c | ayerClassSlice.[]bool</pre>....< |
9660 | 70 3e 0a 4c 61 79 65 72 43 6c 61 73 73 53 6c 69 63 65 20 69 6d 70 6c 65 6d 65 6e 74 73 20 61 20 | p>.LayerClassSlice.implements.a. |
9680 | 4c 61 79 65 72 43 6c 61 73 73 20 77 69 74 68 20 61 20 73 6c 69 63 65 2e 0a 3c 2f 70 3e 0a 0a 0a | LayerClass.with.a.slice..</p>... |
96a0 | 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 | ............................<h3. |
96c0 | 69 64 3d 22 4e 65 77 4c 61 79 65 72 43 6c 61 73 73 53 6c 69 63 65 22 3e 66 75 6e 63 20 3c 61 20 | id="NewLayerClassSlice">func.<a. |
96e0 | 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 | href="/src/pkg/github.com/gconne |
9700 | 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 6c 61 79 65 72 63 6c 61 73 73 2e 67 6f 3f 73 3d 38 36 34 3a | ll/gopacket/layerclass.go?s=864: |
9720 | 39 32 32 23 4c 31 36 22 3e 4e 65 77 4c 61 79 65 72 43 6c 61 73 73 53 6c 69 63 65 3c 2f 61 3e 3c | 922#L16">NewLayerClassSlice</a>< |
9740 | 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 4e 65 77 4c 61 79 65 72 43 6c 61 73 73 | /h3>.....<pre>func.NewLayerClass |
9760 | 53 6c 69 63 65 28 74 79 70 65 73 20 5b 5d 4c 61 79 65 72 54 79 70 65 29 20 4c 61 79 65 72 43 6c | Slice(types.[]LayerType).LayerCl |
9780 | 61 73 73 53 6c 69 63 65 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 4e 65 77 4c 61 79 65 72 43 | assSlice</pre>.....<p>.NewLayerC |
97a0 | 6c 61 73 73 53 6c 69 63 65 20 63 72 65 61 74 65 73 20 61 20 6e 65 77 20 4c 61 79 65 72 43 6c 61 | lassSlice.creates.a.new.LayerCla |
97c0 | 73 73 53 6c 69 63 65 20 62 79 20 63 72 65 61 74 69 6e 67 20 61 20 73 6c 69 63 65 20 6f 66 0a 73 | ssSlice.by.creating.a.slice.of.s |
97e0 | 69 7a 65 20 6d 61 78 28 74 79 70 65 73 29 20 61 6e 64 20 73 65 74 74 69 6e 67 20 73 6c 69 63 65 | ize.max(types).and.setting.slice |
9800 | 5b 74 5d 20 74 6f 20 74 72 75 65 20 66 6f 72 20 65 61 63 68 20 74 79 70 65 20 74 2e 20 20 4e 6f | [t].to.true.for.each.type.t...No |
9820 | 74 65 2c 20 69 66 0a 79 6f 75 20 69 6d 70 6c 65 6d 65 6e 74 20 79 6f 75 72 20 6f 77 6e 20 4c 61 | te,.if.you.implement.your.own.La |
9840 | 79 65 72 54 79 70 65 20 61 6e 64 20 67 69 76 65 20 69 74 20 61 20 68 69 67 68 20 76 61 6c 75 65 | yerType.and.give.it.a.high.value |
9860 | 2c 20 74 68 69 73 20 57 49 4c 4c 20 63 72 65 61 74 65 0a 61 20 76 65 72 79 20 6c 61 72 67 65 20 | ,.this.WILL.create.a.very.large. |
9880 | 73 6c 69 63 65 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 0a 0a 09 09 09 0a 09 09 09 09 0a | slice..</p>..................... |
98a0 | 09 09 09 09 3c 68 33 20 69 64 3d 22 4c 61 79 65 72 43 6c 61 73 73 53 6c 69 63 65 2e 43 6f 6e 74 | ....<h3.id="LayerClassSlice.Cont |
98c0 | 61 69 6e 73 22 3e 66 75 6e 63 20 28 4c 61 79 65 72 43 6c 61 73 73 53 6c 69 63 65 29 20 3c 61 20 | ains">func.(LayerClassSlice).<a. |
98e0 | 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 | href="/src/pkg/github.com/gconne |
9900 | 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 6c 61 79 65 72 63 6c 61 73 73 2e 67 6f 3f 73 3d 35 32 33 3a | ll/gopacket/layerclass.go?s=523: |
9920 | 35 37 34 23 4c 38 22 3e 43 6f 6e 74 61 69 6e 73 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 | 574#L8">Contains</a></h3>.....<p |
9940 | 72 65 3e 66 75 6e 63 20 28 73 20 4c 61 79 65 72 43 6c 61 73 73 53 6c 69 63 65 29 20 43 6f 6e 74 | re>func.(s.LayerClassSlice).Cont |
9960 | 61 69 6e 73 28 74 20 4c 61 79 65 72 54 79 70 65 29 20 62 6f 6f 6c 3c 2f 70 72 65 3e 0a 09 09 09 | ains(t.LayerType).bool</pre>.... |
9980 | 09 3c 70 3e 0a 43 6f 6e 74 61 69 6e 73 20 72 65 74 75 72 6e 73 20 74 72 75 65 20 69 66 20 74 68 | .<p>.Contains.returns.true.if.th |
99a0 | 65 20 67 69 76 65 6e 20 6c 61 79 65 72 20 74 79 70 65 20 73 68 6f 75 6c 64 20 62 65 20 63 6f 6e | e.given.layer.type.should.be.con |
99c0 | 73 69 64 65 72 65 64 20 70 61 72 74 0a 6f 66 20 74 68 69 73 20 6c 61 79 65 72 20 63 6c 61 73 73 | sidered.part.of.this.layer.class |
99e0 | 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 09 | ..</p>.......................... |
9a00 | 0a 09 09 09 3c 68 32 20 69 64 3d 22 4c 61 79 65 72 54 79 70 65 22 3e 74 79 70 65 20 3c 61 20 68 | ....<h2.id="LayerType">type.<a.h |
9a20 | 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c | ref="/src/pkg/github.com/gconnel |
9a40 | 6c 2f 67 6f 70 61 63 6b 65 74 2f 6c 61 79 65 72 74 79 70 65 2e 67 6f 3f 73 3d 34 38 38 3a 35 30 | l/gopacket/layertype.go?s=488:50 |
9a60 | 38 23 4c 36 22 3e 4c 61 79 65 72 54 79 70 65 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 65 | 8#L6">LayerType</a></h2>....<pre |
9a80 | 3e 74 79 70 65 20 4c 61 79 65 72 54 79 70 65 20 69 6e 74 36 34 3c 2f 70 72 65 3e 0a 09 09 09 3c | >type.LayerType.int64</pre>....< |
9aa0 | 70 3e 0a 4c 61 79 65 72 54 79 70 65 20 69 73 20 61 20 75 6e 69 71 75 65 20 69 64 65 6e 74 69 66 | p>.LayerType.is.a.unique.identif |
9ac0 | 69 65 72 20 66 6f 72 20 65 61 63 68 20 74 79 70 65 20 6f 66 20 6c 61 79 65 72 2e 20 20 54 68 69 | ier.for.each.type.of.layer...Thi |
9ae0 | 73 20 65 6e 75 6d 65 72 61 74 69 6f 6e 0a 64 6f 65 73 20 6e 6f 74 20 6d 61 74 63 68 20 77 69 74 | s.enumeration.does.not.match.wit |
9b00 | 68 20 61 6e 79 20 65 78 74 65 72 6e 61 6c 6c 79 20 61 76 61 69 6c 61 62 6c 65 20 6e 75 6d 62 65 | h.any.externally.available.numbe |
9b20 | 72 69 6e 67 20 73 63 68 65 6d 65 2e 2e 2e 20 69 74 26 23 33 39 3b 73 20 73 6f 6c 65 6c 79 0a 75 | ring.scheme....it's.solely.u |
9b40 | 73 61 62 6c 65 2f 75 73 65 66 75 6c 20 77 69 74 68 69 6e 20 74 68 69 73 20 6c 69 62 72 61 72 79 | sable/useful.within.this.library |
9b60 | 20 61 73 20 61 20 6d 65 61 6e 73 20 66 6f 72 20 72 65 71 75 65 73 74 69 6e 67 20 6c 61 79 65 72 | .as.a.means.for.requesting.layer |
9b80 | 20 74 79 70 65 73 0a 28 73 65 65 20 50 61 63 6b 65 74 2e 4c 61 79 65 72 29 20 61 6e 64 20 64 65 | .types.(see.Packet.Layer).and.de |
9ba0 | 74 65 72 6d 69 6e 69 6e 67 20 77 68 69 63 68 20 74 79 70 65 73 20 6f 66 20 6c 61 79 65 72 73 20 | termining.which.types.of.layers. |
9bc0 | 68 61 76 65 20 62 65 65 6e 20 64 65 63 6f 64 65 64 2e 0a 3c 2f 70 3e 0a 3c 70 3e 0a 4e 65 77 20 | have.been.decoded..</p>.<p>.New. |
9be0 | 4c 61 79 65 72 54 79 70 65 73 20 6d 61 79 20 62 65 20 63 72 65 61 74 65 64 20 62 79 20 63 61 6c | LayerTypes.may.be.created.by.cal |
9c00 | 6c 69 6e 67 20 67 6f 70 61 63 6b 65 74 2e 52 65 67 69 73 74 65 72 4c 61 79 65 72 54 79 70 65 2e | ling.gopacket.RegisterLayerType. |
9c20 | 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 09 09 3c 70 72 65 3e 76 61 72 20 4c 61 | .</p>................<pre>var.La |
9c40 | 79 65 72 54 79 70 65 44 65 63 6f 64 65 46 61 69 6c 75 72 65 20 4c 61 79 65 72 54 79 70 65 20 3d | yerTypeDecodeFailure.LayerType.= |
9c60 | 20 52 65 67 69 73 74 65 72 4c 61 79 65 72 54 79 70 65 28 30 2c 20 4c 61 79 65 72 54 79 70 65 4d | .RegisterLayerType(0,.LayerTypeM |
9c80 | 65 74 61 64 61 74 61 7b 26 23 33 34 3b 44 65 63 6f 64 65 20 46 61 69 6c 75 72 65 26 23 33 34 3b | etadata{"Decode.Failure" |
9ca0 | 2c 20 44 65 63 6f 64 65 55 6e 6b 6e 6f 77 6e 7d 29 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a | ,.DecodeUnknown})</pre>.....<p>. |
9cc0 | 4c 61 79 65 72 54 79 70 65 44 65 63 6f 64 65 46 61 69 6c 75 72 65 20 69 73 20 74 68 65 20 6c 61 | LayerTypeDecodeFailure.is.the.la |
9ce0 | 79 65 72 20 74 79 70 65 20 66 6f 72 20 74 68 65 20 64 65 66 61 75 6c 74 20 65 72 72 6f 72 20 6c | yer.type.for.the.default.error.l |
9d00 | 61 79 65 72 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 0a 09 09 09 09 3c 70 72 65 3e 76 61 72 20 4c 61 79 | ayer..</p>..........<pre>var.Lay |
9d20 | 65 72 54 79 70 65 50 61 79 6c 6f 61 64 20 4c 61 79 65 72 54 79 70 65 20 3d 20 52 65 67 69 73 74 | erTypePayload.LayerType.=.Regist |
9d40 | 65 72 4c 61 79 65 72 54 79 70 65 28 31 2c 20 4c 61 79 65 72 54 79 70 65 4d 65 74 61 64 61 74 61 | erLayerType(1,.LayerTypeMetadata |
9d60 | 7b 26 23 33 34 3b 50 61 79 6c 6f 61 64 26 23 33 34 3b 2c 20 44 65 63 6f 64 65 50 61 79 6c 6f 61 | {"Payload",.DecodePayloa |
9d80 | 64 7d 29 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 4c 61 79 65 72 54 79 70 65 50 61 79 6c 6f | d})</pre>.....<p>.LayerTypePaylo |
9da0 | 61 64 20 69 73 20 74 68 65 20 6c 61 79 65 72 20 74 79 70 65 20 66 6f 72 20 61 20 70 61 79 6c 6f | ad.is.the.layer.type.for.a.paylo |
9dc0 | 61 64 20 74 68 61 74 20 77 65 20 64 6f 6e 26 23 33 39 3b 74 20 74 72 79 20 74 6f 20 64 65 63 6f | ad.that.we.don't.try.to.deco |
9de0 | 64 65 0a 62 75 74 20 74 72 65 61 74 20 61 73 20 61 20 73 75 63 63 65 73 73 2c 20 49 45 3a 20 61 | de.but.treat.as.a.success,.IE:.a |
9e00 | 6e 20 61 70 70 6c 69 63 61 74 69 6f 6e 2d 6c 65 76 65 6c 20 70 61 79 6c 6f 61 64 2e 0a 3c 2f 70 | n.application-level.payload..</p |
9e20 | 3e 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 | >.........................<h3.id |
9e40 | 3d 22 52 65 67 69 73 74 65 72 4c 61 79 65 72 54 79 70 65 22 3e 66 75 6e 63 20 3c 61 20 68 72 65 | ="RegisterLayerType">func.<a.hre |
9e60 | 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f | f="/src/pkg/github.com/gconnell/ |
9e80 | 67 6f 70 61 63 6b 65 74 2f 6c 61 79 65 72 74 79 70 65 2e 67 6f 3f 73 3d 31 34 35 37 3a 31 35 32 | gopacket/layertype.go?s=1457:152 |
9ea0 | 32 23 4c 33 34 22 3e 52 65 67 69 73 74 65 72 4c 61 79 65 72 54 79 70 65 3c 2f 61 3e 3c 2f 68 33 | 2#L34">RegisterLayerType</a></h3 |
9ec0 | 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 52 65 67 69 73 74 65 72 4c 61 79 65 72 54 79 70 | >.....<pre>func.RegisterLayerTyp |
9ee0 | 65 28 6e 75 6d 20 69 6e 74 2c 20 6d 65 74 61 20 4c 61 79 65 72 54 79 70 65 4d 65 74 61 64 61 74 | e(num.int,.meta.LayerTypeMetadat |
9f00 | 61 29 20 4c 61 79 65 72 54 79 70 65 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 52 65 67 69 73 | a).LayerType</pre>.....<p>.Regis |
9f20 | 74 65 72 4c 61 79 65 72 54 79 70 65 20 63 72 65 61 74 65 73 20 61 20 6e 65 77 20 6c 61 79 65 72 | terLayerType.creates.a.new.layer |
9f40 | 20 74 79 70 65 20 61 6e 64 20 72 65 67 69 73 74 65 72 73 20 69 74 20 67 6c 6f 62 61 6c 6c 79 2e | .type.and.registers.it.globally. |
9f60 | 0a 54 68 65 20 6e 75 6d 62 65 72 20 70 61 73 73 65 64 20 69 6e 20 6d 75 73 74 20 62 65 20 75 6e | .The.number.passed.in.must.be.un |
9f80 | 69 71 75 65 2c 20 6f 72 20 61 20 72 75 6e 74 69 6d 65 20 70 61 6e 69 63 20 77 69 6c 6c 20 6f 63 | ique,.or.a.runtime.panic.will.oc |
9fa0 | 63 75 72 2e 20 20 4e 75 6d 62 65 72 73 0a 30 2d 39 39 39 20 61 72 65 20 72 65 73 65 72 76 65 64 | cur...Numbers.0-999.are.reserved |
9fc0 | 20 66 6f 72 20 74 68 65 20 67 6f 70 61 63 6b 65 74 20 6c 69 62 72 61 72 79 2e 20 20 4e 75 6d 62 | .for.the.gopacket.library...Numb |
9fe0 | 65 72 73 20 31 30 30 30 2d 31 39 39 39 20 73 68 6f 75 6c 64 20 62 65 0a 75 73 65 64 20 66 6f 72 | ers.1000-1999.should.be.used.for |
a000 | 20 63 6f 6d 6d 6f 6e 20 61 70 70 6c 69 63 61 74 69 6f 6e 2d 73 70 65 63 69 66 69 63 20 74 79 70 | .common.application-specific.typ |
a020 | 65 73 2c 20 61 6e 64 20 61 72 65 20 76 65 72 79 20 66 61 73 74 2e 20 20 41 6e 79 20 6f 74 68 65 | es,.and.are.very.fast...Any.othe |
a040 | 72 0a 6e 75 6d 62 65 72 20 28 6e 65 67 61 74 69 76 65 20 6f 72 20 26 67 74 3b 3d 20 32 30 30 30 | r.number.(negative.or.>=.2000 |
a060 | 29 20 6d 61 79 20 62 65 20 75 73 65 64 20 66 6f 72 20 75 6e 63 6f 6d 6d 6f 6e 20 61 70 70 6c 69 | ).may.be.used.for.uncommon.appli |
a080 | 63 61 74 69 6f 6e 2d 73 70 65 63 69 66 69 63 0a 74 79 70 65 73 2c 20 61 6e 64 20 61 72 65 20 73 | cation-specific.types,.and.are.s |
a0a0 | 6f 6d 65 77 68 61 74 20 73 6c 6f 77 65 72 20 28 74 68 65 79 20 72 65 71 75 69 72 65 20 61 20 6d | omewhat.slower.(they.require.a.m |
a0c0 | 61 70 20 6c 6f 6f 6b 75 70 20 6f 76 65 72 20 61 6e 20 61 72 72 61 79 0a 69 6e 64 65 78 29 2e 0a | ap.lookup.over.an.array.index).. |
a0e0 | 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 0a 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 | </p>.........................<h3 |
a100 | 20 69 64 3d 22 4c 61 79 65 72 54 79 70 65 2e 44 65 63 6f 64 65 22 3e 66 75 6e 63 20 28 4c 61 79 | .id="LayerType.Decode">func.(Lay |
a120 | 65 72 54 79 70 65 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 | erType).<a.href="/src/pkg/github |
a140 | 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 6c 61 79 65 72 74 79 70 65 | .com/gconnell/gopacket/layertype |
a160 | 2e 67 6f 3f 73 3d 32 30 33 39 3a 32 31 30 30 23 4c 35 37 22 3e 44 65 63 6f 64 65 3c 2f 61 3e 3c | .go?s=2039:2100#L57">Decode</a>< |
a180 | 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 74 20 4c 61 79 65 72 54 79 70 65 29 | /h3>.....<pre>func.(t.LayerType) |
a1a0 | 20 44 65 63 6f 64 65 28 64 61 74 61 20 5b 5d 62 79 74 65 2c 20 63 20 50 61 63 6b 65 74 42 75 69 | .Decode(data.[]byte,.c.PacketBui |
a1c0 | 6c 64 65 72 29 20 65 72 72 6f 72 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 44 65 63 6f 64 65 | lder).error</pre>.....<p>.Decode |
a1e0 | 20 64 65 63 6f 64 65 73 20 74 68 65 20 67 69 76 65 6e 20 64 61 74 61 20 75 73 69 6e 67 20 74 68 | .decodes.the.given.data.using.th |
a200 | 65 20 64 65 63 6f 64 65 72 20 72 65 67 69 73 74 65 72 65 64 20 77 69 74 68 20 74 68 65 20 6c 61 | e.decoder.registered.with.the.la |
a220 | 79 65 72 0a 74 79 70 65 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 | yer.type..</p>.................. |
a240 | 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 4c 61 79 65 72 54 79 70 65 2e 53 74 72 69 6e 67 22 | .......<h3.id="LayerType.String" |
a260 | 3e 66 75 6e 63 20 28 4c 61 79 65 72 54 79 70 65 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f | >func.(LayerType).<a.href="/src/ |
a280 | 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 | pkg/github.com/gconnell/gopacket |
a2a0 | 2f 6c 61 79 65 72 74 79 70 65 2e 67 6f 3f 73 3d 32 34 30 35 3a 32 34 34 33 23 4c 37 31 22 3e 53 | /layertype.go?s=2405:2443#L71">S |
a2c0 | 74 72 69 6e 67 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 74 20 | tring</a></h3>.....<pre>func.(t. |
a2e0 | 4c 61 79 65 72 54 79 70 65 29 20 53 74 72 69 6e 67 28 29 20 28 73 20 73 74 72 69 6e 67 29 3c 2f | LayerType).String().(s.string)</ |
a300 | 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 53 74 72 69 6e 67 20 72 65 74 75 72 6e 73 20 74 68 65 20 | pre>.....<p>.String.returns.the. |
a320 | 73 74 72 69 6e 67 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 74 68 69 73 20 6c 61 79 65 | string.associated.with.this.laye |
a340 | 72 20 74 79 70 65 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 0a 09 | r.type..</p>.................... |
a360 | 09 09 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 4c 61 79 65 72 54 79 70 65 4d 65 74 61 64 | ..........<h2.id="LayerTypeMetad |
a380 | 61 74 61 22 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 | ata">type.<a.href="/src/pkg/gith |
a3a0 | 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 6c 61 79 65 72 74 79 | ub.com/gconnell/gopacket/layerty |
a3c0 | 70 65 2e 67 6f 3f 73 3d 35 38 31 3a 37 39 37 23 4c 39 22 3e 4c 61 79 65 72 54 79 70 65 4d 65 74 | pe.go?s=581:797#L9">LayerTypeMet |
a3e0 | 61 64 61 74 61 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 65 3e 74 79 70 65 20 4c 61 79 65 | adata</a></h2>....<pre>type.Laye |
a400 | 72 54 79 70 65 4d 65 74 61 64 61 74 61 20 73 74 72 75 63 74 20 7b 0a 20 20 20 20 3c 73 70 61 6e | rTypeMetadata.struct.{.....<span |
a420 | 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 4e 61 6d 65 20 69 73 20 74 68 65 20 | .class="comment">//.Name.is.the. |
a440 | 73 74 72 69 6e 67 20 72 65 74 75 72 6e 65 64 20 62 79 20 65 61 63 68 20 6c 61 79 65 72 20 74 79 | string.returned.by.each.layer.ty |
a460 | 70 65 26 23 33 39 3b 73 20 53 74 72 69 6e 67 20 6d 65 74 68 6f 64 2e 3c 2f 73 70 61 6e 3e 0a 20 | pe's.String.method.</span>.. |
a480 | 20 20 20 4e 61 6d 65 20 73 74 72 69 6e 67 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 | ...Name.string.....<span.class=" |
a4a0 | 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 44 65 63 6f 64 65 72 20 69 73 20 74 68 65 20 64 65 63 6f 64 | comment">//.Decoder.is.the.decod |
a4c0 | 65 72 20 74 6f 20 75 73 65 20 77 68 65 6e 20 74 68 65 20 6c 61 79 65 72 20 74 79 70 65 20 69 73 | er.to.use.when.the.layer.type.is |
a4e0 | 20 70 61 73 73 65 64 20 69 6e 20 61 73 20 61 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e | .passed.in.as.a</span>.....<span |
a500 | 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 44 65 63 6f 64 65 72 2e 3c 2f 73 70 | .class="comment">//.Decoder.</sp |
a520 | 61 6e 3e 0a 20 20 20 20 44 65 63 6f 64 65 72 20 44 65 63 6f 64 65 72 0a 7d 3c 2f 70 72 65 3e 0a | an>.....Decoder.Decoder.}</pre>. |
a540 | 09 09 09 3c 70 3e 0a 4c 61 79 65 72 54 79 70 65 4d 65 74 61 64 61 74 61 20 63 6f 6e 74 61 69 6e | ...<p>.LayerTypeMetadata.contain |
a560 | 73 20 6d 65 74 61 64 61 74 61 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 65 61 63 68 20 | s.metadata.associated.with.each. |
a580 | 4c 61 79 65 72 54 79 70 65 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a | LayerType..</p>................. |
a5a0 | 0a 09 09 09 0a 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 | ........................<h2.id=" |
a5c0 | 4c 69 6e 6b 4c 61 79 65 72 22 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b | LinkLayer">type.<a.href="/src/pk |
a5e0 | 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 62 | g/github.com/gconnell/gopacket/b |
a600 | 61 73 65 2e 67 6f 3f 73 3d 31 37 32 30 3a 31 37 37 32 23 4c 33 36 22 3e 4c 69 6e 6b 4c 61 79 65 | ase.go?s=1720:1772#L36">LinkLaye |
a620 | 72 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 65 3e 74 79 70 65 20 4c 69 6e 6b 4c 61 79 65 | r</a></h2>....<pre>type.LinkLaye |
a640 | 72 20 69 6e 74 65 72 66 61 63 65 20 7b 0a 20 20 20 20 4c 61 79 65 72 0a 20 20 20 20 4c 69 6e 6b | r.interface.{.....Layer.....Link |
a660 | 46 6c 6f 77 28 29 20 46 6c 6f 77 0a 7d 3c 2f 70 72 65 3e 0a 09 09 09 3c 70 3e 0a 4c 69 6e 6b 4c | Flow().Flow.}</pre>....<p>.LinkL |
a680 | 61 79 65 72 20 69 73 20 74 68 65 20 70 61 63 6b 65 74 20 6c 61 79 65 72 20 63 6f 72 72 65 73 70 | ayer.is.the.packet.layer.corresp |
a6a0 | 6f 6e 64 69 6e 67 20 74 6f 20 54 43 50 2f 49 50 20 6c 61 79 65 72 20 31 20 28 4f 53 49 20 6c 61 | onding.to.TCP/IP.layer.1.(OSI.la |
a6c0 | 79 65 72 20 32 29 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 | yer.2).</p>..................... |
a6e0 | 0a 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 4e 65 74 77 | ....................<h2.id="Netw |
a700 | 6f 72 6b 4c 61 79 65 72 22 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 | orkLayer">type.<a.href="/src/pkg |
a720 | 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 62 61 | /github.com/gconnell/gopacket/ba |
a740 | 73 65 2e 67 6f 3f 73 3d 31 38 35 39 3a 31 39 31 37 23 4c 34 33 22 3e 4e 65 74 77 6f 72 6b 4c 61 | se.go?s=1859:1917#L43">NetworkLa |
a760 | 79 65 72 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 65 3e 74 79 70 65 20 4e 65 74 77 6f 72 | yer</a></h2>....<pre>type.Networ |
a780 | 6b 4c 61 79 65 72 20 69 6e 74 65 72 66 61 63 65 20 7b 0a 20 20 20 20 4c 61 79 65 72 0a 20 20 20 | kLayer.interface.{.....Layer.... |
a7a0 | 20 4e 65 74 77 6f 72 6b 46 6c 6f 77 28 29 20 46 6c 6f 77 0a 7d 3c 2f 70 72 65 3e 0a 09 09 09 3c | .NetworkFlow().Flow.}</pre>....< |
a7c0 | 70 3e 0a 4e 65 74 77 6f 72 6b 4c 61 79 65 72 20 69 73 20 74 68 65 20 70 61 63 6b 65 74 20 6c 61 | p>.NetworkLayer.is.the.packet.la |
a7e0 | 79 65 72 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 54 43 50 2f 49 50 20 6c 61 79 65 | yer.corresponding.to.TCP/IP.laye |
a800 | 72 20 32 20 28 4f 53 49 0a 6c 61 79 65 72 20 33 29 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a 09 09 | r.2.(OSI.layer.3).</p>.......... |
a820 | 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 3c | ...............................< |
a840 | 68 32 20 69 64 3d 22 50 61 63 6b 65 74 22 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 | h2.id="Packet">type.<a.href="/sr |
a860 | 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b | c/pkg/github.com/gconnell/gopack |
a880 | 65 74 2f 70 61 63 6b 65 74 2e 67 6f 3f 73 3d 38 33 36 3a 32 31 37 32 23 4c 31 38 22 3e 50 61 63 | et/packet.go?s=836:2172#L18">Pac |
a8a0 | 6b 65 74 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 65 3e 74 79 70 65 20 50 61 63 6b 65 74 | ket</a></h2>....<pre>type.Packet |
a8c0 | 20 69 6e 74 65 72 66 61 63 65 20 7b 0a 20 20 20 20 66 6d 74 2e 53 74 72 69 6e 67 65 72 0a 20 20 | .interface.{.....fmt.Stringer... |
a8e0 | 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 44 61 74 61 20 | ..<span.class="comment">//.Data. |
a900 | 72 65 74 75 72 6e 73 20 61 6c 6c 20 64 61 74 61 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 | returns.all.data.associated.with |
a920 | 20 74 68 69 73 20 70 61 63 6b 65 74 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 44 61 74 61 28 29 20 5b | .this.packet</span>.....Data().[ |
a940 | 5d 62 79 74 65 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e | ]byte.....<span.class="comment"> |
a960 | 2f 2f 20 4c 61 79 65 72 73 20 72 65 74 75 72 6e 73 20 61 6c 6c 20 6c 61 79 65 72 73 20 69 6e 20 | //.Layers.returns.all.layers.in. |
a980 | 74 68 69 73 20 70 61 63 6b 65 74 2c 20 63 6f 6d 70 75 74 69 6e 67 20 74 68 65 6d 20 61 73 20 6e | this.packet,.computing.them.as.n |
a9a0 | 65 63 65 73 73 61 72 79 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 4c 61 79 65 72 73 28 29 20 5b 5d 4c | ecessary</span>.....Layers().[]L |
a9c0 | 61 79 65 72 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f | ayer.....<span.class="comment">/ |
a9e0 | 2f 20 4c 61 79 65 72 20 72 65 74 75 72 6e 73 20 74 68 65 20 66 69 72 73 74 20 6c 61 79 65 72 20 | /.Layer.returns.the.first.layer. |
aa00 | 69 6e 20 74 68 69 73 20 70 61 63 6b 65 74 20 6f 66 20 74 68 65 20 67 69 76 65 6e 20 74 79 70 65 | in.this.packet.of.the.given.type |
aa20 | 2c 20 6f 72 20 6e 69 6c 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 4c 61 79 65 72 28 4c 61 79 65 72 54 | ,.or.nil</span>.....Layer(LayerT |
aa40 | 79 70 65 29 20 4c 61 79 65 72 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d | ype).Layer.....<span.class="comm |
aa60 | 65 6e 74 22 3e 2f 2f 20 4c 61 79 65 72 43 6c 61 73 73 20 72 65 74 75 72 6e 73 20 74 68 65 20 66 | ent">//.LayerClass.returns.the.f |
aa80 | 69 72 73 74 20 6c 61 79 65 72 20 69 6e 20 74 68 69 73 20 70 61 63 6b 65 74 20 6f 66 20 74 68 65 | irst.layer.in.this.packet.of.the |
aaa0 | 20 67 69 76 65 6e 20 63 6c 61 73 73 2c 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 | .given.class,</span>.....<span.c |
aac0 | 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 6f 72 20 6e 69 6c 2e 3c 2f 73 70 61 6e 3e | lass="comment">//.or.nil.</span> |
aae0 | 0a 20 20 20 20 4c 61 79 65 72 43 6c 61 73 73 28 4c 61 79 65 72 43 6c 61 73 73 29 20 4c 61 79 65 | .....LayerClass(LayerClass).Laye |
ab00 | 72 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 43 | r.....<span.class="comment">//.C |
ab20 | 61 70 74 75 72 65 49 6e 66 6f 20 72 65 74 75 72 6e 73 20 74 68 65 20 63 61 70 75 74 75 72 65 20 | aptureInfo.returns.the.caputure. |
ab40 | 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 66 6f 72 20 74 68 69 73 20 70 61 63 6b 65 74 2e 20 20 54 68 | information.for.this.packet...Th |
ab60 | 69 73 20 72 65 74 75 72 6e 73 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 | is.returns</span>.....<span.clas |
ab80 | 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 61 20 70 6f 69 6e 74 65 72 20 74 6f 20 74 68 65 20 | s="comment">//.a.pointer.to.the. |
aba0 | 70 61 63 6b 65 74 26 23 33 39 3b 73 20 73 74 72 75 63 74 2c 20 73 6f 20 69 74 20 63 61 6e 20 62 | packet's.struct,.so.it.can.b |
abc0 | 65 20 75 73 65 64 20 62 6f 74 68 20 66 6f 72 20 72 65 61 64 69 6e 67 20 61 6e 64 3c 2f 73 70 61 | e.used.both.for.reading.and</spa |
abe0 | 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 | n>.....<span.class="comment">//. |
ac00 | 77 72 69 74 69 6e 67 20 74 68 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2e 3c 2f 73 70 61 6e 3e 0a | writing.the.information.</span>. |
ac20 | 20 20 20 20 43 61 70 74 75 72 65 49 6e 66 6f 28 29 20 2a 43 61 70 74 75 72 65 49 6e 66 6f 0a 0a | ....CaptureInfo().*CaptureInfo.. |
ac40 | 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 4c 69 6e | ....<span.class="comment">//.Lin |
ac60 | 6b 4c 61 79 65 72 20 72 65 74 75 72 6e 73 20 74 68 65 20 66 69 72 73 74 20 6c 69 6e 6b 20 6c 61 | kLayer.returns.the.first.link.la |
ac80 | 79 65 72 20 69 6e 20 74 68 65 20 70 61 63 6b 65 74 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 4c 69 6e | yer.in.the.packet</span>.....Lin |
aca0 | 6b 4c 61 79 65 72 28 29 20 4c 69 6e 6b 4c 61 79 65 72 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 | kLayer().LinkLayer.....<span.cla |
acc0 | 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 4e 65 74 77 6f 72 6b 4c 61 79 65 72 20 72 65 74 | ss="comment">//.NetworkLayer.ret |
ace0 | 75 72 6e 73 20 74 68 65 20 66 69 72 73 74 20 6e 65 74 77 6f 72 6b 20 6c 61 79 65 72 20 69 6e 20 | urns.the.first.network.layer.in. |
ad00 | 74 68 65 20 70 61 63 6b 65 74 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 4e 65 74 77 6f 72 6b 4c 61 79 | the.packet</span>.....NetworkLay |
ad20 | 65 72 28 29 20 4e 65 74 77 6f 72 6b 4c 61 79 65 72 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 | er().NetworkLayer.....<span.clas |
ad40 | 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 54 72 61 6e 73 70 6f 72 74 4c 61 79 65 72 20 72 65 | s="comment">//.TransportLayer.re |
ad60 | 74 75 72 6e 73 20 74 68 65 20 66 69 72 73 74 20 74 72 61 6e 73 70 6f 72 74 20 6c 61 79 65 72 20 | turns.the.first.transport.layer. |
ad80 | 69 6e 20 74 68 65 20 70 61 63 6b 65 74 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 54 72 61 6e 73 70 6f | in.the.packet</span>.....Transpo |
ada0 | 72 74 4c 61 79 65 72 28 29 20 54 72 61 6e 73 70 6f 72 74 4c 61 79 65 72 0a 20 20 20 20 3c 73 70 | rtLayer().TransportLayer.....<sp |
adc0 | 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 41 70 70 6c 69 63 61 74 69 6f | an.class="comment">//.Applicatio |
ade0 | 6e 4c 61 79 65 72 20 72 65 74 75 72 6e 73 20 74 68 65 20 66 69 72 73 74 20 61 70 70 6c 69 63 61 | nLayer.returns.the.first.applica |
ae00 | 74 69 6f 6e 20 6c 61 79 65 72 20 69 6e 20 74 68 65 20 70 61 63 6b 65 74 3c 2f 73 70 61 6e 3e 0a | tion.layer.in.the.packet</span>. |
ae20 | 20 20 20 20 41 70 70 6c 69 63 61 74 69 6f 6e 4c 61 79 65 72 28 29 20 41 70 70 6c 69 63 61 74 69 | ....ApplicationLayer().Applicati |
ae40 | 6f 6e 4c 61 79 65 72 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 | onLayer.....<span.class="comment |
ae60 | 22 3e 2f 2f 20 45 72 72 6f 72 4c 61 79 65 72 20 69 73 20 70 61 72 74 69 63 75 6c 61 72 6c 79 20 | ">//.ErrorLayer.is.particularly. |
ae80 | 75 73 65 66 75 6c 2c 20 73 69 6e 63 65 20 69 74 20 72 65 74 75 72 6e 73 20 6e 69 6c 20 69 66 20 | useful,.since.it.returns.nil.if. |
aea0 | 74 68 65 20 70 61 63 6b 65 74 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 | the.packet</span>.....<span.clas |
aec0 | 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 77 61 73 20 66 75 6c 6c 79 20 64 65 63 6f 64 65 64 | s="comment">//.was.fully.decoded |
aee0 | 20 73 75 63 63 65 73 73 66 75 6c 6c 79 2c 20 61 6e 64 20 6e 6f 6e 2d 6e 69 6c 20 69 66 20 61 6e | .successfully,.and.non-nil.if.an |
af00 | 20 65 72 72 6f 72 20 77 61 73 20 65 6e 63 6f 75 6e 74 65 72 65 64 3c 2f 73 70 61 6e 3e 0a 20 20 | .error.was.encountered</span>... |
af20 | 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 69 6e 20 64 65 | ..<span.class="comment">//.in.de |
af40 | 63 6f 64 69 6e 67 20 61 6e 64 20 74 68 65 20 70 61 63 6b 65 74 20 77 61 73 20 6f 6e 6c 79 20 70 | coding.and.the.packet.was.only.p |
af60 | 61 72 74 69 61 6c 6c 79 20 64 65 63 6f 64 65 64 2e 20 20 54 68 75 73 2c 20 69 74 73 20 6f 75 74 | artially.decoded...Thus,.its.out |
af80 | 70 75 74 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d | put</span>.....<span.class="comm |
afa0 | 65 6e 74 22 3e 2f 2f 20 63 61 6e 20 62 65 20 75 73 65 64 20 74 6f 20 64 65 74 65 72 6d 69 6e 65 | ent">//.can.be.used.to.determine |
afc0 | 20 69 66 20 74 68 65 20 65 6e 74 69 72 65 20 70 61 63 6b 65 74 20 77 61 73 20 61 62 6c 65 20 74 | .if.the.entire.packet.was.able.t |
afe0 | 6f 20 62 65 20 64 65 63 6f 64 65 64 2e 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 45 72 72 6f 72 4c 61 | o.be.decoded.</span>.....ErrorLa |
b000 | 79 65 72 28 29 20 45 72 72 6f 72 4c 61 79 65 72 0a 7d 3c 2f 70 72 65 3e 0a 09 09 09 3c 70 3e 0a | yer().ErrorLayer.}</pre>....<p>. |
b020 | 50 61 63 6b 65 74 20 69 73 20 74 68 65 20 70 72 69 6d 61 72 79 20 6f 62 6a 65 63 74 20 75 73 65 | Packet.is.the.primary.object.use |
b040 | 64 20 62 79 20 67 6f 70 61 63 6b 65 74 2e 20 20 50 61 63 6b 65 74 73 20 61 72 65 20 63 72 65 61 | d.by.gopacket...Packets.are.crea |
b060 | 74 65 64 20 62 79 20 61 0a 44 65 63 6f 64 65 72 26 23 33 39 3b 73 20 44 65 63 6f 64 65 20 63 61 | ted.by.a.Decoder's.Decode.ca |
b080 | 6c 6c 2e 20 20 41 20 70 61 63 6b 65 74 20 69 73 20 6d 61 64 65 20 75 70 20 6f 66 20 61 20 73 65 | ll...A.packet.is.made.up.of.a.se |
b0a0 | 74 20 6f 66 20 44 61 74 61 2c 20 77 68 69 63 68 0a 69 73 20 62 72 6f 6b 65 6e 20 69 6e 74 6f 20 | t.of.Data,.which.is.broken.into. |
b0c0 | 61 20 6e 75 6d 62 65 72 20 6f 66 20 4c 61 79 65 72 73 20 61 73 20 69 74 20 69 73 20 64 65 63 6f | a.number.of.Layers.as.it.is.deco |
b0e0 | 64 65 64 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 | ded..</p>....................... |
b100 | 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 4e 65 77 50 61 63 6b 65 74 22 3e 66 75 6e 63 20 | ........<h3.id="NewPacket">func. |
b120 | 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f | <a.href="/src/pkg/github.com/gco |
b140 | 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 70 61 63 6b 65 74 2e 67 6f 3f 73 3d 39 39 37 38 3a | nnell/gopacket/packet.go?s=9978: |
b160 | 31 30 30 36 32 23 4c 33 34 30 22 3e 4e 65 77 50 61 63 6b 65 74 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 | 10062#L340">NewPacket</a></h3>.. |
b180 | 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 4e 65 77 50 61 63 6b 65 74 28 64 61 74 61 20 5b 5d 62 79 | ...<pre>func.NewPacket(data.[]by |
b1a0 | 74 65 2c 20 66 69 72 73 74 4c 61 79 65 72 44 65 63 6f 64 65 72 20 44 65 63 6f 64 65 72 2c 20 6f | te,.firstLayerDecoder.Decoder,.o |
b1c0 | 70 74 69 6f 6e 73 20 44 65 63 6f 64 65 4f 70 74 69 6f 6e 73 29 20 50 61 63 6b 65 74 3c 2f 70 72 | ptions.DecodeOptions).Packet</pr |
b1e0 | 65 3e 0a 09 09 09 09 3c 70 3e 0a 4e 65 77 50 61 63 6b 65 74 20 63 72 65 61 74 65 73 20 61 20 6e | e>.....<p>.NewPacket.creates.a.n |
b200 | 65 77 20 50 61 63 6b 65 74 20 6f 62 6a 65 63 74 20 66 72 6f 6d 20 61 20 73 65 74 20 6f 66 20 62 | ew.Packet.object.from.a.set.of.b |
b220 | 79 74 65 73 2e 20 20 54 68 65 0a 66 69 72 73 74 4c 61 79 65 72 44 65 63 6f 64 65 72 20 74 65 6c | ytes...The.firstLayerDecoder.tel |
b240 | 6c 73 20 69 74 20 68 6f 77 20 74 6f 20 69 6e 74 65 72 70 72 65 74 20 74 68 65 20 66 69 72 73 74 | ls.it.how.to.interpret.the.first |
b260 | 20 6c 61 79 65 72 20 66 72 6f 6d 20 74 68 65 20 62 79 74 65 73 2c 0a 66 75 74 75 72 65 20 6c 61 | .layer.from.the.bytes,.future.la |
b280 | 79 65 72 73 20 77 69 6c 6c 20 62 65 20 67 65 6e 65 72 61 74 65 64 20 66 72 6f 6d 20 74 68 61 74 | yers.will.be.generated.from.that |
b2a0 | 20 66 69 72 73 74 20 6c 61 79 65 72 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 2e 0a 3c 2f 70 3e | .first.layer.automatically..</p> |
b2c0 | 0a 0a 09 09 09 09 0a 09 09 09 0a 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 3c 68 | ..............................<h |
b2e0 | 32 20 69 64 3d 22 50 61 63 6b 65 74 42 75 69 6c 64 65 72 22 3e 74 79 70 65 20 3c 61 20 68 72 65 | 2.id="PacketBuilder">type.<a.hre |
b300 | 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f | f="/src/pkg/github.com/gconnell/ |
b320 | 67 6f 70 61 63 6b 65 74 2f 64 65 63 6f 64 65 2e 67 6f 3f 73 3d 36 30 32 3a 31 35 33 31 23 4c 31 | gopacket/decode.go?s=602:1531#L1 |
b340 | 33 22 3e 50 61 63 6b 65 74 42 75 69 6c 64 65 72 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 | 3">PacketBuilder</a></h2>....<pr |
b360 | 65 3e 74 79 70 65 20 50 61 63 6b 65 74 42 75 69 6c 64 65 72 20 69 6e 74 65 72 66 61 63 65 20 7b | e>type.PacketBuilder.interface.{ |
b380 | 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 41 64 | .....<span.class="comment">//.Ad |
b3a0 | 64 4c 61 79 65 72 20 73 68 6f 75 6c 64 20 62 65 20 63 61 6c 6c 65 64 20 62 79 20 61 20 64 65 63 | dLayer.should.be.called.by.a.dec |
b3c0 | 6f 64 65 72 20 69 6d 6d 65 64 69 61 74 65 6c 79 20 75 70 6f 6e 20 73 75 63 63 65 73 73 66 75 6c | oder.immediately.upon.successful |
b3e0 | 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 | </span>.....<span.class="comment |
b400 | 22 3e 2f 2f 20 64 65 63 6f 64 69 6e 67 20 6f 66 20 61 20 6c 61 79 65 72 2e 3c 2f 73 70 61 6e 3e | ">//.decoding.of.a.layer.</span> |
b420 | 0a 20 20 20 20 41 64 64 4c 61 79 65 72 28 6c 20 4c 61 79 65 72 29 0a 20 20 20 20 3c 73 70 61 6e | .....AddLayer(l.Layer).....<span |
b440 | 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e | .class="comment">//.The.followin |
b460 | 67 20 66 75 6e 63 74 69 6f 6e 73 20 73 65 74 20 74 68 65 20 76 61 72 69 6f 75 73 20 73 70 65 63 | g.functions.set.the.various.spec |
b480 | 69 66 69 63 20 6c 61 79 65 72 73 20 69 6e 20 74 68 65 20 66 69 6e 61 6c 3c 2f 73 70 61 6e 3e 0a | ific.layers.in.the.final</span>. |
b4a0 | 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 70 61 63 | ....<span.class="comment">//.pac |
b4c0 | 6b 65 74 2e 20 20 4e 6f 74 65 20 74 68 61 74 20 69 66 20 6d 61 6e 79 20 6c 61 79 65 72 73 20 63 | ket...Note.that.if.many.layers.c |
b4e0 | 61 6c 6c 20 53 65 74 58 2c 20 74 68 65 20 66 69 72 73 74 20 63 61 6c 6c 20 69 73 20 6b 65 70 74 | all.SetX,.the.first.call.is.kept |
b500 | 20 61 6e 64 20 61 6c 6c 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d | .and.all</span>.....<span.class= |
b520 | 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 6f 74 68 65 72 20 63 61 6c 6c 73 20 61 72 65 20 69 67 6e | "comment">//.other.calls.are.ign |
b540 | 6f 72 65 64 2e 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 53 65 74 4c 69 6e 6b 4c 61 79 65 72 28 4c 69 | ored.</span>.....SetLinkLayer(Li |
b560 | 6e 6b 4c 61 79 65 72 29 0a 20 20 20 20 53 65 74 4e 65 74 77 6f 72 6b 4c 61 79 65 72 28 4e 65 74 | nkLayer).....SetNetworkLayer(Net |
b580 | 77 6f 72 6b 4c 61 79 65 72 29 0a 20 20 20 20 53 65 74 54 72 61 6e 73 70 6f 72 74 4c 61 79 65 72 | workLayer).....SetTransportLayer |
b5a0 | 28 54 72 61 6e 73 70 6f 72 74 4c 61 79 65 72 29 0a 20 20 20 20 53 65 74 41 70 70 6c 69 63 61 74 | (TransportLayer).....SetApplicat |
b5c0 | 69 6f 6e 4c 61 79 65 72 28 41 70 70 6c 69 63 61 74 69 6f 6e 4c 61 79 65 72 29 0a 20 20 20 20 53 | ionLayer(ApplicationLayer).....S |
b5e0 | 65 74 45 72 72 6f 72 4c 61 79 65 72 28 45 72 72 6f 72 4c 61 79 65 72 29 0a 20 20 20 20 3c 73 70 | etErrorLayer(ErrorLayer).....<sp |
b600 | 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 4e 65 78 74 44 65 63 6f 64 65 | an.class="comment">//.NextDecode |
b620 | 72 20 73 68 6f 75 6c 64 20 62 65 20 63 61 6c 6c 65 64 20 62 79 20 61 20 64 65 63 6f 64 65 72 20 | r.should.be.called.by.a.decoder. |
b640 | 77 68 65 6e 20 74 68 65 79 26 23 33 39 3b 72 65 20 64 6f 6e 65 20 64 65 63 6f 64 69 6e 67 20 61 | when.they're.done.decoding.a |
b660 | 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 | </span>.....<span.class="comment |
b680 | 22 3e 2f 2f 20 70 61 63 6b 65 74 20 6c 61 79 65 72 20 62 75 74 20 6e 6f 74 20 64 6f 6e 65 20 77 | ">//.packet.layer.but.not.done.w |
b6a0 | 69 74 68 20 64 65 63 6f 64 69 6e 67 20 74 68 65 20 65 6e 74 69 72 65 20 70 61 63 6b 65 74 2e 20 | ith.decoding.the.entire.packet.. |
b6c0 | 20 54 68 65 20 6e 65 78 74 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 | .The.next</span>.....<span.class |
b6e0 | 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 64 65 63 6f 64 65 72 20 77 69 6c 6c 20 62 65 20 63 61 | ="comment">//.decoder.will.be.ca |
b700 | 6c 6c 65 64 20 74 6f 20 64 65 63 6f 64 65 20 74 68 65 20 6c 61 73 74 20 41 64 64 4c 61 79 65 72 | lled.to.decode.the.last.AddLayer |
b720 | 26 23 33 39 3b 73 20 4c 61 79 65 72 50 61 79 6c 6f 61 64 2e 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 | 's.LayerPayload.</span>..... |
b740 | 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 42 65 63 61 75 73 65 | <span.class="comment">//.Because |
b760 | 20 6f 66 20 74 68 69 73 2c 20 4e 65 78 74 44 65 63 6f 64 65 72 20 6d 75 73 74 20 6f 6e 6c 79 20 | .of.this,.NextDecoder.must.only. |
b780 | 62 65 20 63 61 6c 6c 65 64 20 6f 6e 63 65 20 61 6c 6c 20 6f 74 68 65 72 3c 2f 73 70 61 6e 3e 0a | be.called.once.all.other</span>. |
b7a0 | 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 50 61 63 | ....<span.class="comment">//.Pac |
b7c0 | 6b 65 74 42 75 69 6c 64 65 72 20 63 61 6c 6c 73 20 68 61 76 65 20 62 65 65 6e 20 6d 61 64 65 2e | ketBuilder.calls.have.been.made. |
b7e0 | 20 20 53 65 74 2a 4c 61 79 65 72 20 61 6e 64 20 41 64 64 4c 61 79 65 72 20 63 61 6c 6c 73 20 61 | ..Set*Layer.and.AddLayer.calls.a |
b800 | 66 74 65 72 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d | fter</span>.....<span.class="com |
b820 | 6d 65 6e 74 22 3e 2f 2f 20 4e 65 78 74 44 65 63 6f 64 65 72 20 63 61 6c 6c 73 20 77 69 6c 6c 20 | ment">//.NextDecoder.calls.will. |
b840 | 62 65 68 61 76 65 20 69 6e 63 6f 72 72 65 63 74 6c 79 2e 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 4e | behave.incorrectly.</span>.....N |
b860 | 65 78 74 44 65 63 6f 64 65 72 28 6e 65 78 74 20 44 65 63 6f 64 65 72 29 20 65 72 72 6f 72 0a 7d | extDecoder(next.Decoder).error.} |
b880 | 3c 2f 70 72 65 3e 0a 09 09 09 3c 70 3e 0a 50 61 63 6b 65 74 42 75 69 6c 64 65 72 20 69 73 20 75 | </pre>....<p>.PacketBuilder.is.u |
b8a0 | 73 65 64 20 62 79 20 6c 61 79 65 72 20 64 65 63 6f 64 65 72 73 20 74 6f 20 73 74 6f 72 65 20 74 | sed.by.layer.decoders.to.store.t |
b8c0 | 68 65 20 6c 61 79 65 72 73 20 74 68 65 79 26 23 33 39 3b 76 65 20 64 65 63 6f 64 65 64 2c 0a 61 | he.layers.they've.decoded,.a |
b8e0 | 6e 64 20 74 6f 20 64 65 66 65 72 20 66 75 74 75 72 65 20 64 65 63 6f 64 69 6e 67 20 76 69 61 20 | nd.to.defer.future.decoding.via. |
b900 | 4e 65 78 74 44 65 63 6f 64 65 72 2e 0a 54 79 70 69 63 61 6c 6c 79 2c 20 74 68 65 20 70 61 74 74 | NextDecoder..Typically,.the.patt |
b920 | 65 72 6e 20 66 6f 72 20 75 73 65 20 69 73 3a 0a 3c 2f 70 3e 0a 3c 70 72 65 3e 66 75 6e 63 20 28 | ern.for.use.is:.</p>.<pre>func.( |
b940 | 6d 20 2a 6d 79 44 65 63 6f 64 65 72 29 20 44 65 63 6f 64 65 28 64 61 74 61 20 5b 5d 62 79 74 65 | m.*myDecoder).Decode(data.[]byte |
b960 | 2c 20 70 20 50 61 63 6b 65 74 42 75 69 6c 64 65 72 29 20 65 72 72 6f 72 20 7b 0a 20 20 69 66 20 | ,.p.PacketBuilder).error.{...if. |
b980 | 6d 79 4c 61 79 65 72 2c 20 65 72 72 20 3a 3d 20 6d 79 44 65 63 6f 64 69 6e 67 4c 6f 67 69 63 28 | myLayer,.err.:=.myDecodingLogic( |
b9a0 | 64 61 74 61 29 3b 20 65 72 72 20 21 3d 20 6e 69 6c 20 7b 0a 20 20 20 20 72 65 74 75 72 6e 20 65 | data);.err.!=.nil.{.....return.e |
b9c0 | 72 72 0a 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 70 2e 41 64 64 4c 61 79 65 72 28 6d 79 4c | rr...}.else.{.....p.AddLayer(myL |
b9e0 | 61 79 65 72 29 0a 20 20 7d 0a 20 20 2f 2f 20 6d 61 79 62 65 20 64 6f 20 74 68 69 73 2c 20 69 66 | ayer)...}...//.maybe.do.this,.if |
ba00 | 20 6d 79 4c 61 79 65 72 20 69 73 20 61 20 4c 69 6e 6b 4c 61 79 65 72 0a 20 20 70 2e 53 65 74 4c | .myLayer.is.a.LinkLayer...p.SetL |
ba20 | 69 6e 6b 4c 61 79 65 72 28 6d 79 4c 61 79 65 72 29 0a 20 20 72 65 74 75 72 6e 20 70 2e 4e 65 78 | inkLayer(myLayer)...return.p.Nex |
ba40 | 74 44 65 63 6f 64 65 72 28 6e 65 78 74 44 65 63 6f 64 65 72 29 0a 7d 0a 3c 2f 70 72 65 3e 0a 0a | tDecoder(nextDecoder).}.</pre>.. |
ba60 | 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 0a 09 09 09 0a | ................................ |
ba80 | 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 50 61 63 6b 65 74 44 61 74 61 53 6f 75 72 63 65 22 | .......<h2.id="PacketDataSource" |
baa0 | 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 | >type.<a.href="/src/pkg/github.c |
bac0 | 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 70 61 63 6b 65 74 2e 67 6f 3f 73 | om/gconnell/gopacket/packet.go?s |
bae0 | 3d 31 31 34 34 34 3a 31 31 38 32 36 23 4c 33 37 37 22 3e 50 61 63 6b 65 74 44 61 74 61 53 6f 75 | =11444:11826#L377">PacketDataSou |
bb00 | 72 63 65 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 65 3e 74 79 70 65 20 50 61 63 6b 65 74 | rce</a></h2>....<pre>type.Packet |
bb20 | 44 61 74 61 53 6f 75 72 63 65 20 69 6e 74 65 72 66 61 63 65 20 7b 0a 20 20 20 20 3c 73 70 61 6e | DataSource.interface.{.....<span |
bb40 | 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 52 65 61 64 50 61 63 6b 65 74 44 61 | .class="comment">//.ReadPacketDa |
bb60 | 74 61 20 72 65 74 75 72 6e 73 20 74 68 65 20 6e 65 78 74 20 70 61 63 6b 65 74 20 61 76 61 69 6c | ta.returns.the.next.packet.avail |
bb80 | 61 62 6c 65 20 66 72 6f 6d 20 74 68 69 73 20 64 61 74 61 20 73 6f 75 72 63 65 2e 3c 2f 73 70 61 | able.from.this.data.source.</spa |
bba0 | 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 | n>.....<span.class="comment">//. |
bbc0 | 49 74 20 72 65 74 75 72 6e 73 3a 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 | It.returns:</span>.....<span.cla |
bbe0 | 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 20 64 61 74 61 3a 20 20 54 68 65 20 62 79 74 65 | ss="comment">//..data:..The.byte |
bc00 | 73 20 6f 66 20 61 6e 20 69 6e 64 69 76 69 64 75 61 6c 20 70 61 63 6b 65 74 2e 3c 2f 73 70 61 6e | s.of.an.individual.packet.</span |
bc20 | 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 20 | >.....<span.class="comment">//.. |
bc40 | 63 69 3a 20 20 4d 65 74 61 64 61 74 61 20 61 62 6f 75 74 20 74 68 65 20 63 61 70 74 75 72 65 3c | ci:..Metadata.about.the.capture< |
bc60 | 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 | /span>.....<span.class="comment" |
bc80 | 3e 2f 2f 20 20 65 72 72 3a 20 20 41 6e 20 65 72 72 6f 72 20 65 6e 63 6f 75 6e 74 65 72 65 64 20 | >//..err:..An.error.encountered. |
bca0 | 77 68 69 6c 65 20 72 65 61 64 69 6e 67 20 70 61 63 6b 65 74 20 64 61 74 61 2e 20 20 49 66 20 65 | while.reading.packet.data...If.e |
bcc0 | 72 72 20 21 3d 20 6e 69 6c 2c 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 | rr.!=.nil,</span>.....<span.clas |
bce0 | 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 20 20 20 74 68 65 6e 20 64 61 74 61 2f 63 69 20 77 | s="comment">//....then.data/ci.w |
bd00 | 69 6c 6c 20 62 65 20 69 67 6e 6f 72 65 64 2e 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 52 65 61 64 50 | ill.be.ignored.</span>.....ReadP |
bd20 | 61 63 6b 65 74 44 61 74 61 28 29 20 28 64 61 74 61 20 5b 5d 62 79 74 65 2c 20 63 69 20 43 61 70 | acketData().(data.[]byte,.ci.Cap |
bd40 | 74 75 72 65 49 6e 66 6f 2c 20 65 72 72 20 65 72 72 6f 72 29 0a 7d 3c 2f 70 72 65 3e 0a 09 09 09 | tureInfo,.err.error).}</pre>.... |
bd60 | 3c 70 3e 0a 50 61 63 6b 65 74 44 61 74 61 53 6f 75 72 63 65 20 69 73 20 61 6e 20 69 6e 74 65 72 | <p>.PacketDataSource.is.an.inter |
bd80 | 66 61 63 65 20 66 6f 72 20 73 6f 6d 65 20 73 6f 75 72 63 65 20 6f 66 20 70 61 63 6b 65 74 20 64 | face.for.some.source.of.packet.d |
bda0 | 61 74 61 2e 20 20 55 73 65 72 73 20 6d 61 79 0a 63 72 65 61 74 65 20 74 68 65 69 72 20 6f 77 6e | ata...Users.may.create.their.own |
bdc0 | 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 2c 20 6f 72 20 75 73 65 20 74 68 65 20 65 78 69 | .implementations,.or.use.the.exi |
bde0 | 73 74 69 6e 67 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 20 69 6e 0a 67 6f 70 61 63 6b 65 | sting.implementations.in.gopacke |
be00 | 74 2f 70 63 61 70 20 28 6c 69 62 70 63 61 70 2c 20 61 6c 6c 6f 77 73 20 72 65 61 64 69 6e 67 20 | t/pcap.(libpcap,.allows.reading. |
be20 | 66 72 6f 6d 20 6c 69 76 65 20 69 6e 74 65 72 66 61 63 65 73 20 6f 72 20 66 72 6f 6d 0a 70 63 61 | from.live.interfaces.or.from.pca |
be40 | 70 20 66 69 6c 65 73 29 20 6f 72 20 67 6f 70 61 63 6b 65 74 2f 70 66 72 69 6e 67 20 28 50 46 5f | p.files).or.gopacket/pfring.(PF_ |
be60 | 52 49 4e 47 2c 20 61 6c 6c 6f 77 73 20 72 65 61 64 69 6e 67 20 66 72 6f 6d 20 6c 69 76 65 0a 69 | RING,.allows.reading.from.live.i |
be80 | 6e 74 65 72 66 61 63 65 73 29 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 | nterfaces)..</p>................ |
bea0 | 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d | .........................<h2.id= |
bec0 | 22 50 61 63 6b 65 74 53 6f 75 72 63 65 22 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 | "PacketSource">type.<a.href="/sr |
bee0 | 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b | c/pkg/github.com/gconnell/gopack |
bf00 | 65 74 2f 70 61 63 6b 65 74 2e 67 6f 3f 73 3d 31 33 31 33 38 3a 31 33 34 30 35 23 4c 34 32 32 22 | et/packet.go?s=13138:13405#L422" |
bf20 | 3e 50 61 63 6b 65 74 53 6f 75 72 63 65 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 65 3e 74 | >PacketSource</a></h2>....<pre>t |
bf40 | 79 70 65 20 50 61 63 6b 65 74 53 6f 75 72 63 65 20 73 74 72 75 63 74 20 7b 0a 0a 20 20 20 20 3c | ype.PacketSource.struct.{......< |
bf60 | 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 44 65 63 6f 64 65 4f 70 | span.class="comment">//.DecodeOp |
bf80 | 74 69 6f 6e 73 20 69 73 20 74 68 65 20 73 65 74 20 6f 66 20 6f 70 74 69 6f 6e 73 20 74 6f 20 75 | tions.is.the.set.of.options.to.u |
bfa0 | 73 65 20 66 6f 72 20 64 65 63 6f 64 69 6e 67 20 65 61 63 68 20 70 69 65 63 65 3c 2f 73 70 61 6e | se.for.decoding.each.piece</span |
bfc0 | 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 6f | >.....<span.class="comment">//.o |
bfe0 | 66 20 70 61 63 6b 65 74 20 64 61 74 61 2e 20 20 54 68 69 73 20 63 61 6e 2f 73 68 6f 75 6c 64 20 | f.packet.data...This.can/should. |
c000 | 62 65 20 63 68 61 6e 67 65 64 20 62 79 20 74 68 65 20 75 73 65 72 20 74 6f 20 72 65 66 6c 65 63 | be.changed.by.the.user.to.reflec |
c020 | 74 20 74 68 65 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f | t.the</span>.....<span.class="co |
c040 | 6d 6d 65 6e 74 22 3e 2f 2f 20 77 61 79 20 70 61 63 6b 65 74 73 20 73 68 6f 75 6c 64 20 62 65 20 | mment">//.way.packets.should.be. |
c060 | 64 65 63 6f 64 65 64 2e 3c 2f 73 70 61 6e 3e 0a 20 20 20 20 44 65 63 6f 64 65 4f 70 74 69 6f 6e | decoded.</span>.....DecodeOption |
c080 | 73 0a 20 20 20 20 3c 73 70 61 6e 20 63 6c 61 73 73 3d 22 63 6f 6d 6d 65 6e 74 22 3e 2f 2f 20 63 | s.....<span.class="comment">//.c |
c0a0 | 6f 6e 74 61 69 6e 73 20 66 69 6c 74 65 72 65 64 20 6f 72 20 75 6e 65 78 70 6f 72 74 65 64 20 66 | ontains.filtered.or.unexported.f |
c0c0 | 69 65 6c 64 73 3c 2f 73 70 61 6e 3e 0a 7d 3c 2f 70 72 65 3e 0a 09 09 09 3c 70 3e 0a 50 61 63 6b | ields</span>.}</pre>....<p>.Pack |
c0e0 | 65 74 53 6f 75 72 63 65 20 72 65 61 64 73 20 69 6e 20 70 61 63 6b 65 74 73 20 66 72 6f 6d 20 61 | etSource.reads.in.packets.from.a |
c100 | 20 50 61 63 6b 65 74 44 61 74 61 53 6f 75 72 63 65 2c 20 64 65 63 6f 64 65 73 20 74 68 65 6d 2c | .PacketDataSource,.decodes.them, |
c120 | 20 61 6e 64 0a 72 65 74 75 72 6e 73 20 74 68 65 6d 2e 0a 3c 2f 70 3e 0a 3c 70 3e 0a 54 68 65 72 | .and.returns.them..</p>.<p>.Ther |
c140 | 65 20 61 72 65 20 63 75 72 72 65 6e 74 6c 79 20 74 77 6f 20 64 69 66 66 65 72 65 6e 74 20 6d 65 | e.are.currently.two.different.me |
c160 | 74 68 6f 64 73 20 66 6f 72 20 72 65 61 64 69 6e 67 20 70 61 63 6b 65 74 73 20 69 6e 20 74 68 72 | thods.for.reading.packets.in.thr |
c180 | 6f 75 67 68 0a 61 20 50 61 63 6b 65 74 53 6f 75 72 63 65 3a 0a 3c 2f 70 3e 0a 3c 68 33 20 69 64 | ough.a.PacketSource:.</p>.<h3.id |
c1a0 | 3d 22 52 65 61 64 69 6e 67 5f 57 69 74 68 5f 50 61 63 6b 65 74 73 5f 46 75 6e 63 74 69 6f 6e 22 | ="Reading_With_Packets_Function" |
c1c0 | 3e 52 65 61 64 69 6e 67 20 57 69 74 68 20 50 61 63 6b 65 74 73 20 46 75 6e 63 74 69 6f 6e 3c 2f | >Reading.With.Packets.Function</ |
c1e0 | 68 33 3e 0a 3c 70 3e 0a 54 68 69 73 20 6d 65 74 68 6f 64 20 69 73 20 74 68 65 20 6d 6f 73 74 20 | h3>.<p>.This.method.is.the.most. |
c200 | 63 6f 6e 76 65 6e 69 65 6e 74 20 61 6e 64 20 65 61 73 69 65 73 74 20 74 6f 20 63 6f 64 65 2c 20 | convenient.and.easiest.to.code,. |
c220 | 62 75 74 20 6c 61 63 6b 73 0a 66 6c 65 78 69 62 69 6c 69 74 79 2e 20 20 50 61 63 6b 65 74 73 20 | but.lacks.flexibility...Packets. |
c240 | 72 65 74 75 72 6e 73 20 61 20 26 23 33 39 3b 63 68 61 6e 20 50 61 63 6b 65 74 26 23 33 39 3b 2c | returns.a.'chan.Packet', |
c260 | 20 74 68 65 6e 20 61 73 79 6e 63 68 72 6f 6e 6f 75 73 6c 79 20 77 72 69 74 65 73 0a 70 61 63 6b | .then.asynchronously.writes.pack |
c280 | 65 74 73 20 69 6e 74 6f 20 74 68 61 74 20 63 68 61 6e 6e 65 6c 2e 20 20 50 61 63 6b 65 74 73 20 | ets.into.that.channel...Packets. |
c2a0 | 75 73 65 73 20 61 20 62 6c 6f 63 6b 69 6e 67 20 63 68 61 6e 6e 65 6c 2c 20 61 6e 64 20 63 6c 6f | uses.a.blocking.channel,.and.clo |
c2c0 | 73 65 73 0a 69 74 20 69 66 20 61 6e 20 69 6f 2e 45 4f 46 20 69 73 20 72 65 74 75 72 6e 65 64 20 | ses.it.if.an.io.EOF.is.returned. |
c2e0 | 62 79 20 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 20 50 61 63 6b 65 74 44 61 74 61 53 6f 75 72 | by.the.underlying.PacketDataSour |
c300 | 63 65 2e 20 20 41 6c 6c 20 6f 74 68 65 72 0a 50 61 63 6b 65 74 44 61 74 61 53 6f 75 72 63 65 20 | ce...All.other.PacketDataSource. |
c320 | 65 72 72 6f 72 73 20 61 72 65 20 69 67 6e 6f 72 65 64 20 61 6e 64 20 64 69 73 63 61 72 64 65 64 | errors.are.ignored.and.discarded |
c340 | 2e 0a 3c 2f 70 3e 0a 3c 70 72 65 3e 66 6f 72 20 70 61 63 6b 65 74 20 3a 3d 20 72 61 6e 67 65 20 | ..</p>.<pre>for.packet.:=.range. |
c360 | 70 61 63 6b 65 74 53 6f 75 72 63 65 2e 50 61 63 6b 65 74 73 28 29 20 7b 0a 20 20 2e 2e 2e 0a 7d | packetSource.Packets().{.......} |
c380 | 0a 3c 2f 70 72 65 3e 0a 3c 68 33 20 69 64 3d 22 52 65 61 64 69 6e 67 5f 57 69 74 68 5f 4e 65 78 | .</pre>.<h3.id="Reading_With_Nex |
c3a0 | 74 50 61 63 6b 65 74 5f 46 75 6e 63 74 69 6f 6e 22 3e 52 65 61 64 69 6e 67 20 57 69 74 68 20 4e | tPacket_Function">Reading.With.N |
c3c0 | 65 78 74 50 61 63 6b 65 74 20 46 75 6e 63 74 69 6f 6e 3c 2f 68 33 3e 0a 3c 70 3e 0a 54 68 69 73 | extPacket.Function</h3>.<p>.This |
c3e0 | 20 6d 65 74 68 6f 64 20 69 73 20 74 68 65 20 6d 6f 73 74 20 66 6c 65 78 69 62 6c 65 2c 20 61 6e | .method.is.the.most.flexible,.an |
c400 | 64 20 65 78 70 6f 73 65 73 20 65 72 72 6f 72 73 20 74 68 61 74 20 6d 61 79 20 62 65 0a 65 6e 63 | d.exposes.errors.that.may.be.enc |
c420 | 6f 75 6e 74 65 72 65 64 20 62 79 20 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 20 50 61 63 6b 65 | ountered.by.the.underlying.Packe |
c440 | 74 44 61 74 61 53 6f 75 72 63 65 2e 20 20 49 74 26 23 33 39 3b 73 20 61 6c 73 6f 20 74 68 65 20 | tDataSource...It's.also.the. |
c460 | 66 61 73 74 65 73 74 0a 69 6e 20 61 20 74 69 67 68 74 20 6c 6f 6f 70 2c 20 73 69 6e 63 65 20 69 | fastest.in.a.tight.loop,.since.i |
c480 | 74 20 64 6f 65 73 6e 26 23 33 39 3b 74 20 68 61 76 65 20 74 68 65 20 6f 76 65 72 68 65 61 64 20 | t.doesn't.have.the.overhead. |
c4a0 | 6f 66 20 61 20 63 68 61 6e 6e 65 6c 0a 72 65 61 64 2f 77 72 69 74 65 2e 20 20 48 6f 77 65 76 65 | of.a.channel.read/write...Howeve |
c4c0 | 72 2c 20 69 74 20 72 65 71 75 69 72 65 73 20 74 68 65 20 75 73 65 72 20 74 6f 20 68 61 6e 64 6c | r,.it.requires.the.user.to.handl |
c4e0 | 65 20 65 72 72 6f 72 73 2c 20 6d 6f 73 74 0a 69 6d 70 6f 72 74 61 6e 74 6c 79 20 74 68 65 20 69 | e.errors,.most.importantly.the.i |
c500 | 6f 2e 45 4f 46 20 65 72 72 6f 72 20 69 6e 20 63 61 73 65 73 20 77 68 65 72 65 20 70 61 63 6b 65 | o.EOF.error.in.cases.where.packe |
c520 | 74 73 20 61 72 65 20 62 65 69 6e 67 20 72 65 61 64 20 66 72 6f 6d 0a 61 20 66 69 6c 65 2e 0a 3c | ts.are.being.read.from.a.file..< |
c540 | 2f 70 3e 0a 3c 70 72 65 3e 66 6f 72 20 7b 0a 20 20 70 61 63 6b 65 74 2c 20 65 72 72 20 3a 3d 20 | /p>.<pre>for.{...packet,.err.:=. |
c560 | 70 61 63 6b 65 74 53 6f 75 72 63 65 2e 4e 65 78 74 50 61 63 6b 65 74 28 29 20 7b 0a 20 20 69 66 | packetSource.NextPacket().{...if |
c580 | 20 65 72 72 20 3d 3d 20 69 6f 2e 45 4f 46 20 7b 0a 20 20 20 20 62 72 65 61 6b 0a 20 20 7d 20 65 | .err.==.io.EOF.{.....break...}.e |
c5a0 | 6c 73 65 20 69 66 20 65 72 72 20 21 3d 20 6e 69 6c 20 7b 0a 20 20 20 20 6c 6f 67 2e 50 72 69 6e | lse.if.err.!=.nil.{.....log.Prin |
c5c0 | 74 6c 6e 28 26 23 33 34 3b 45 72 72 6f 72 3a 26 23 33 34 3b 2c 20 65 72 72 29 0a 20 20 20 20 63 | tln("Error:",.err).....c |
c5e0 | 6f 6e 74 69 6e 75 65 0a 20 20 7d 0a 20 20 68 61 6e 64 6c 65 50 61 63 6b 65 74 28 70 61 63 6b 65 | ontinue...}...handlePacket(packe |
c600 | 74 29 20 20 2f 2f 20 44 6f 20 73 6f 6d 65 74 68 69 6e 67 20 77 69 74 68 20 65 61 63 68 20 70 61 | t)..//.Do.something.with.each.pa |
c620 | 63 6b 65 74 2e 0a 7d 0a 3c 2f 70 72 65 3e 0a 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a | cket..}.</pre>.................. |
c640 | 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 4e 65 77 50 61 63 6b 65 74 53 6f | .............<h3.id="NewPacketSo |
c660 | 75 72 63 65 22 3e 66 75 6e 63 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 | urce">func.<a.href="/src/pkg/git |
c680 | 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 70 61 63 6b 65 74 | hub.com/gconnell/gopacket/packet |
c6a0 | 2e 67 6f 3f 73 3d 31 33 34 35 38 3a 31 33 35 33 34 23 4c 34 33 32 22 3e 4e 65 77 50 61 63 6b 65 | .go?s=13458:13534#L432">NewPacke |
c6c0 | 74 53 6f 75 72 63 65 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 4e | tSource</a></h3>.....<pre>func.N |
c6e0 | 65 77 50 61 63 6b 65 74 53 6f 75 72 63 65 28 73 6f 75 72 63 65 20 50 61 63 6b 65 74 44 61 74 61 | ewPacketSource(source.PacketData |
c700 | 53 6f 75 72 63 65 2c 20 64 65 63 6f 64 65 72 20 44 65 63 6f 64 65 72 29 20 2a 50 61 63 6b 65 74 | Source,.decoder.Decoder).*Packet |
c720 | 53 6f 75 72 63 65 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 4e 65 77 50 61 63 6b 65 74 53 6f | Source</pre>.....<p>.NewPacketSo |
c740 | 75 72 63 65 20 63 72 65 61 74 65 73 20 61 20 70 61 63 6b 65 74 20 64 61 74 61 20 73 6f 75 72 63 | urce.creates.a.packet.data.sourc |
c760 | 65 2e 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 0a 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 | e..</p>......................... |
c780 | 3c 68 33 20 69 64 3d 22 50 61 63 6b 65 74 53 6f 75 72 63 65 2e 4e 65 78 74 50 61 63 6b 65 74 22 | <h3.id="PacketSource.NextPacket" |
c7a0 | 3e 66 75 6e 63 20 28 2a 50 61 63 6b 65 74 53 6f 75 72 63 65 29 20 3c 61 20 68 72 65 66 3d 22 2f | >func.(*PacketSource).<a.href="/ |
c7c0 | 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 | src/pkg/github.com/gconnell/gopa |
c7e0 | 63 6b 65 74 2f 70 61 63 6b 65 74 2e 67 6f 3f 73 3d 31 33 37 33 33 3a 31 33 37 38 34 23 4c 34 34 | cket/packet.go?s=13733:13784#L44 |
c800 | 31 22 3e 4e 65 78 74 50 61 63 6b 65 74 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e | 1">NextPacket</a></h3>.....<pre> |
c820 | 66 75 6e 63 20 28 70 20 2a 50 61 63 6b 65 74 53 6f 75 72 63 65 29 20 4e 65 78 74 50 61 63 6b 65 | func.(p.*PacketSource).NextPacke |
c840 | 74 28 29 20 28 50 61 63 6b 65 74 2c 20 65 72 72 6f 72 29 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 | t().(Packet,.error)</pre>.....<p |
c860 | 3e 0a 4e 65 78 74 50 61 63 6b 65 74 20 72 65 74 75 72 6e 73 20 74 68 65 20 6e 65 78 74 20 64 65 | >.NextPacket.returns.the.next.de |
c880 | 63 6f 64 65 64 20 70 61 63 6b 65 74 20 66 72 6f 6d 20 74 68 65 20 50 61 63 6b 65 74 53 6f 75 72 | coded.packet.from.the.PacketSour |
c8a0 | 63 65 2e 20 20 4f 6e 20 65 72 72 6f 72 2c 0a 69 74 20 72 65 74 75 72 6e 73 20 61 20 6e 69 6c 20 | ce...On.error,.it.returns.a.nil. |
c8c0 | 70 61 63 6b 65 74 20 61 6e 64 20 61 20 6e 6f 6e 2d 6e 69 6c 20 65 72 72 6f 72 2e 0a 3c 2f 70 3e | packet.and.a.non-nil.error..</p> |
c8e0 | 0a 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d | .........................<h3.id= |
c900 | 22 50 61 63 6b 65 74 53 6f 75 72 63 65 2e 50 61 63 6b 65 74 73 22 3e 66 75 6e 63 20 28 2a 50 61 | "PacketSource.Packets">func.(*Pa |
c920 | 63 6b 65 74 53 6f 75 72 63 65 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 | cketSource).<a.href="/src/pkg/gi |
c940 | 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 70 61 63 6b 65 | thub.com/gconnell/gopacket/packe |
c960 | 74 2e 67 6f 3f 73 3d 31 34 38 34 31 3a 31 34 38 38 35 23 4c 34 37 35 22 3e 50 61 63 6b 65 74 73 | t.go?s=14841:14885#L475">Packets |
c980 | 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 70 20 2a 50 61 63 6b | </a></h3>.....<pre>func.(p.*Pack |
c9a0 | 65 74 53 6f 75 72 63 65 29 20 50 61 63 6b 65 74 73 28 29 20 63 68 61 6e 20 50 61 63 6b 65 74 3c | etSource).Packets().chan.Packet< |
c9c0 | 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 50 61 63 6b 65 74 73 20 72 65 74 75 72 6e 73 20 61 20 | /pre>.....<p>.Packets.returns.a. |
c9e0 | 62 6c 6f 63 6b 69 6e 67 20 63 68 61 6e 6e 65 6c 20 6f 66 20 70 61 63 6b 65 74 73 2c 20 61 6c 6c | blocking.channel.of.packets,.all |
ca00 | 6f 77 69 6e 67 20 65 61 73 79 20 69 74 65 72 61 74 69 6e 67 20 6f 76 65 72 0a 70 61 63 6b 65 74 | owing.easy.iterating.over.packet |
ca20 | 73 2e 20 20 50 61 63 6b 65 74 73 20 77 69 6c 6c 20 62 65 20 61 73 79 6e 63 68 72 6f 6e 6f 75 73 | s...Packets.will.be.asynchronous |
ca40 | 6c 79 20 72 65 61 64 20 69 6e 20 66 72 6f 6d 20 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 0a 50 | ly.read.in.from.the.underlying.P |
ca60 | 61 63 6b 65 74 44 61 74 61 53 6f 75 72 63 65 20 61 6e 64 20 77 72 69 74 74 65 6e 20 74 6f 20 74 | acketDataSource.and.written.to.t |
ca80 | 68 65 20 72 65 74 75 72 6e 65 64 20 63 68 61 6e 6e 65 6c 2e 20 20 49 66 20 74 68 65 20 75 6e 64 | he.returned.channel...If.the.und |
caa0 | 65 72 6c 79 69 6e 67 0a 50 61 63 6b 65 74 44 61 74 61 53 6f 75 72 63 65 20 72 65 74 75 72 6e 73 | erlying.PacketDataSource.returns |
cac0 | 20 61 6e 20 69 6f 2e 45 4f 46 20 65 72 72 6f 72 2c 20 74 68 65 20 63 68 61 6e 6e 65 6c 20 77 69 | .an.io.EOF.error,.the.channel.wi |
cae0 | 6c 6c 20 62 65 20 63 6c 6f 73 65 64 2e 0a 49 66 20 61 6e 79 20 6f 74 68 65 72 20 65 72 72 6f 72 | ll.be.closed..If.any.other.error |
cb00 | 20 69 73 20 65 6e 63 6f 75 6e 74 65 72 65 64 2c 20 69 74 20 69 73 20 69 67 6e 6f 72 65 64 2e 0a | .is.encountered,.it.is.ignored.. |
cb20 | 3c 2f 70 3e 0a 3c 70 72 65 3e 66 6f 72 20 70 61 63 6b 65 74 20 3a 3d 20 72 61 6e 67 65 20 70 61 | </p>.<pre>for.packet.:=.range.pa |
cb40 | 63 6b 65 74 53 6f 75 72 63 65 2e 50 61 63 6b 65 74 73 28 29 20 7b 0a 20 20 68 61 6e 64 6c 65 50 | cketSource.Packets().{...handleP |
cb60 | 61 63 6b 65 74 28 70 61 63 6b 65 74 29 20 20 2f 2f 20 44 6f 20 73 6f 6d 65 74 68 69 6e 67 20 77 | acket(packet)..//.Do.something.w |
cb80 | 69 74 68 20 65 61 63 68 20 70 61 63 6b 65 74 2e 0a 7d 0a 3c 2f 70 72 65 3e 0a 0a 09 09 09 09 0a | ith.each.packet..}.</pre>....... |
cba0 | 09 09 09 09 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 3c 68 32 20 69 64 3d 22 50 | .......................<h2.id="P |
cbc0 | 61 79 6c 6f 61 64 22 3e 74 79 70 65 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 | ayload">type.<a.href="/src/pkg/g |
cbe0 | 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 62 61 73 65 | ithub.com/gconnell/gopacket/base |
cc00 | 2e 67 6f 3f 73 3d 31 31 32 30 3a 31 31 35 36 23 4c 32 31 22 3e 50 61 79 6c 6f 61 64 3c 2f 61 3e | .go?s=1120:1156#L21">Payload</a> |
cc20 | 3c 2f 68 32 3e 0a 09 09 09 3c 70 72 65 3e 74 79 70 65 20 50 61 79 6c 6f 61 64 20 73 74 72 75 63 | </h2>....<pre>type.Payload.struc |
cc40 | 74 20 7b 0a 20 20 20 20 44 61 74 61 20 5b 5d 62 79 74 65 0a 7d 3c 2f 70 72 65 3e 0a 09 09 09 3c | t.{.....Data.[]byte.}</pre>....< |
cc60 | 70 3e 0a 50 61 79 6c 6f 61 64 20 69 73 20 61 20 4c 61 79 65 72 20 63 6f 6e 74 61 69 6e 69 6e 67 | p>.Payload.is.a.Layer.containing |
cc80 | 20 74 68 65 20 70 61 79 6c 6f 61 64 20 6f 66 20 61 20 70 61 63 6b 65 74 2e 20 20 54 68 65 20 64 | .the.payload.of.a.packet...The.d |
cca0 | 65 66 69 6e 69 74 69 6f 6e 20 6f 66 0a 77 68 61 74 20 63 6f 6e 73 74 69 74 75 74 65 73 20 74 68 | efinition.of.what.constitutes.th |
ccc0 | 65 20 70 61 79 6c 6f 61 64 20 6f 66 20 61 20 70 61 63 6b 65 74 20 64 65 70 65 6e 64 73 20 6f 6e | e.payload.of.a.packet.depends.on |
cce0 | 20 70 72 65 76 69 6f 75 73 20 6c 61 79 65 72 73 3b 20 66 6f 72 0a 54 43 50 20 61 6e 64 20 55 44 | .previous.layers;.for.TCP.and.UD |
cd00 | 50 2c 20 77 65 20 73 74 6f 70 20 64 65 63 6f 64 69 6e 67 20 61 62 6f 76 65 20 6c 61 79 65 72 20 | P,.we.stop.decoding.above.layer. |
cd20 | 34 20 61 6e 64 20 72 65 74 75 72 6e 20 74 68 65 20 72 65 6d 61 69 6e 69 6e 67 0a 62 79 74 65 73 | 4.and.return.the.remaining.bytes |
cd40 | 20 61 73 20 61 20 50 61 79 6c 6f 61 64 2e 20 20 50 61 79 6c 6f 61 64 20 69 73 20 61 6e 20 41 70 | .as.a.Payload...Payload.is.an.Ap |
cd60 | 70 6c 69 63 61 74 69 6f 6e 4c 61 79 65 72 2e 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a 09 09 09 0a | plicationLayer..</p>............ |
cd80 | 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 | ........................<h3.id=" |
cda0 | 50 61 79 6c 6f 61 64 2e 4c 61 79 65 72 43 6f 6e 74 65 6e 74 73 22 3e 66 75 6e 63 20 28 2a 50 61 | Payload.LayerContents">func.(*Pa |
cdc0 | 79 6c 6f 61 64 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e | yload).<a.href="/src/pkg/github. |
cde0 | 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 62 61 73 65 2e 67 6f 3f 73 3d | com/gconnell/gopacket/base.go?s= |
ce00 | 31 32 36 35 3a 31 33 30 35 23 4c 32 37 22 3e 4c 61 79 65 72 43 6f 6e 74 65 6e 74 73 3c 2f 61 3e | 1265:1305#L27">LayerContents</a> |
ce20 | 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 70 20 2a 50 61 79 6c 6f 61 64 29 | </h3>.....<pre>func.(p.*Payload) |
ce40 | 20 4c 61 79 65 72 43 6f 6e 74 65 6e 74 73 28 29 20 5b 5d 62 79 74 65 3c 2f 70 72 65 3e 0a 09 09 | .LayerContents().[]byte</pre>... |
ce60 | 09 09 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 | ..........................<h3.id |
ce80 | 3d 22 50 61 79 6c 6f 61 64 2e 4c 61 79 65 72 50 61 79 6c 6f 61 64 22 3e 66 75 6e 63 20 28 2a 50 | ="Payload.LayerPayload">func.(*P |
cea0 | 61 79 6c 6f 61 64 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 | ayload).<a.href="/src/pkg/github |
cec0 | 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 62 61 73 65 2e 67 6f 3f 73 | .com/gconnell/gopacket/base.go?s |
cee0 | 3d 31 33 32 34 3a 31 33 36 33 23 4c 32 38 22 3e 4c 61 79 65 72 50 61 79 6c 6f 61 64 3c 2f 61 3e | =1324:1363#L28">LayerPayload</a> |
cf00 | 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 70 20 2a 50 61 79 6c 6f 61 64 29 | </h3>.....<pre>func.(p.*Payload) |
cf20 | 20 4c 61 79 65 72 50 61 79 6c 6f 61 64 28 29 20 5b 5d 62 79 74 65 3c 2f 70 72 65 3e 0a 09 09 09 | .LayerPayload().[]byte</pre>.... |
cf40 | 09 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d | .........................<h3.id= |
cf60 | 22 50 61 79 6c 6f 61 64 2e 4c 61 79 65 72 54 79 70 65 22 3e 66 75 6e 63 20 28 2a 50 61 79 6c 6f | "Payload.LayerType">func.(*Paylo |
cf80 | 61 64 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d | ad).<a.href="/src/pkg/github.com |
cfa0 | 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 62 61 73 65 2e 67 6f 3f 73 3d 31 31 39 | /gconnell/gopacket/base.go?s=119 |
cfc0 | 36 3a 31 32 33 35 23 4c 32 36 22 3e 4c 61 79 65 72 54 79 70 65 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 | 6:1235#L26">LayerType</a></h3>.. |
cfe0 | 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 70 20 2a 50 61 79 6c 6f 61 64 29 20 4c 61 79 65 72 54 | ...<pre>func.(p.*Payload).LayerT |
d000 | 79 70 65 28 29 20 4c 61 79 65 72 54 79 70 65 3c 2f 70 72 65 3e 0a 09 09 09 09 3c 70 3e 0a 4c 61 | ype().LayerType</pre>.....<p>.La |
d020 | 79 65 72 54 79 70 65 20 72 65 74 75 72 6e 73 20 4c 61 79 65 72 54 79 70 65 50 61 79 6c 6f 61 64 | yerType.returns.LayerTypePayload |
d040 | 0a 3c 2f 70 3e 0a 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 | .</p>.........................<h |
d060 | 33 20 69 64 3d 22 50 61 79 6c 6f 61 64 2e 50 61 79 6c 6f 61 64 22 3e 66 75 6e 63 20 28 2a 50 61 | 3.id="Payload.Payload">func.(*Pa |
d080 | 79 6c 6f 61 64 29 20 3c 61 20 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e | yload).<a.href="/src/pkg/github. |
d0a0 | 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 62 61 73 65 2e 67 6f 3f 73 3d | com/gconnell/gopacket/base.go?s= |
d0c0 | 31 33 38 30 3a 31 34 31 34 23 4c 32 39 22 3e 50 61 79 6c 6f 61 64 3c 2f 61 3e 3c 2f 68 33 3e 0a | 1380:1414#L29">Payload</a></h3>. |
d0e0 | 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 70 20 2a 50 61 79 6c 6f 61 64 29 20 50 61 79 6c 6f | ....<pre>func.(p.*Payload).Paylo |
d100 | 61 64 28 29 20 5b 5d 62 79 74 65 3c 2f 70 72 65 3e 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 09 | ad().[]byte</pre>............... |
d120 | 0a 09 09 09 0a 09 09 09 09 0a 09 09 09 09 3c 68 33 20 69 64 3d 22 50 61 79 6c 6f 61 64 2e 53 74 | ..............<h3.id="Payload.St |
d140 | 72 69 6e 67 22 3e 66 75 6e 63 20 28 2a 50 61 79 6c 6f 61 64 29 20 3c 61 20 68 72 65 66 3d 22 2f | ring">func.(*Payload).<a.href="/ |
d160 | 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 6c 6c 2f 67 6f 70 61 | src/pkg/github.com/gconnell/gopa |
d180 | 63 6b 65 74 2f 62 61 73 65 2e 67 6f 3f 73 3d 31 34 33 39 3a 31 34 37 32 23 4c 33 30 22 3e 53 74 | cket/base.go?s=1439:1472#L30">St |
d1a0 | 72 69 6e 67 3c 2f 61 3e 3c 2f 68 33 3e 0a 09 09 09 09 3c 70 72 65 3e 66 75 6e 63 20 28 70 20 2a | ring</a></h3>.....<pre>func.(p.* |
d1c0 | 50 61 79 6c 6f 61 64 29 20 53 74 72 69 6e 67 28 29 20 73 74 72 69 6e 67 3c 2f 70 72 65 3e 0a 09 | Payload).String().string</pre>.. |
d1e0 | 09 09 09 0a 09 09 09 09 0a 09 09 09 09 0a 09 09 09 0a 09 09 0a 09 09 09 0a 09 09 09 0a 09 09 09 | ................................ |
d200 | 3c 68 32 20 69 64 3d 22 54 72 61 6e 73 70 6f 72 74 4c 61 79 65 72 22 3e 74 79 70 65 20 3c 61 20 | <h2.id="TransportLayer">type.<a. |
d220 | 68 72 65 66 3d 22 2f 73 72 63 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 | href="/src/pkg/github.com/gconne |
d240 | 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 62 61 73 65 2e 67 6f 3f 73 3d 32 30 31 30 3a 32 30 37 32 23 | ll/gopacket/base.go?s=2010:2072# |
d260 | 4c 35 30 22 3e 54 72 61 6e 73 70 6f 72 74 4c 61 79 65 72 3c 2f 61 3e 3c 2f 68 32 3e 0a 09 09 09 | L50">TransportLayer</a></h2>.... |
d280 | 3c 70 72 65 3e 74 79 70 65 20 54 72 61 6e 73 70 6f 72 74 4c 61 79 65 72 20 69 6e 74 65 72 66 61 | <pre>type.TransportLayer.interfa |
d2a0 | 63 65 20 7b 0a 20 20 20 20 4c 61 79 65 72 0a 20 20 20 20 54 72 61 6e 73 70 6f 72 74 46 6c 6f 77 | ce.{.....Layer.....TransportFlow |
d2c0 | 28 29 20 46 6c 6f 77 0a 7d 3c 2f 70 72 65 3e 0a 09 09 09 3c 70 3e 0a 54 72 61 6e 73 70 6f 72 74 | ().Flow.}</pre>....<p>.Transport |
d2e0 | 4c 61 79 65 72 20 69 73 20 74 68 65 20 70 61 63 6b 65 74 20 6c 61 79 65 72 20 63 6f 72 72 65 73 | Layer.is.the.packet.layer.corres |
d300 | 70 6f 6e 64 69 6e 67 20 74 6f 20 74 68 65 20 54 43 50 2f 49 50 20 6c 61 79 65 72 20 33 20 28 4f | ponding.to.the.TCP/IP.layer.3.(O |
d320 | 53 49 0a 6c 61 79 65 72 20 34 29 0a 3c 2f 70 3e 0a 0a 0a 09 09 09 0a 0a 09 09 09 0a 0a 09 09 09 | SI.layer.4).</p>................ |
d340 | 0a 0a 09 09 09 0a 0a 09 09 09 0a 09 d8 b2 e9 50 97 0c 07 00 ee 03 00 00 ee 03 00 00 1e 00 00 00 | ...............P................ |
d360 | 60 01 88 91 03 c2 06 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 | `......@........................ |
d380 | 00 00 00 00 00 00 00 01 1f 90 e5 af 0a 66 36 17 08 97 18 4a 80 18 23 02 03 ca 00 00 01 01 08 0a | .............f6....J..#......... |
d3a0 | 05 c0 8d b6 05 c0 8c fc 09 0a 09 09 3c 2f 64 69 76 3e 0a 09 0a 0a 09 0a 0a 0a 0a 0a 0a 0a 0a 09 | ............</div>.............. |
d3c0 | 0a 09 0a 09 09 3c 68 32 20 69 64 3d 22 70 6b 67 2d 73 75 62 64 69 72 65 63 74 6f 72 69 65 73 22 | .....<h2.id="pkg-subdirectories" |
d3e0 | 3e 53 75 62 64 69 72 65 63 74 6f 72 69 65 73 3c 2f 68 32 3e 0a 09 0a 09 3c 74 61 62 6c 65 20 63 | >Subdirectories</h2>....<table.c |
d400 | 6c 61 73 73 3d 22 64 69 72 22 3e 0a 09 3c 74 72 3e 0a 09 3c 74 68 3e 4e 61 6d 65 3c 2f 74 68 3e | lass="dir">..<tr>..<th>Name</th> |
d420 | 0a 09 3c 74 68 3e 26 6e 62 73 70 3b 26 6e 62 73 70 3b 26 6e 62 73 70 3b 26 6e 62 73 70 3b 3c 2f | ..<th> </ |
d440 | 74 68 3e 0a 09 3c 74 68 20 73 74 79 6c 65 3d 22 74 65 78 74 2d 61 6c 69 67 6e 3a 20 6c 65 66 74 | th>..<th.style="text-align:.left |
d460 | 3b 20 77 69 64 74 68 3a 20 61 75 74 6f 22 3e 53 79 6e 6f 70 73 69 73 3c 2f 74 68 3e 0a 09 3c 2f | ;.width:.auto">Synopsis</th>..</ |
d480 | 74 72 3e 0a 09 0a 09 09 3c 74 72 3e 0a 09 09 3c 74 64 3e 3c 61 20 68 72 65 66 3d 22 2e 2e 22 3e | tr>.....<tr>...<td><a.href=".."> |
d4a0 | 2e 2e 3c 2f 61 3e 3c 2f 74 64 3e 0a 09 09 3c 2f 74 72 3e 0a 09 0a 09 0a 09 09 0a 09 09 09 3c 74 | ..</a></td>...</tr>...........<t |
d4c0 | 72 3e 0a 09 09 09 3c 74 64 20 63 6c 61 73 73 3d 22 6e 61 6d 65 22 3e 3c 61 20 68 72 65 66 3d 22 | r>....<td.class="name"><a.href=" |
d4e0 | 6c 61 79 65 72 73 2f 22 3e 6c 61 79 65 72 73 3c 2f 61 3e 3c 2f 74 64 3e 0a 09 09 09 3c 74 64 3e | layers/">layers</a></td>....<td> |
d500 | 26 6e 62 73 70 3b 26 6e 62 73 70 3b 26 6e 62 73 70 3b 26 6e 62 73 70 3b 3c 2f 74 64 3e 0a 09 09 | </td>... |
d520 | 09 3c 74 64 20 73 74 79 6c 65 3d 22 77 69 64 74 68 3a 20 61 75 74 6f 22 3e 50 61 63 6b 61 67 65 | .<td.style="width:.auto">Package |
d540 | 20 6c 61 79 65 72 73 20 70 72 6f 76 69 64 65 73 20 64 65 63 6f 64 69 6e 67 20 6c 61 79 65 72 73 | .layers.provides.decoding.layers |
d560 | 20 66 6f 72 20 6d 61 6e 79 20 63 6f 6d 6d 6f 6e 20 70 72 6f 74 6f 63 6f 6c 73 2e 3c 2f 74 64 3e | .for.many.common.protocols.</td> |
d580 | 0a 09 09 09 3c 2f 74 72 3e 0a 09 09 0a 09 0a 09 09 0a 09 09 09 3c 74 72 3e 0a 09 09 09 3c 74 64 | ....</tr>............<tr>....<td |
d5a0 | 20 63 6c 61 73 73 3d 22 6e 61 6d 65 22 3e 3c 61 20 68 72 65 66 3d 22 70 63 61 70 2f 22 3e 70 63 | .class="name"><a.href="pcap/">pc |
d5c0 | 61 70 3c 2f 61 3e 3c 2f 74 64 3e 0a 09 09 09 3c 74 64 3e 26 6e 62 73 70 3b 26 6e 62 73 70 3b 26 | ap</a></td>....<td> & |
d5e0 | 6e 62 73 70 3b 26 6e 62 73 70 3b 3c 2f 74 64 3e 0a 09 09 09 3c 74 64 20 73 74 79 6c 65 3d 22 77 | nbsp; </td>....<td.style="w |
d600 | 69 64 74 68 3a 20 61 75 74 6f 22 3e 50 61 63 6b 61 67 65 20 70 63 61 70 20 61 6c 6c 6f 77 73 20 | idth:.auto">Package.pcap.allows. |
d620 | 75 73 65 72 73 20 6f 66 20 67 6f 70 61 63 6b 65 74 20 74 6f 20 72 65 61 64 20 70 61 63 6b 65 74 | users.of.gopacket.to.read.packet |
d640 | 73 20 6f 66 66 20 74 68 65 20 77 69 72 65 20 6f 72 20 66 72 6f 6d 20 70 63 61 70 20 66 69 6c 65 | s.off.the.wire.or.from.pcap.file |
d660 | 73 2e 3c 2f 74 64 3e 0a 09 09 09 3c 2f 74 72 3e 0a 09 09 0a 09 0a 09 09 0a 09 09 09 3c 74 72 3e | s.</td>....</tr>............<tr> |
d680 | 0a 09 09 09 3c 74 64 20 63 6c 61 73 73 3d 22 6e 61 6d 65 22 3e 3c 61 20 68 72 65 66 3d 22 70 66 | ....<td.class="name"><a.href="pf |
d6a0 | 72 69 6e 67 2f 22 3e 70 66 72 69 6e 67 3c 2f 61 3e 3c 2f 74 64 3e 0a 09 09 09 3c 74 64 3e 26 6e | ring/">pfring</a></td>....<td>&n |
d6c0 | 62 73 70 3b 26 6e 62 73 70 3b 26 6e 62 73 70 3b 26 6e 62 73 70 3b 3c 2f 74 64 3e 0a 09 09 09 3c | bsp; </td>....< |
d6e0 | 74 64 20 73 74 79 6c 65 3d 22 77 69 64 74 68 3a 20 61 75 74 6f 22 3e 50 61 63 6b 61 67 65 20 70 | td.style="width:.auto">Package.p |
d700 | 66 72 69 6e 67 20 77 72 61 70 73 20 74 68 65 20 50 46 5f 52 49 4e 47 20 43 20 6c 69 62 72 61 72 | fring.wraps.the.PF_RING.C.librar |
d720 | 79 20 66 6f 72 20 47 6f 2e 3c 2f 74 64 3e 0a 09 09 09 3c 2f 74 72 3e 0a 09 09 0a 09 0a 09 3c 2f | y.for.Go.</td>....</tr>.......</ |
d740 | 74 61 62 6c 65 3e 0a 09 0a 0a d8 b2 e9 50 b6 0c 07 00 4c 00 00 00 4c 00 00 00 1e 00 00 00 60 00 | table>.......P....L...L.......`. |
d760 | 00 00 00 20 06 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 | .....@.......................... |
d780 | 00 00 00 00 00 01 e5 af 1f 90 08 97 18 4a 0a 65 76 ef 80 10 27 e9 00 28 00 00 01 01 08 0a 05 c0 | .............J.ev...'..(........ |
d7a0 | 8d b6 05 c0 8d b6 d8 b2 e9 50 ba 0c 07 00 50 03 00 00 50 03 00 00 1e 00 00 00 60 01 88 91 03 24 | .........P....P...P.......`....$ |
d7c0 | 06 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | .@.............................. |
d7e0 | 00 01 1f 90 e5 af 0a 66 39 b9 08 97 18 4a 80 18 23 02 03 2c 00 00 01 01 08 0a 05 c0 8d b6 05 c0 | .......f9....J..#..,............ |
d800 | 8c fc 0d 0a 32 61 0d 0a 0a 0a 3c 2f 64 69 76 3e 0a 0a 3c 64 69 76 20 69 64 3d 22 66 6f 6f 74 65 | ....2a....</div>..<div.id="foote |
d820 | 72 22 3e 0a 42 75 69 6c 64 20 76 65 72 73 69 6f 6e 20 0d 0a 37 0d 0a 67 6f 31 2e 30 2e 33 0d 0a | r">.Build.version...7..go1.0.3.. |
d840 | 32 62 61 0d 0a 2e 3c 62 72 3e 0a 45 78 63 65 70 74 20 61 73 20 3c 61 20 68 72 65 66 3d 22 68 74 | 2ba...<br>.Except.as.<a.href="ht |
d860 | 74 70 3a 2f 2f 63 6f 64 65 2e 67 6f 6f 67 6c 65 2e 63 6f 6d 2f 70 6f 6c 69 63 69 65 73 2e 68 74 | tp://code.google.com/policies.ht |
d880 | 6d 6c 23 72 65 73 74 72 69 63 74 69 6f 6e 73 22 3e 6e 6f 74 65 64 3c 2f 61 3e 2c 0a 74 68 65 20 | ml#restrictions">noted</a>,.the. |
d8a0 | 63 6f 6e 74 65 6e 74 20 6f 66 20 74 68 69 73 20 70 61 67 65 20 69 73 20 6c 69 63 65 6e 73 65 64 | content.of.this.page.is.licensed |
d8c0 | 20 75 6e 64 65 72 20 74 68 65 0a 43 72 65 61 74 69 76 65 20 43 6f 6d 6d 6f 6e 73 20 41 74 74 72 | .under.the.Creative.Commons.Attr |
d8e0 | 69 62 75 74 69 6f 6e 20 33 2e 30 20 4c 69 63 65 6e 73 65 2c 0a 61 6e 64 20 63 6f 64 65 20 69 73 | ibution.3.0.License,.and.code.is |
d900 | 20 6c 69 63 65 6e 73 65 64 20 75 6e 64 65 72 20 61 20 3c 61 20 68 72 65 66 3d 22 2f 4c 49 43 45 | .licensed.under.a.<a.href="/LICE |
d920 | 4e 53 45 22 3e 42 53 44 20 6c 69 63 65 6e 73 65 3c 2f 61 3e 2e 3c 62 72 3e 0a 3c 61 20 68 72 65 | NSE">BSD.license</a>.<br>.<a.hre |
d940 | 66 3d 22 2f 64 6f 63 2f 74 6f 73 2e 68 74 6d 6c 22 3e 54 65 72 6d 73 20 6f 66 20 53 65 72 76 69 | f="/doc/tos.html">Terms.of.Servi |
d960 | 63 65 3c 2f 61 3e 20 7c 20 0a 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 67 6f | ce</a>.|..<a.href="http://www.go |
d980 | 6f 67 6c 65 2e 63 6f 6d 2f 69 6e 74 6c 2f 65 6e 2f 70 6f 6c 69 63 69 65 73 2f 70 72 69 76 61 63 | ogle.com/intl/en/policies/privac |
d9a0 | 79 2f 22 3e 50 72 69 76 61 63 79 20 50 6f 6c 69 63 79 3c 2f 61 3e 0a 3c 2f 64 69 76 3e 0a 0a 3c | y/">Privacy.Policy</a>.</div>..< |
d9c0 | 2f 62 6f 64 79 3e 0a 3c 73 63 72 69 70 74 20 74 79 70 65 3d 22 74 65 78 74 2f 6a 61 76 61 73 63 | /body>.<script.type="text/javasc |
d9e0 | 72 69 70 74 22 3e 0a 20 20 28 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 20 20 20 20 76 61 72 20 70 | ript">...(function().{.....var.p |
da00 | 6f 20 3d 20 64 6f 63 75 6d 65 6e 74 2e 63 72 65 61 74 65 45 6c 65 6d 65 6e 74 28 27 73 63 72 69 | o.=.document.createElement('scri |
da20 | 70 74 27 29 3b 20 70 6f 2e 74 79 70 65 20 3d 20 27 74 65 78 74 2f 6a 61 76 61 73 63 72 69 70 74 | pt');.po.type.=.'text/javascript |
da40 | 27 3b 20 70 6f 2e 61 73 79 6e 63 20 3d 20 74 72 75 65 3b 0a 20 20 20 20 70 6f 2e 73 72 63 20 3d | ';.po.async.=.true;.....po.src.= |
da60 | 20 27 68 74 74 70 73 3a 2f 2f 61 70 69 73 2e 67 6f 6f 67 6c 65 2e 63 6f 6d 2f 6a 73 2f 70 6c 75 | .'https://apis.google.com/js/plu |
da80 | 73 6f 6e 65 2e 6a 73 27 3b 0a 20 20 20 20 76 61 72 20 73 20 3d 20 64 6f 63 75 6d 65 6e 74 2e 67 | sone.js';.....var.s.=.document.g |
daa0 | 65 74 45 6c 65 6d 65 6e 74 73 42 79 54 61 67 4e 61 6d 65 28 27 73 63 72 69 70 74 27 29 5b 30 5d | etElementsByTagName('script')[0] |
dac0 | 3b 20 73 2e 70 61 72 65 6e 74 4e 6f 64 65 2e 69 6e 73 65 72 74 42 65 66 6f 72 65 28 70 6f 2c 20 | ;.s.parentNode.insertBefore(po,. |
dae0 | 73 29 3b 0a 20 20 7d 29 28 29 3b 0a 3c 2f 73 63 72 69 70 74 3e 0a 3c 2f 68 74 6d 6c 3e 0a 0a 0d | s);...})();.</script>.</html>... |
db00 | 0a 30 0d 0a 0d 0a d8 b2 e9 50 cf 0c 07 00 4c 00 00 00 4c 00 00 00 1e 00 00 00 60 00 00 00 00 20 | .0.......P....L...L.......`..... |
db20 | 06 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | .@.............................. |
db40 | 00 01 e5 af 1f 90 08 97 18 4a 0a 65 f6 5f 80 10 1f f2 00 28 00 00 01 01 08 0a 05 c0 8d b6 05 c0 | .........J.e._.....(............ |
db60 | 8d b6 d8 b2 e9 50 ec 0c 07 00 4c 00 00 00 4c 00 00 00 1e 00 00 00 60 00 00 00 00 20 06 40 00 00 | .....P....L...L.......`......@.. |
db80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 e5 af | ................................ |
dba0 | 1f 90 08 97 18 4a 0a 66 39 b9 80 10 3b 98 00 28 00 00 01 01 08 0a 05 c0 8d b6 05 c0 8d b6 d8 b2 | .....J.f9...;..(................ |
dbc0 | e9 50 08 0d 07 00 4c 00 00 00 4c 00 00 00 1e 00 00 00 60 00 00 00 00 20 06 40 00 00 00 00 00 00 | .P....L...L.......`......@...... |
dbe0 | 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 e5 af 1f 90 08 97 | ................................ |
dc00 | 18 4a 0a 66 3c bd 80 10 3b 68 00 28 00 00 01 01 08 0a 05 c0 8d b6 05 c0 8d b6 d8 b2 e9 50 c1 bb | .J.f<...;h.(.................P.. |
dc20 | 07 00 3e 02 00 00 3e 02 00 00 1e 00 00 00 60 00 00 00 02 12 06 40 00 00 00 00 00 00 00 00 00 00 | ..>...>.......`......@.......... |
dc40 | 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 e5 af 1f 90 08 97 18 4a 0a 66 | .............................J.f |
dc60 | 3c bd 80 18 3b 68 02 1a 00 00 01 01 08 0a 05 c0 8d e0 05 c0 8d b6 47 45 54 20 2f 64 6f 63 2f 73 | <...;h................GET./doc/s |
dc80 | 74 79 6c 65 2e 63 73 73 20 48 54 54 50 2f 31 2e 31 0d 0a 48 6f 73 74 3a 20 6c 6f 63 61 6c 68 6f | tyle.css.HTTP/1.1..Host:.localho |
dca0 | 73 74 3a 38 30 38 30 0d 0a 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 6b 65 65 70 2d 61 6c 69 76 65 0d | st:8080..Connection:.keep-alive. |
dcc0 | 0a 43 61 63 68 65 2d 43 6f 6e 74 72 6f 6c 3a 20 6d 61 78 2d 61 67 65 3d 30 0d 0a 49 66 2d 4d 6f | .Cache-Control:.max-age=0..If-Mo |
dce0 | 64 69 66 69 65 64 2d 53 69 6e 63 65 3a 20 53 61 74 2c 20 30 31 20 44 65 63 20 32 30 31 32 20 31 | dified-Since:.Sat,.01.Dec.2012.1 |
dd00 | 38 3a 30 35 3a 35 39 20 47 4d 54 0d 0a 55 73 65 72 2d 41 67 65 6e 74 3a 20 4d 6f 7a 69 6c 6c 61 | 8:05:59.GMT..User-Agent:.Mozilla |
dd20 | 2f 35 2e 30 20 28 4d 61 63 69 6e 74 6f 73 68 3b 20 49 6e 74 65 6c 20 4d 61 63 20 4f 53 20 58 20 | /5.0.(Macintosh;.Intel.Mac.OS.X. |
dd40 | 31 30 5f 38 5f 32 29 20 41 70 70 6c 65 57 65 62 4b 69 74 2f 35 33 37 2e 31 31 20 28 4b 48 54 4d | 10_8_2).AppleWebKit/537.11.(KHTM |
dd60 | 4c 2c 20 6c 69 6b 65 20 47 65 63 6b 6f 29 20 43 68 72 6f 6d 65 2f 32 33 2e 30 2e 31 32 37 31 2e | L,.like.Gecko).Chrome/23.0.1271. |
dd80 | 31 30 31 20 53 61 66 61 72 69 2f 35 33 37 2e 31 31 0d 0a 41 63 63 65 70 74 3a 20 74 65 78 74 2f | 101.Safari/537.11..Accept:.text/ |
dda0 | 63 73 73 2c 2a 2f 2a 3b 71 3d 30 2e 31 0d 0a 52 65 66 65 72 65 72 3a 20 68 74 74 70 3a 2f 2f 6c | css,*/*;q=0.1..Referer:.http://l |
ddc0 | 6f 63 61 6c 68 6f 73 74 3a 38 30 38 30 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f | ocalhost:8080/pkg/github.com/gco |
dde0 | 6e 6e 65 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 0d 0a 41 63 63 65 70 74 2d 45 6e 63 6f 64 69 6e 67 | nnell/gopacket/..Accept-Encoding |
de00 | 3a 20 67 7a 69 70 2c 64 65 66 6c 61 74 65 2c 73 64 63 68 0d 0a 41 63 63 65 70 74 2d 4c 61 6e 67 | :.gzip,deflate,sdch..Accept-Lang |
de20 | 75 61 67 65 3a 20 65 6e 2d 55 53 2c 65 6e 3b 71 3d 30 2e 38 0d 0a 41 63 63 65 70 74 2d 43 68 61 | uage:.en-US,en;q=0.8..Accept-Cha |
de40 | 72 73 65 74 3a 20 49 53 4f 2d 38 38 35 39 2d 31 2c 75 74 66 2d 38 3b 71 3d 30 2e 37 2c 2a 3b 71 | rset:.ISO-8859-1,utf-8;q=0.7,*;q |
de60 | 3d 30 2e 33 0d 0a 0d 0a d8 b2 e9 50 ee bb 07 00 4c 00 00 00 4c 00 00 00 1e 00 00 00 60 01 88 91 | =0.3.......P....L...L.......`... |
de80 | 00 20 06 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 | ...@............................ |
dea0 | 00 00 00 01 1f 90 e5 af 0a 66 3c bd 08 97 1a 3c 80 10 22 e3 00 28 00 00 01 01 08 0a 05 c0 8d e0 | .........f<....<.."..(.......... |
dec0 | 05 c0 8d e0 d8 b2 e9 50 9e bd 07 00 8e 00 00 00 8e 00 00 00 1e 00 00 00 60 01 88 91 00 62 06 40 | .......P................`....b.@ |
dee0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 | ................................ |
df00 | 1f 90 e5 af 0a 66 3c bd 08 97 1a 3c 80 18 22 e3 00 6a 00 00 01 01 08 0a 05 c0 8d e0 05 c0 8d e0 | .....f<....<.."..j.............. |
df20 | 48 54 54 50 2f 31 2e 31 20 33 30 34 20 4e 6f 74 20 4d 6f 64 69 66 69 65 64 0d 0a 44 61 74 65 3a | HTTP/1.1.304.Not.Modified..Date: |
df40 | 20 53 75 6e 2c 20 30 36 20 4a 61 6e 20 32 30 31 33 20 31 37 3a 32 32 3a 33 32 20 47 4d 54 0d 0a | .Sun,.06.Jan.2013.17:22:32.GMT.. |
df60 | 0d 0a d8 b2 e9 50 b8 bd 07 00 4c 00 00 00 4c 00 00 00 1e 00 00 00 60 00 00 00 00 20 06 40 00 00 | .....P....L...L.......`......@.. |
df80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 e5 af | ................................ |
dfa0 | 1f 90 08 97 1a 3c 0a 66 3c ff 80 10 3b 64 00 28 00 00 01 01 08 0a 05 c0 8d e0 05 c0 8d e0 d8 b2 | .....<.f<...;d.(................ |
dfc0 | e9 50 09 bf 07 00 58 00 00 00 58 00 00 00 1e 00 00 00 60 00 00 00 00 2c 06 40 00 00 00 00 00 00 | .P....X...X.......`....,.@...... |
dfe0 | 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 e5 b6 1f 90 67 e3 | ..............................g. |
e000 | 4c 90 00 00 00 00 b0 02 ff ff 00 34 00 00 02 04 3f c4 01 03 03 04 01 01 08 0a 05 c0 8d e0 00 00 | L..........4....?............... |
e020 | 00 00 04 02 00 00 d8 b2 e9 50 3d bf 07 00 58 00 00 00 58 00 00 00 1e 00 00 00 60 01 88 94 00 2c | .........P=...X...X.......`...., |
e040 | 06 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | .@.............................. |
e060 | 00 01 1f 90 e5 b6 26 47 47 6c 67 e3 4c 91 b0 12 ff ff 00 34 00 00 02 04 3f c4 01 03 03 04 01 01 | ......&GGlg.L......4....?....... |
e080 | 08 0a 05 c0 8d e0 05 c0 8d e0 04 02 00 00 d8 b2 e9 50 4d bf 07 00 4c 00 00 00 4c 00 00 00 1e 00 | .................PM...L...L..... |
e0a0 | 00 00 60 00 00 00 00 20 06 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 | ..`......@...................... |
e0c0 | 00 00 00 00 00 00 00 00 00 01 e5 b6 1f 90 67 e3 4c 91 26 47 47 6d 80 10 23 d7 00 28 00 00 01 01 | ..............g.L.&GGm..#..(.... |
e0e0 | 08 0a 05 c0 8d e0 05 c0 8d e0 d8 b2 e9 50 5b bf 07 00 4c 00 00 00 4c 00 00 00 1e 00 00 00 60 01 | .............P[...L...L.......`. |
e100 | 88 94 00 20 06 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 | .....@.......................... |
e120 | 00 00 00 00 00 01 1f 90 e5 b6 26 47 47 6d 67 e3 4c 91 80 10 23 d7 00 28 00 00 01 01 08 0a 05 c0 | ..........&GGmg.L...#..(........ |
e140 | 8d e0 05 c0 8d e0 d8 b2 e9 50 fd c2 07 00 2f 02 00 00 2f 02 00 00 1e 00 00 00 60 00 00 00 02 03 | .........P..../.../.......`..... |
e160 | 06 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | .@.............................. |
e180 | 00 01 e5 af 1f 90 08 97 1a 3c 0a 66 3c ff 80 18 3b 64 02 0b 00 00 01 01 08 0a 05 c0 8d e1 05 c0 | .........<.f<...;d.............. |
e1a0 | 8d e0 47 45 54 20 2f 64 6f 63 2f 67 6f 64 6f 63 73 2e 6a 73 20 48 54 54 50 2f 31 2e 31 0d 0a 48 | ..GET./doc/godocs.js.HTTP/1.1..H |
e1c0 | 6f 73 74 3a 20 6c 6f 63 61 6c 68 6f 73 74 3a 38 30 38 30 0d 0a 43 6f 6e 6e 65 63 74 69 6f 6e 3a | ost:.localhost:8080..Connection: |
e1e0 | 20 6b 65 65 70 2d 61 6c 69 76 65 0d 0a 43 61 63 68 65 2d 43 6f 6e 74 72 6f 6c 3a 20 6d 61 78 2d | .keep-alive..Cache-Control:.max- |
e200 | 61 67 65 3d 30 0d 0a 49 66 2d 4d 6f 64 69 66 69 65 64 2d 53 69 6e 63 65 3a 20 4d 6f 6e 2c 20 31 | age=0..If-Modified-Since:.Mon,.1 |
e220 | 34 20 4d 61 79 20 32 30 31 32 20 30 36 3a 35 37 3a 35 37 20 47 4d 54 0d 0a 55 73 65 72 2d 41 67 | 4.May.2012.06:57:57.GMT..User-Ag |
e240 | 65 6e 74 3a 20 4d 6f 7a 69 6c 6c 61 2f 35 2e 30 20 28 4d 61 63 69 6e 74 6f 73 68 3b 20 49 6e 74 | ent:.Mozilla/5.0.(Macintosh;.Int |
e260 | 65 6c 20 4d 61 63 20 4f 53 20 58 20 31 30 5f 38 5f 32 29 20 41 70 70 6c 65 57 65 62 4b 69 74 2f | el.Mac.OS.X.10_8_2).AppleWebKit/ |
e280 | 35 33 37 2e 31 31 20 28 4b 48 54 4d 4c 2c 20 6c 69 6b 65 20 47 65 63 6b 6f 29 20 43 68 72 6f 6d | 537.11.(KHTML,.like.Gecko).Chrom |
e2a0 | 65 2f 32 33 2e 30 2e 31 32 37 31 2e 31 30 31 20 53 61 66 61 72 69 2f 35 33 37 2e 31 31 0d 0a 41 | e/23.0.1271.101.Safari/537.11..A |
e2c0 | 63 63 65 70 74 3a 20 2a 2f 2a 0d 0a 52 65 66 65 72 65 72 3a 20 68 74 74 70 3a 2f 2f 6c 6f 63 61 | ccept:.*/*..Referer:.http://loca |
e2e0 | 6c 68 6f 73 74 3a 38 30 38 30 2f 70 6b 67 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 63 6f 6e 6e 65 | lhost:8080/pkg/github.com/gconne |
e300 | 6c 6c 2f 67 6f 70 61 63 6b 65 74 2f 0d 0a 41 63 63 65 70 74 2d 45 6e 63 6f 64 69 6e 67 3a 20 67 | ll/gopacket/..Accept-Encoding:.g |
e320 | 7a 69 70 2c 64 65 66 6c 61 74 65 2c 73 64 63 68 0d 0a 41 63 63 65 70 74 2d 4c 61 6e 67 75 61 67 | zip,deflate,sdch..Accept-Languag |
e340 | 65 3a 20 65 6e 2d 55 53 2c 65 6e 3b 71 3d 30 2e 38 0d 0a 41 63 63 65 70 74 2d 43 68 61 72 73 65 | e:.en-US,en;q=0.8..Accept-Charse |
e360 | 74 3a 20 49 53 4f 2d 38 38 35 39 2d 31 2c 75 74 66 2d 38 3b 71 3d 30 2e 37 2c 2a 3b 71 3d 30 2e | t:.ISO-8859-1,utf-8;q=0.7,*;q=0. |
e380 | 33 0d 0a 0d 0a d8 b2 e9 50 22 c3 07 00 4c 00 00 00 4c 00 00 00 1e 00 00 00 60 01 88 91 00 20 06 | 3.......P"...L...L.......`...... |
e3a0 | 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | @............................... |
e3c0 | 01 1f 90 e5 af 0a 66 3c ff 08 97 1c 1f 80 10 22 c4 00 28 00 00 01 01 08 0a 05 c0 8d e1 05 c0 8d | ......f<......."..(............. |
e3e0 | e1 d8 b2 e9 50 00 c4 07 00 8e 00 00 00 8e 00 00 00 1e 00 00 00 60 01 88 91 00 62 06 40 00 00 00 | ....P................`....b.@... |
e400 | 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 1f 90 e5 | ................................ |
e420 | af 0a 66 3c ff 08 97 1c 1f 80 18 22 c4 00 6a 00 00 01 01 08 0a 05 c0 8d e2 05 c0 8d e1 48 54 54 | ..f<......."..j..............HTT |
e440 | 50 2f 31 2e 31 20 33 30 34 20 4e 6f 74 20 4d 6f 64 69 66 69 65 64 0d 0a 44 61 74 65 3a 20 53 75 | P/1.1.304.Not.Modified..Date:.Su |
e460 | 6e 2c 20 30 36 20 4a 61 6e 20 32 30 31 33 20 31 37 3a 32 32 3a 33 32 20 47 4d 54 0d 0a 0d 0a d8 | n,.06.Jan.2013.17:22:32.GMT..... |
e480 | b2 e9 50 1f c4 07 00 4c 00 00 00 4c 00 00 00 1e 00 00 00 60 00 00 00 00 20 06 40 00 00 00 00 00 | ..P....L...L.......`......@..... |
e4a0 | 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 e5 af 1f 90 08 | ................................ |
e4c0 | 97 1c 1f 0a 66 3d 41 80 10 3b 60 00 28 00 00 01 01 08 0a 05 c0 8d e2 05 c0 8d e2 | ....f=A..;`.(.............. |