48 lines
1.9 KiB
HTML
48 lines
1.9 KiB
HTML
{{define "title"}}Split pcap{{end}}
|
|
|
|
{{define "content"}}
|
|
{{with .Data}}
|
|
<h1>Split pcap</h1>
|
|
<p class="lead">
|
|
Upload a pcap file and split it into several files by packet count or by file size.
|
|
The parts are downloaded together as a zip.
|
|
Packets are copied unchanged, and each part keeps the original file header.
|
|
</p>
|
|
|
|
{{if .Error}}<div class="error" role="alert">{{.Error}}</div>{{end}}
|
|
|
|
<form method="post" action="/split" enctype="multipart/form-data">
|
|
<label for="file">pcap file <span class="hint">classic pcap, up to {{.MaxUpload}}. Convert pcapng with <code>editcap -F pcap</code></span></label>
|
|
<input id="file" name="file" type="file" accept=".pcap,.cap,.dmp,application/vnd.tcpdump.pcap" required>
|
|
|
|
<fieldset class="modes">
|
|
<legend>Split by</legend>
|
|
<label class="check">
|
|
<input type="radio" name="mode" value="packets"{{if eq .Form.Mode "packets"}} checked{{end}}>
|
|
At most
|
|
<input name="packets" class="num" inputmode="numeric" value="{{.Form.Packets}}" aria-label="Packets per file">
|
|
packets per file
|
|
</label>
|
|
<label class="check">
|
|
<input type="radio" name="mode" value="size"{{if eq .Form.Mode "size"}} checked{{end}}>
|
|
At most
|
|
<input name="size" class="num" inputmode="decimal" value="{{.Form.Size}}" aria-label="Size per file">
|
|
<select name="unit" class="unit" aria-label="Size unit">
|
|
{{range .Units}}<option{{if eq . $.Data.Form.Unit}} selected{{end}}>{{.}}</option>{{end}}
|
|
</select>
|
|
per file
|
|
<span class="hint">1 MB = 1,000,000 bytes. A packet bigger than this gets a file to itself.</span>
|
|
</label>
|
|
</fieldset>
|
|
|
|
<p class="note">
|
|
At most {{.MaxParts}} output files. If the capture ends with a truncated packet, that packet is dropped.
|
|
</p>
|
|
|
|
<div class="actions">
|
|
<button type="submit" class="primary">Split and download zip</button>
|
|
</div>
|
|
</form>
|
|
{{end}}
|
|
{{end}}
|