Last active
April 27, 2021 04:39
-
-
Save jeanqasaur/fedbd76ee8d5a7c36f6c80c11bcf4be4 to your computer and use it in GitHub Desktop.
Example implementation of the Stream interface for packet processing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tcpStream represents a pair of uni-directional tcpFlows. It | |
// implements reassembly.Stream interface to receive reassembled | |
// packets for BOTH flows, which it then directs to the correct | |
// tcpFlow. | |
type tcpStream struct { | |
clock clockWrapper // constant | |
bidiID akinet.TCPBidiID // constant | |
// Network layer flow. | |
netFlow gopacket.Flow | |
// flows is populated upon seeing the first packet. | |
flows map[reassembly.TCPFlowDirection]*tcpFlow | |
factorySelector akinet.TCPParserFactorySelector | |
outChan chan<- akinet.ParsedNetworkTraffic | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment