
import qualified Data.ByteString.Char8 as C
import           Data.IP
import           Data.Serialize        (decode)
import           Data.TCP

data Packet = Packet {
    ipv4Header :: IPv4Header,
    tcpHeader  :: TCPHeader,
    body       :: C.ByteString
} deriving Show

parseByteString :: C.ByteString -> Packet
parseByteString bs = do
    let ipBs = stripLinkLayerHeader bs