nettle-openflow-0.1: High level configuration and control of computer networks.

Nettle.Ethernet.EthernetFrame

Contents

Description

This module provides data structures for Ethernet frames as well as parsers and unparsers for Ethernet frames.

Synopsis

Data types

data EthernetFrame Source

An Ethernet frame consists of an Ethernet header and an Ethernet body.

type EthernetTypeCode = Word16Source

Ethernet type code, determines the type of payload carried by an Ethernet frame.

data EthernetBody Source

The body of an Ethernet frame is either an IP packet, an ARP packet, or an uninterpreted ByteString

data ARPOpCode Source

Type of ARP message.

Constructors

ARPRequest 
ARPReply 

Parsers and unparsers

type GetE a = ErrorT ErrorMessage Get aSource

Type of parsers that can fail with an error message

type ErrorMessage = StringSource

When a GetE parser fails, it provides an error message as a string

runGetE :: GetE a -> ByteString -> Either ErrorMessage aSource

Method to run a GetE parser

getEthernetFrame :: GetE EthernetFrameSource

Parser for Ethernet frames.

getEthHeader :: GetE EthernetHeaderSource

Parser for Ethernet headers.

putEthHeader :: EthernetHeader -> PutSource

Unparser for Ethernet headers.

getARPPacket :: GetE ARPPacketSource

Parser for ARP packets