0      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~        ! " # $ % & '!(!)!*!+","-"."/"0"1"2"3"4#5#6#7#8#9#:#;#<#=#>#?#@#A$B$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$[$\$]$^$_$`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z${$|$}$~$$$$$$$$$$$$$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&&&&&''(())))))))))))))))))))*********************************************************++NoneCSafe=Data Buffers, in a direction.Outgoing data.Incoming data.The boolean parameter indicates whether or not the wakeup is happening in the event of a shutdown, or if the original request should be re-run, allowing more data to flow. +Indicate that the action should be retried. 5Indicate that the original action will never succeed. An empty buffer, with a limit. -A queue is empty when all space is available. 1A queue is full when there is no available space.Flush the queue of blocked processes, returning an IO action that negatively acks the waiting processes, and a buffer with an empty wait queue.$Queue a wakeup action into a buffer.Queue bytes into a buffer that has some available space. The first result is the number of bytes written (0, in the Nothing case), and the second is the new buffer.Take bytes off of a buffer. When the buffer is empty, this returns Nothing, otherwise it returns (<= len) bytes and the buffer with that number of bytes removed.pQueue bytes in an outgoing buffer. When there's no space available in the buffer, the wakeup action is queued.8Take bytes off of a sending queue, making room new data.KRead bytes from an incoming buffer, queueing if there are no bytes to read.^Place bytes on the incoming buffer, provided that there is enough space for all of the bytes.     Safe           None@Clear the two bytes at the checksum offset of a rendered packet."Poke a checksum into a bytestring.:Compute the final checksum, using the given initial value.*Compute the checksum of a lazy bytestring.WCompute a partial checksum, yielding a value suitable to be passed to computeChecksum.  None A handle to a scheduled timer.NOTE: This keeps a weak reference to the thread containing the timer, to allow it to still receive exceptions (see mkWeakThreadId)."IDelay an action, giving back a handle to allow the timer to be cancelled.#Delay an action.$Cancel a delayed action. !"#$% !"#$%! "#$% !"#$%Safe4&'()&'()&'()&'()Safe+(Pseudo headers are constructed strictly.-,Discard the result of a monadic computation..2Show a single hex number, padded with a leading 0./Lift a maybe into MonadPlus0Make a singleton list.1)Make a lazy bytestring from a strict one. *+,-./012 *+,-./012 ,+*-./012 *+,-./012Safe34579IN:Success continuation;Failure continuation<Early exit continuationK7Finish early, successfully, with no further processing.)3456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[!3456789:;<=>?@ABCDEFGHIJKLMNOPQRS)DEFGABC[H=>?@<;:789IJZYXWVUTKLMNO6P345QRS3456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[ None479 \]^_`abcde \]^_`abcde bcd\]^_`ae\]^_`abcde None+07fghijklmnopqrstuvwx fghijklmnopqhijxklwvumnfgtsropqfghijklmnopqrstuvwx NoneCsource address | +--------+--------+--------+--------+ | destination address | +--------+--------+--------+--------+ | zero |protocol| length | +--------+--------+--------+--------+#Calculate the size of an IP4 packet#Calculate the size of an IP4 headerGFragment a single IP packet into one or more, given an MTU to fit into.TGiven a fragment size and a packet, fragment the packet into multiple smaller ones.Version| IHL |Type of Service| Total Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Identification |Flags| Fragment Offset | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Time to Live | Protocol | Header Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+JThe final step to render an IP header and its payload out as a bytestring.-yz{|}~,yz{|}~-yz{|}~yz{|}~  None+C Parse out a  UdpHeader, and the size of the payload. Render a  UdpHeader.=Given a way to make the pseudo header, render the UDP packet.TRecreate the UDP checksum, given a rendered packet, and the source and destination.  NoneFV      !"#$%&'()*+,-./0123456789:;<=>?@A\     \     8       !"#$%&'()*+,-./0123456789:;<=>?@ANoneCE !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW? !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQE;<=>?@ABCDEFGHIJKLMNOP9:W()*+,-./012345678V%&'U !"#$TSRQ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWNone35C >An alias to TcpSeqNum, as these two are used in the same role.@The length of the fixed part of the TcpHeader, in 4-byte octets.wRender a TcpHeader. The checksum value is never rendered, as it is expected to be calculated and poked in afterwords.oParse out a TcpHeader, and its length. The resulting length is in bytes, and is derived from the data offset.Render out the Word82 that contains the Control field of the TcpHeader.>Parse out the control flags from the octet that contains them.Get the rendered length of a list of TcpOptions, in 4-byte words, and the number of padding bytes required. This rounds up to the nearest 4-byte word.Parse in known tcp options.Parse a TcpPacket.9Render out a TcpPacket, without calculating its checksum.4Calculate the checksum of a TcpHeader, and its body.GCalculate the checksum of a tcp packet, and return its rendered header.URe-create the checksum, minimizing duplication of the original, rendered TCP packet.`XYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~]XYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~`qrstuvwxyz{|}~nopefghijklm\]^_`abcdXYZ[6XYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~NonenLocal window, containing a buffer of incoming packets, indexed by their sequence number, relative to RCV.NXT.6XXX make this respect the values of size and availableA delivered segment.'Whether or not this is a retransmission!Retransmit timer for this segmentRemote window management..The empty window, seeded with an initial size.4Recalculate internal constants of the remote window.6Set the Snd.Wind.Scale variable for the remote window.0Set the Snd.Wind variable for the remote window.&Adjust the internal available counter.Add a segment to the window.|Process an incoming ack, returning a finalizer, and a new window if there was a matching set of packets waiting for an ack.zUpdate the RTO timer on all segments waiting for an ack. When the timer runs out, output the segment for retransmission.The size of a segment body.Decrement the RTO value on a segment by the timer granularity (500ms). Once the RTO value dips below 1, mark the segment as no longer fresh.ZEmpty local buffer, with an initial sequence number as the next expected sequence number.1Produce a sequence of blocks for the sack option.Recalculate internal constants.%Update the size of the remote window..Add a sequence number to the value of Rcv.Nxt./Set the Rcv.Wind variable for the local window.4Set the Rcv.Wind.Scale variable in the local window.IProcess an incoming packet that needs to pass through the incoming queue.0Queue an incoming packet in the incoming window.BAdvance the window, if there are packets available to be returned.>Generate an incoming segment, relative to the value of RCV.NXT:H :"None7 AManage the timestamp values that are in flight between two hosts.Hz(The current 2MSL value)The initial 2MSL value*7The sequence number to use when responding to messages+The last timestamp used,;The socket that's in TimeWait, plus its current 2MSL value.G!Add a socket to the TimeWait map.HETake one step, collecting any connections whose 2MSL timer goes to 0.I_MSL is 60 seconds, which is slightly more aggressive than the 2 minutes from the original RFC.LUpdate the timestamp value, advancing based on the timestamp granularity. If the number of ticks to advance is 0, don't advance the timestamp.M1Generate timestamp option for an outgoing packet.e      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVe      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVe6789:;<=>?5@01234ABC-./D,&'()*+EFGH%I !"#$JKLM     NOPQRSTUV(       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVNoneZ3Render a UDP message to an unfragmented IP4 packet.[Render an IP4 packet.BWCXYDZ[WXYZ[Z[WXYBWCXYDZ[None0\Mac addresses.^Show a Mac address._3Generates a mask tailored to the given MAC address.`The broadcast mac address. \]^_`abEFGH\]^_`ab\]ab`^_ \]^_`abEFGHNoneC cdefghijklmnI cdefghijklmn hijklcdefgmncdefghijklmnINone3457 rRun the ethernet layer.J)Handle an incoming packet, from a device.K-Get the device associated with a mac address.L-Set the device associated with a mac address.MISend an outgoing ethernet frame via the device that it's associated with.N$Add an ethernet device to the state.ORemove a devicePStop an ethernet device.QStart an ethernet device.$RSTUVWXYZ[\opq]rstuvwxyz^_`JKLMNOPQa opqrstuvwxyz orqpstwxyzuvRSTUVWXYZ[\opq]rstuvwxyz^_`JKLMNOPQaNone ~Open a device by name.(Send an ethernet frame via a tap device.*TODO: make more use of the lazy bytestringIFork a reciever loop, and return an IO action to kill the running thread.,Recieve an ethernet frame from a tap device.{|}~{|}~~}|{{|}~NoneiAssumption: there is not already a pending ARP query recorded in the ARP table for the given IP address.If the ARP table has a fully realized entry for the given IP address, then return it. Otherwise return Pending if we're waiting for this info, or Unknown if nothing is currently known about it.NoneC Nonekk fails on any non  option with an error message.      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{`ab !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_cd     efghijklmnopqrstu~vwxy}|z{6O     M !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~NoneDbB| MBZ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ B: BROADCAST flag MBZ: MUST BE ZERO (reserved for future use) Figure 2: Format of the flags  fieldc]HardwareType is an enumeration of the supported hardware types as assigned in the ARP RFC /http://www.iana.org/assignments/arp-parameters/ is a Transaction ID, a random number chosen by the client, used by the client and server to associate messages and responses between a client and a server. is a low-level message container that is very close to the binary representation of DHCPv4 message. It is suitable for containing any DHCPv4 message. Values of this type should only be created using the publicly exported functions.>Message op code / message type. 1 = BOOTREQUEST, 2 = BOOTREPLYTClient sets to zero, optionally used by relay agents when booting via a relay agent.Transaction ID, a random number chosen by the client, used by the client and server to associate messages and responses between a client and a server._Filled in by client, seconds elapsed since client began address acquisition or renewal process.>Client requests messages be sent to hardware broadcast addressrClient IP address; only filled in if client is in BOUND, RENEW or REBINDING state and can respond to ARP requests.your (client) addressWIP address of next server to use in bootstrap; returned in DHCPOFFER, DHCPACK by server9Relay agent IP address, used in booting via a relay agentClient hardware address1Optional server host name, null terminated stringBoot file name, full terminated string; "generic" name of null in DHCPDISCOVER, fully qualified directory-path name in DHCPOFFEROptional parameters field./ is sent by the DHCPv4 server in response to a . This offer is only valid for a short period of time as the client might receive many offers. The client must next request a lease from a specific server using the information in that server's offer.2The maximum number of relays this message can use.Transaction ID of this exchange5The IPv4 address that this server is willing to lease%The IPv4 address of the DHCPv4 server+The IPv4 address of the DHCPv4 relay server"The hardware address of the client5The options that this server would include in a lease9 is sent by the DHCPv4 server to acknowledge a sucessful t message. Upon receiving this message the client has completed the exchange and has successfully obtained a lease.2The maximum number of relays this message can use. Transaction ID for this exchangeLease: assigned client addressDHCP server's IPv4 addressDHCP relay server's addressClient's hardware address#Lease: duration of lease in seconds,Subset of information requested in previous k is used by the client to discover what servers are available. This message is sent to the IPv4 broadcast..Transaction ID of this and subsequent messagesSet d= to instruct the server to send to broadcast hardware addressHardware address of the client?Used to specify the information that client needs in the offers2 is used by the client to accept an offered lease.Transaction ID of offerSet d9 to instruct server to send to broadcast hardware addressHardware address of the client1Used to specify the information that client needs.Used to specify the address which was accepted* is a sum of the server response messages.) is a sum of the client request messages. define all of the information that would be needed to act as a DHCP server for one client. The server is defined to be able to issue a single "lease" whose parameters are defined below.#The IPv4 address of the DHCP server*Lease: timezone offset in seconds from UTC%Lease: client IPv4 address on networkLease: duration in secondsLease: subnet mask on network#Lease: broadcast address on network!Lease: gateway routers on network$Lease: client's assigned domain nameLease: network DNS servers creates % messages suitable for responding to  messages given a static  configuration. creates a suitable  in response to a client's B message using the configuration settings specified in the given .# is the binary decoder for parsing  values.% is the binary encoder for rendering  values.T attempts to find a valid high-level message contained in a low-level message. The A is a large type and can encode invalid combinations of options. embeds  messages in the low-level 2 type, typically for the purpose of serialization. embeds  messages in the low-level 2 type, typically for the purpose of serialization. embeds  messages in the low-level 2 type, typically for the purpose of serialization. embeds  messages in the low-level 2 type, typically for the purpose of serialization. creates a new O message with a set of options suitable for configuring a basic network stack. creates a $ message suitable for accepting an  from the DHCPv4 server.]befcghijDHCPv4 server settingsClient's request messageDHCPv4 server settingsClient's discover messageklm%New randomly generated transaction IDThe client's hardware address%The offer as received from the servernopqNNbefcghij  klmnopqNoneArp operations.0x10x2JParse an Arp packet, given a way to parse hardware and protocol addresses.MRender an Arp packet, given a way to render hardware and protocol addresses.Parse an Arp operation.Render an Arp operation.None4  A handle to a running arp layer.Start an arp layer.:Lookup the hardware address associated with an IP address.SSend an IP packet via the arp layer, to resolve the underlying hardware addresses.1Associate an address with a mac in the Arp layer.rHandle a who-has requestsProcess an incoming arp packettIHandle a request to associate an ip with a mac address for a local deviceu&Output a packet to the ethernet layer.vwxyz{|}~rstuvwxyz{|}~rstuNoneThe end of a fragment.$Check the ordering of two fragments.$Check the ordering of two fragments.Merge two fragments.TNote: This doesn't do a validity check to make sure that they're actually adjacent.Given a group of fragments, a new fragment, and a possible total size, create a new group of fragments that incorporates the new fragment.`Add a fragment to a list of fragments, in a position that is relative to its offset and length.Process a packet fragment through the system, potentially returning a fully-processed packet if this fragment completes an existing packet or is itself a fully-complete packet. Safe                    None Add a rule to the routing table.DDiscover the source and destination when trying to route an address.5Find the mask that would be used to route an address.Dump all local addresses.     None357(Send a packet using a given routing ruleFind a route to an address"Route a packet that is forwardable!Require that an address is local."Route a message to a local handler Incoming packet from the network! !"#$%&  !"#$%&  !"$#%& !"#$%&!None357)CAdd a handler for Icmp4 messages that match the provided predicate.*Send a destination unreachable message to a host, with the given bytes as its body. Don't send the message, if the message was broadcast.*Deliver an ICMP message via the IP4 layer.Handle incoming ICMP packetsAdd an icmp packet handler.Respond to an echo request9Output the IO actions for each handler that's registered.'()*'()*'()*'()*"None+357/Send a UDP datagram. When the source port is given, this will send using that source port. If the source port is not given, a fresh one is used, and immediately recycled.NOTE: this doesn't prevent you from sending messages on a port that another thread is already using. This is a funky design, and we'd be better suited by introducing a UdpSocket type.01Queue an incoming udp message from the IP4 layer.1<Add a handler for incoming udp datagrams on a specific port.2EAdd a handler for incoming udp datagrams on a freshly allocated port.3+Remove a handler present on the port given.>Deliver a destination unreachable mesasge, via the icmp layer.+,-./0123 +,-./0123 ,+.0/-123+,-./0123#None+G7The handle back to the thread waiting fo the HostEntry&The port this request is receiving on The packet to sendName servers left to tryThe last server queried!The timer for the current request$No name servers have been configuredRan out of name servers to try-Unable to find any information about the hostHRegister a fresh request, along with a timer to reap the request after .uCreate the query packet, and register the request with the DNS layer. Then, send a request to the first name server.4Send a request to the next name server in the queue.$Handle the response from the server..Parse the A and CNAME parts out of a response.$Send a UDP query to the server given3Queue the packet into the DNS layer for processing.?456789:;<=>?@ 456789:;<=>?@ ;<:=>945678?@'456789:;<=>?@$NoneCINVC*Tcp operations in the context of a socket.This implementation is a bit ridiculous, and when the eventual rewrite comes this should be one of the first things to be reconsidered. The basic problem is that if you rely on the finished implementation for the Layer monad, you exit from the socket context as well, losing any changes that have been made locally. This gives the ability to simulate finishedV, with the benefit of only yielding from the Sock context, not the whole Tcp context.NThe handle to this layer.O Get the handle to the IP4 layer.U/Reset the 2MSL timer on the socket in TimeWait.[Lookup a connection, returning Nothing! if the connection doesn't exist.\]Retrieve a connection from the host. The computation fails if the connection doesn't exist.]_Assign a connection to a socket id. If the TcpSocket is in TimeWait, this will do two things: 5Remove the corresponding key from the connections mapAdd the socket to the TimeWait map, using the current value of its 2MSL timer (which should be set when the TimeWait state is entered)The purpose of this is to clean up the memory associated with the connection as soon as possible, and once it's in TimeWait, no data will flow on the socket.^!Add a new connection to the host._*Modify an existing connection in the host.`"Remove a connection from the host.a(Send out a tcp segment via the IP layer.b Get the initial sequence number.c1Increment the initial sequence number by a value.dAllocate a new port for use.eRelease a used port.gFinish early, with no result.koRun the socket action, and increment its internal timestamp value. Do not add it back to the connections map.lZIterate for each connection, rolling back to its previous state if the computation fails.pQRun a socket operation in the context of the socket identified by the socket id.SXXX this should really be renamed, as it's not guarding on the state of the socketqFGet the parent id of the current socket, and fail if it doesn't exist.r>Run an action in the context of the socket's parent. Returns " if the connection has no parent.{(Set the state of the current connection.|(Get the state of the current connection.Pop off an acceptor.Send a notification back to a waiting process that the socket has been established, or that it has failed. It's assumed that this will only be called from the context of a user socket, so when the parameter is False,, the user close field will be set to true. Output some IO to the Tcp layer..Send a TCP segment in the context of a socket.7Unblock any waiting processes, in preparation to close.BSet the socket state to closed, and unblock any waiting processes.KABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~HABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~KLKFGHIJMNOPQRSTUVWXYZ[\]^_`abcdeCDEBAfghijklmnopqrstuvwxyz{|}~EABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~%None $Add the Sack option to a tcp packet."Add the sack permitted tcp option.3Add the window scale option on the outgoing header.Given a tcp header, generate the next header in the sequence that corresponds to the RST ACK response. As this should only be used in situations in which an ACK was not received, this adds one plus the body length to the ack number.1Construct a SYN ACK packet, in response to a SYN.Construct a FIN packet.&XXX should this include a sack option?0Respond to a SYN message with a SYN ACK message.Send an ACK packet.Schedule a delayed ACK packet. Unschedule a delayed ACK packet.AQueue an outgoing fin packet in the outgoing window, and send it.CNOTE: This uses genSegments, which will pull data out of the waitiSend a segment.Take data from the output buffer, and turn it into segments. When data was freed from the output buffer, the wakeup actions for any threads currently blocked on writing to the output buffer will be returned.&None :Schedule the timers to run on the fast and slow intervals.Fires every 500ms.4Handle only the delayed ack timer, fires ever 200ms.PUpdate timers, decrementing to 0 ones that expire, and incrementing the others.PConditionally run a timer, when this slow-timer tick will decrement it to zero.TConditionally run an action when the connection has been idle for at least timeout SlowTicks. Set the value of the 2MSL timer.75 second delay.BThe timer that handles the TIME_WAIT, as well as the idle timeout.The FinWait2 10m timeout.CGC the connection if it's been open for a long time, in FIN_WAIT_2.XXX not sure if this is the correct way to do this. should this set a flag to indicate that if the 2MSL timer goes off, the connection should be cleaned up?nUpdate segments in the outgoing window, decrementing their RTO timers, and retransmitting them if it expires.2Calibrate the RTO timer, as specified by RFC-6298.'NoneGV %Process a single incoming tcp packet./Handle an incoming packet in the TimeWait state6Make sure that there is space for the incoming segment #Process the presence of the RST bit !Flush all pending outgoing state.~TODO: * Push all data out of the incoming queue to the incoming buffer * Mark the socket as not accepting any more user data Update the currently held timestamp for both sides, and return a boolean that indicates whether or not the packet should be dropped.RFC 1323 Enqueue a new packet in the local window, attempting to place the bytes received in the user buffer as they complete a part of the stream. Bytes are ack'd as they complete the stream, and bytes that would cause the local buffer to overflow are dropped. %Handle an ACK to a sent data segment.Setup the 2MSL timer, and enter the TIME_WAIT state. We only enter TimeWait if all of our sent data has been ACKed, so it's safe to clear out the retransmit queue here.(Fill up the remote window with segments.IExtract the maximum segment size from a header, if the option is present.          (NoneQueue a tcp packet.Rate of ISN increase, in Hz.6Run the tcp action, after updating any internal state.LL)None+ A connect call failed.The remote host of a socket.The remote port of a socket.The local port of a socket. >Block on the result of a Tcp action, from a different context.WXXX closing the socket should also unblock any other threads waiting on socket actionsConnect to a remote host.GOpen a new listening socket that can be used to accept new connections.6Accept new incoming connections on a listening socket.Close an open socket.Send bytes over a socket. The number of bytes delivered will be returned, with 0 representing the other side having closed the connection.,True when there are bytes queued to receive.]Receive bytes from a socket. A null ByteString represents the other end closing the socket."!"#$% &'()*+,-!"#$% &'()*+,-*None355An example implementation of the whole network stack.,Start the ethernet layer in a network stack.-Add an ethernet device to the ethernet layer.(Remove a device from the ethernet layer.2Bring an ethernet device in the ethernet layer up.4Bring an ethernet device in the ethernet layer down.'Start the arp layer in a network stack.*Start the icmp4 layer in a network stack..'Start the IP4 layer in a network stack.&Add an IP4 address to a network stack.*Add a route for a network, via an address.&Register a handler for an IP4 protocol&Register a handler for an IP4 protocol'Start the UDP layer of a network stack.Add a handler for a UDP port. Remove a handler for a UDP port.#Inject a packet into the UDP layer.Send a UDP packet.'Start the TCP layer of a network stack. Listen for incoming connections.Make a remote connection.9J456789Q945678*+None .BOOTP server port./BOOTP client port./Discover a dhcp server, and request an address.0;Restore the connection between the Ethernet and IP4 layers.1bHandle IP4 messages from the Ethernet layer, passing all relevant DHCP messages to the UDP layer.2Handle a DHCP Offer message.Remove the current UDP handlerInstall an DHCP Ack handlerSend a DHCP Request3Handle a DHCP Ack message.Remove the custom IP4 handler:Restore the connection between the Ethernet and IP4 layersRemove the bootpc UDP listener5Configure the network stack with options from the AckRInstall a timer that renews the address after 50% of the lease time has passed4Perform a DHCP Renew.Re-install the DHCP IP4 handler$Add a UDP handler for an Ack message;Re-send a renquest message, generated from the offer given.56Produce options for the network stack from a DHCP Ack.6./78901234:;5<=>6./78901234:;5<=>?,,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abbcdefghfgijikklmnopqrstuvwxyz{|}~                                                                                                    ! ! " # $ % & ' ( ) *++,,--./00123456789:;<=>?@ABCDEFGHIJKLMMNOPQRSTUVWXYZ[\]^_`abcdefghijkklmnopqrstuvwxyz{|}~      XX !"#$$%&'()*+,--./012334556789::;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^^_`abcddefghhijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~[             !!!!""""""" "!""#####$#%#&#'#(#)#*#+#,#-#.$/$0$1$1$2$3$3$4$5$6$7$8$9$:$;$<$=$>$?$@$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$[$\$]$^$_$`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$t$u$v$w%x%y%z%{%|%}%~%%%%%%%%%%%%%%%%%%%%%%%&&&&&''(())))))))))))))))))))*********;****************************** *"*******+*,*-*.*******+0>K                                             !"#$%%&'()**+,-./:01234516789:;<=>?@ABC!DDEFGHIJKLMNOPQRSTUVWXYZ[ \ ] ^ _ `  a a b c d e f g h   i j k [ l m n!o!!p!q!r!s!t!t!u!v!!w!;"x"y"y"z"{"|"}"~""""";"""""""!""##################################################&&&&&&&&&'''''''''''''''''''''''(())))))))))))))+++++++++++++++++ hans-2.5.0.0Hans.Message.TypesHans.Layer.Tcp.WaitBuffer Hans.PortsHans.Utils.Checksum Hans.Timers Hans.Channel Hans.Utils Hans.Layer Hans.AddressHans.Address.IP4Hans.Message.Ip4Hans.Message.UdpHans.Message.DnsHans.Message.Icmp4Hans.Message.TcpHans.Layer.Tcp.WindowHans.Layer.Tcp.Types Hans.SimpleHans.Address.MacHans.Message.EthernetFrameHans.Layer.EthernetHans.Device.TapHans.Layer.Arp.TableHans.Message.Dhcp4CodecHans.Message.Dhcp4OptionsHans.Message.Dhcp4Hans.Message.ArpHans.Layer.ArpHans.Layer.IP4.FragmentationData.PrefixTreeHans.Layer.IP4.RoutingHans.Layer.IP4Hans.Layer.Icmp4Hans.Layer.UdpHans.Layer.DnsHans.Layer.Tcp.MonadHans.Layer.Tcp.MessagesHans.Layer.Tcp.TimersHans.Layer.Tcp.HandlersHans.Layer.TcpHans.Layer.Tcp.SocketHans.NetworkStackHans.DhcpClientLifetime getLifetime parseLifetimerenderLifetimeBufferOutgoingIncomingWakeuptryAgainabort emptyBufferisEmptyisFull flushWaiting writeBytes takeBytes readBytesputBytes PortManageremptyPortManagerisUsedreserve unreservenextPort clearChecksum pokeChecksumemptyPartialChecksumfinalizeChecksumcomputeChecksumcomputePartialChecksumLazycomputePartialChecksumTimer Millisecondsdelaydelay_cancelexpiredChannel newChannelreceivesendEndoMkPseudoHeader DeviceNamevoid showPaddedHexjust singletonchunkstrictProvidesHandlers getHandlers setHandlersHandlersLayergetLayerSuccessFailureExitResultErrorActionNop LayerStatelsNowlsState runActionrunLayer loopLayerfinish dropPackettimeoutput liftRight emptyHandlers getHandler addHandler removeHandler$fBaseMLayerLayer$fStateMLayeri$fMonadPlusLayer $fMonadLayer$fAlternativeLayer$fApplicativeLayer$fFunctorLayer$fMonoidActionMask masksAddresswithMaskgetMaskComponents getMaskRangebroadcastAddressAddressaddrSizetoBits isBroadcastIP4MaskIP4 broadcastIP4parseIP4 renderIP4convertToWord32convertFromWord32modifyAsWord32 clearHostBits setHostBits$fMaskIP4MaskIP4 $fReadIP4Mask$fSerializeIP4Mask $fReadIP4 $fShowIP4$fSerializeIP4 $fAddressIP4 IP4Optionip4OptionCopiedip4OptionClass ip4OptionNum ip4OptionData IP4Header ip4Versionip4TypeOfServiceip4Identip4DontFragmentip4MoreFragmentsip4FragmentOffset ip4TimeToLive ip4Protocol ip4Checksum ip4SourceAddr ip4DestAddr ip4Options IP4ProtocolgetIP4ProtocolIdentgetIdentmkIP4PseudoHeaderemptyIP4HeadernoMoreFragments moreFragments addOffsetsetIdent ip4PacketSize ip4HeaderSize splitPacketfragmentPacket getIP4PacketparseIP4PacketrenderIP4Header putIP4HeaderrenderIP4Packet renderOptions getOptions ip4OptionSize$fSerializeIP4Option UdpHeader udpSourcePort udpDestPort udpChecksumUdpPort getUdpPort udpProtocol parseUdpPort renderUdpPort udpHeaderSizeparseUdpHeaderrenderUdpHeaderparseUdpPacketrenderUdpPacketvalidateUdpChecksumRDataRDARDNSRDMDRDMFRDCNAMERDSOARDMBRDMGRDMRRDPTRRDHINFORDMINFORDMXRDNULL RDUnknownClassINCSCHHSQClass QAnyClassTypeANSMDMFCNAMESOAMBMGMRNULLPTRHINFOMINFOMXAAAAQTypeAFXRMAILBMAILAQTAnyRRrrNamerrClassrrTTLrrRDataQueryqNameqTypeqClassNameRespCode RespNoErrorRespFormatErrorRespServerFailure RespNameErrorRespNotImplemented RespRefused RespReservedOpCodeOpQueryOpIQueryOpStatus OpReserved DNSHeaderdnsIddnsQuery dnsOpCodednsAAdnsTCdnsRDdnsRAdnsRC DNSPacket dnsHeader dnsQuestions dnsAnswersdnsAuthorityRecordsdnsAdditionalRecordsparseDNSPacket getDNSPacketrenderDNSPacket putDNSPacketSequenceNumber Identifier RouterAddressraAddrraPreferenceLevelPreferenceLevelTraceRouteCodeTraceRouteForwardedTraceRouteDiscarded RedirectCodeRedirectForNetworkRedirectForHost"RedirectForTypeOfServiceAndNetworkRedirectForTypeOfServiceAndHostTimeExceededCodeTimeToLiveExceededInTransitFragmentReassemblyTimeExceededDestinationUnreachableCodeNetUnreachableHostUnreachableProtocolUnreachablePortUnreachableFragmentationUnreachableSourceRouteFailedDestinationNetworkUnknownDestinationHostUnknownSourceHostIsolatedErrorAdministrativelyProhibitedHostAdministrativelyProhibitedNetworkUnreachableForTOSHostUnreachableForTOS'CommunicationAdministrativelyProhibitedHostPrecedenceViolationPrecedenceCutoffInEffectNoCode Icmp4Packet EchoReplyDestinationUnreachable SourceQuenchRedirectEchoRouterAdvertisementRouterSolicitation TimeExceededParameterProblem TimestampTimestampReply InformationInformationReply TraceRoute AddressMaskAddressMaskReplynoCodeparseIcmp4PacketgetIcmp4PacketrenderIcmp4PacketputIcmp4Packet getUntilDone$fSerializeRouterAddress$fSerializeTraceRouteCode$fSerializeRedirectCode$fSerializeTimeExceededCode%$fSerializeDestinationUnreachableCode$fSerializeNoCode SackBlocksbLeftsbRight TcpOptionOptEndOfOptions OptNoOptionOptMaxSegmentSizeOptWindowScalingOptSackPermittedOptSack OptTimestamp OptUnknown TcpOptionTagOptTagEndOfOptionsOptTagNoOptionOptTagMaxSegmentSizeOptTagWindowScalingOptTagSackPermitted OptTagSackOptTagTimestamp OptTagUnknown HasTcpOptions findTcpOption setTcpOption TcpHeader tcpSourcePort tcpDestPort tcpSeqNum tcpAckNumtcpCwrtcpEcetcpUrgtcpAcktcpPshtcpRsttcpSyntcpFin tcpWindow tcpChecksumtcpUrgentPointer tcpOptions TcpAckNum TcpSeqNum getSeqNumTcpPortgetPort tcpProtocol putTcpPort getTcpPort putTcpSeqNum getTcpSeqNum putTcpAckNum getTcpAckNumemptyTcpHeadertcpFixedHeaderLength putTcpHeader getTcpHeader putTcpControl setTcpControl setTcpOptionsgetTcpOptionTagputTcpOptionTag tcpOptionTagtcpOptionsLengthtcpOptionLength putTcpOption getTcpOptions getTcpOptiongetMaxSegmentSizeputMaxSegmentSizegetSackPermittedputSackPermittedgetSackputSack getSackBlock putSackBlock sackLengthgetWindowScalingputWindowScaling getTimestamp putTimestamp getUnknown putUnknownparseTcpPacket getTcpPacket putTcpPacketrenderWithTcpChecksumIP4computeTcpChecksumIP4validateTcpChecksumIP4$fHasTcpOptions[]$fHasTcpOptionsTcpHeader$fMonoidTcpSeqNum InSegment inRelSeqNuminHeaderinBody LocalWindowlwBufferlwRcvNxt lwAvailablelwSize lwRcvWindlwRcvWindScale OutSegment outAckNumoutTimeoutFreshoutRTO outHeaderoutBody OutSegments RemoteWindow rwSegments rwAvailablerwSize rwSndWindrwSndWindScaleemptyRemoteWindowrefreshRemoteWindowsetSndWindScale setSndWind releaseSpace addSegment receiveAckgenRetransmitSegmentsclearRetransmitretransmitEmpty mkOutSegment ctlLengthoutSizeoutSize' decrementRTOemptyLocalWindowlocalWindowSackBlocksrefreshLocalWindow setRcvNxt addRcvNxt setRcvWindsetRcvWindScaleincomingPacket addInSegment stepWindowinSeqNuminLength mkInSegment mkSackBlock ConnStateClosedListenSynSent SynReceived Established CloseWaitFinWait1FinWait2ClosingLastAckTimeWait TcpSocket tcpParent tcpSocketIdtcpState tcpAcceptors tcpNotifytcpIss tcpSndNxt tcpSndUna tcpUserClosedtcpOut tcpOutBuffer tcpOutMSStcpIn tcpInBuffertcpInMSS tcpTimers tcpTimestamptcpSacktcpWindowScaleCloseNotifyAcceptor tsTimestamptsLastTimestamp tsGranularity tsLastUpdate TcpTimers ttDelayedAcktt2MSLttRTOttSRTTttRTTVar ttMaxIdlettIdle SlowTicks TimeWaitSocktw2MSL twInit2MSLtwSeqNum twTimestampTimeWaitConnections SocketResult SocketErrorSocketId sidLocalPort sidRemotePort sidRemoteHost ConnectionsHosthostConnections hostTimeWaitshostInitialSeqNum hostPortshostLastUpdate emptyHosttakePort releasePort removeClosed emptySocketIdlistenSocketIdincomingSocketId socketError twReset2MSL mkTimeWait addTimeWaitstepTimeWaitConnections mslTimeoutemptyTcpTimersemptyTimestamp stepTimestamp mkTimestampemptyTcpSocket defaultMSSnothingOutstanding tcpRcvNxtinRcvWnd nextSegSize isAcceptingneedsDelayedAckmkMSSnewIdent nextIdent renderUdp renderIp4MacshowsMacmacMask broadcastMacparseMac renderMac EthernetFrame etherDest etherSource etherType EtherType getEtherTypeparseEtherTyperenderEtherTypeparseEthernetFramerenderEthernetFrameEthernetHandleRxTxrunEthernetLayer sendEthernet queueEthernetstartEthernetDevicestopEthernetDeviceaddEthernetDeviceremoveEthernetDeviceaddEthernetHandlerremoveEthernetHandlerc_readc_writec_init_tap_device openTapDevicetapSendtapReceiveLoop tapReceivec_read'ArpTable ArpResult KnownAddressPendingUnknownArpEntryarpMac arpTimeout ArpPendingarpEntryTimeout stepArpTable addArpEntry addPendinglookupArpEntry SubnetMaskunmask CodecAtomgetAtomputAtomatomSizeword32ToSubnetMasksubnetMaskToWord32 computeMask$fCodecAtomSubnetMask$fCodecAtomMac$fCodecAtomIP4Mask$fCodecAtomIP4$fCodecAtomBool$fCodecAtomWord32$fCodecAtomWord16$fCodecAtomWord8$fCodecAtom(,)NVTAsciiStringOption getOption putOptionOverloadOption UsedFileFieldUsedSNameFieldUsedBothFieldsNetBiosNodeTypeBNodePNodeMNodeHNodeOptionTagOrError UnknownTagKnownTagDhcp4OptionTag OptTagPad OptTagEndOptTagSubnetMaskOptTagTimeOffset OptTagRoutersOptTagTimeServersOptTagIEN116NameServersOptTagNameServersOptTagLogServersOptTagCookieServersOptTagLPRServersOptTagImpressServersOptTagResourceLocationServersOptTagHostNameOptTagBootFileSizeOptTagMeritDumpFileOptTagDomainNameOptTagSwapServerOptTagRootPathOptTagExtensionsPathOptTagEnableIPForwarding!OptTagEnableNonLocalSourceRoutingOptTagPolicyFilters#OptTagMaximumDatagramReassemblySizeOptTagDefaultTTLOptTagPathMTUAgingTimeoutOptTagPathMTUPlateauTableOptTagInterfaceMTUOptTagAllSubnetsAreLocalOptTagBroadcastAddressOptTagPerformMaskDiscoveryOptTagShouldSupplyMasks"OptTagShouldPerformRouterDiscoveryOptTagRouterSolicitationAddressOptTagStaticRoutes OptTagShouldNegotiateArpTrailersOptTagArpCacheTimeout%OptTagUseRFC1042EthernetEncapsulationOptTagTcpDefaultTTLOptTagTcpKeepaliveIntervalOptTagTcpKeepaliveUseGarbageOptTagNisDomainNameOptTagNisServersOptTagNtpServersOptTagVendorSpecificOptTagNetBiosNameServers OptTagNetBiosDistributionServersOptTagNetBiosNodeTypeOptTagNetBiosScopeOptTagXWindowsFontServerOptTagXWindowsDisplayManagersOptTagNisPlusDomainOptTagNisPlusServersOptTagSmtpServersOptTagPopServersOptTagNntpServersOptTagWwwServersOptTagFingerServersOptTagIrcServersOptTagStreetTalkServers*OptTagStreetTalkDirectoryAssistanceServers OptTagFQDNOptTagRequestIPAddressOptTagIPAddressLeaseTimeOptTagOverloadOptTagTftpServerOptTagBootfileNameOptTagMessageTypeOptTagServerIdentifierOptTagParameterRequestListOptTagErrorMessageOptTagMaxDHCPMessageSizeOptTagRenewalTimeOptTagRebindingTimeOptTagVendorClassOptTagClientIdentifierOptTagNetWareDomainNameOptTagNetWareInfoOptTagAutoconfiguration ControlTag ControlPad ControlEndDhcp4MessageType Dhcp4Discover Dhcp4Offer Dhcp4Request Dhcp4DeclineDhcp4AckDhcp4Nak Dhcp4Release Dhcp4Inform Dhcp4Option OptSubnetMask OptTimeOffset OptRoutersOptTimeServersOptIEN116NameServersOptNameServers OptLogServersOptCookieServers OptLPRServersOptImpressServersOptResourceLocationServers OptHostNameOptBootFileSizeOptMeritDumpFile OptDomainName OptSwapServer OptRootPathOptExtensionsPathOptEnableIPForwardingOptEnableNonLocalSourceRoutingOptPolicyFilters OptMaximumDatagramReassemblySize OptDefaultTTLOptPathMTUAgingTimeoutOptPathMTUPlateauTableOptInterfaceMTUOptAllSubnetsAreLocalOptBroadcastAddressOptPerformMaskDiscoveryOptShouldSupplyMasksOptShouldPerformRouterDiscoveryOptRouterSolicitationAddressOptStaticRoutesOptShouldNegotiateArpTrailersOptArpCacheTimeout"OptUseRFC1042EthernetEncapsulationOptTcpDefaultTTLOptTcpKeepaliveIntervalOptTcpKeepaliveUseGarbageOptNisDomainName OptNisServers OptNtpServersOptVendorSpecificOptNetBiosNameServersOptNetBiosDistributionServersOptNetBiosNodeTypeOptNetBiosScopeOptXWindowsFontServerOptXWindowsDisplayManagersOptNisPlusDomainOptNisPlusServersOptSmtpServers OptPopServersOptNntpServers OptWwwServersOptFingerServers OptIrcServersOptStreetTalkServers'OptStreetTalkDirectoryAssistanceServersOptFQDNOptRequestIPAddressOptIPAddressLeaseTime OptOverload OptTftpServerOptBootfileNameOptMessageTypeOptServerIdentifierOptParameterRequestListOptErrorMessageOptMaxDHCPMessageSizeOptRenewalTimeOptRebindingTimeOptVendorClassOptClientIdentifierOptNetWareDomainNameOptNetWareInfoOptAutoconfiguration MagicCookiedhcp4MagicCookiegetDhcp4OptionputDhcp4OptionputControlOption getOptionTag putOptionTaggetDhcp4OptionsputDhcp4Options scrubControlseatPad replicateA repeatedlynullTerminatedlookupOverload lookupFile lookupSname lookupParamslookupMessageTypelookupRequestAddrlookupLeaseTimedefaultFixedGetOptiondefaultFixedPutOptionfixedLen getRecordgetLenputLen$fOptionNVTAsciiString$fCodecAtomOptionTagOrError$fOptionByteString$fOptionSubnetMask $fOptionIP4$fOptionWord32$fOptionWord16 $fOptionWord8 $fOptionBool $fOption(,) $fOption[]$fCodecAtomOverloadOption$fOptionOverloadOption$fCodecAtomNetBiosNodeType$fOptionNetBiosNodeType$fCodecAtomDhcp4MessageType$fOptionDhcp4MessageType$fCodecAtomMagicCookieXid Dhcp4Messagedhcp4Op dhcp4Hopsdhcp4Xid dhcp4Secsdhcp4Broadcastdhcp4ClientAddr dhcp4YourAddrdhcp4ServerAddrdhcp4RelayAddrdhcp4ClientHardwareAddrdhcp4ServerHostnamedhcp4BootFilename dhcp4OptionsOffer offerHopsofferXid offerYourAddrofferServerAddrofferRelayAddrofferClientHardwareAddr offerOptionsAckackHopsackXid ackYourAddr ackServerAddr ackRelayAddrackClientHardwareAddr ackLeaseTime ackOptionsDiscover discoverXiddiscoverBroadcastdiscoverClientHardwareAddrdiscoverParametersRequest requestXidrequestBroadcastrequestServerAddrrequestClientHardwareAddressrequestParametersrequestAddress ReplyMessage AckMessage OfferMessageRequestMessageDiscoverMessageServerSettingsSettingsstaticServerAddrstaticTimeOffsetstaticClientAddrstaticLeaseTime staticSubnetstaticBroadcast staticRoutersstaticDomainName staticDNS requestToAckdiscoverToOffergetDhcp4MessageputDhcp4MessageparseDhcpMessagediscoverToMessage ackToMessageofferToMessagerequestToMessage mkDiscoverofferToRequestArpOper ArpRequestArpReply ArpPacket arpHwTypearpPTypearpOperarpSHAarpSPAarpTHAarpTPAparseArpPacketrenderArpPacket parseArpOper renderArpOper ArpHandle runArpLayer arpWhoHas arpIP4PacketaddLocalAddressFragmentfragmentOffsetfragmentLengthfragmentPayload Fragments startTime totalSize fragmentsFragmentationTableemptyFragmentationTable fragmentEnd comesBefore comesAftercombineFragments expandGroup addFragmentprocessFragmentprocessIP4Packet $fOrdFragment PrefixTreeemptyfromListtoListelemsinsertdeletemembermatchesmatchlookupkeyskey RoutingTableRuleDirectIndirectMtuemptyRoutingTableaddRuleroute sourceMask localAddrs IP4HandleHandler runIP4LayerconnectEthernet withIP4SourceaddIP4RoutingRule sendIP4Packet addIP4HandlerremoveIP4Handler Icmp4Handle runIcmp4LayeraddIcmp4HandlerdestUnreachable UdpException UdpHandle runUdpLayersendUdpqueueUdp addUdpHandleraddUdpHandlerAnyPortremoveUdpHandler HostEntryhostName hostAliases hostAddressesHostName DnsException DnsHandle runDnsLayer addNameServerremoveNameServer getHostByName getHostByAddrNextEscapeSockunSockTcpStatetcpSelftcpIP4tcpHostTcp TcpHandle emptyTcpStateself ip4HandlegetHost getLastUpdatesetHost modifyHost_ modifyHostresetTimeWait2MSL getTimeWaitremoveTimeWaitgetConnectionstakeConnectionssetConnectionslookupConnection getConnection setConnection addConnectionmodifyConnection remConnection sendSegment initialSeqNumaddInitialSeqNum allocatePort closePortinTcpescaperunSock_runSockseqMayberunSock'eachConnectionwithConnectionwithConnection'listeningConnectionestablishedConnection getParentinParent withChild getTcpSocket setTcpSocket getTcpTimersmodifyTcpSocketmodifyTcpSocket_modifyTcpTimersmodifyTcpTimers_setStategetState whenState whenStates pushAcceptor popAcceptornotifyoutputS advanceRcvNxt advanceSndNxt remoteHost tcpOutputshutdown closeSocket $fMonadSock$fApplicativeSock $fFunctorSock UnsetFlagSetFlag mkSegmentmkAck addSackOptionaddSackPermittedaddWindowScalemkRstAckmkRstmkSynmkSynAckmkFinAckmkDatasynsynAckack delayedAckclearDelayedAckfinAckrstAckrst outputSegment testFlagsisSynisSynAckisRstAckisAckisFinisFinAck genSegments initTimers resetIdle whenIdleForset2MSL calibrateRTOhandleIncomingTcpoutputSegments runTcpLayerqueueTcp CloseError AcceptError ListenError ConnectErrorConnectionRefusedSocketsockRemoteHostsockRemotePort sockLocalPortconnectlistenacceptclosecanSend sendBytescanRecv recvBytesHasDns dnsHandleHasTcp tcpHandleHasUdp udpHandleHasIP4HasIcmp4 icmp4HandleHasArp arpHandle HasEthernetethernetHandle NetworkStacknsArp nsEthernetnsIp4nsIcmp4nsUdpnsTcpnsDnsnewNetworkStackstartEthernetLayer addDevice removeDevicedeviceUp deviceDown startArpLayerstartIcmp4Layer startIP4Layer addIP4AddrrouteVialistenIP4ProtocolignoreIP4Protocol startUdpLayer startTcpLayer startDnsLayer$fHasDnsNetworkStack$fHasUdpNetworkStack$fHasTcpNetworkStack$fHasIcmp4NetworkStack$fHasIP4NetworkStack$fHasEthernetNetworkStack$fHasArpNetworkStack dhcpDiscover queueWaiting queueBytes removeBytesbufBytes bufWaitingbufSize bufAvailableportNext portReserved portActive$fShowPortManagerPartialChecksumpcAccumpcCarrystepfold32LabelPtrGetRWrwOffsetrwLabelsunGet getOffset lookupPtr labelsToName addLabelsliftGetgetWord8 getWord16be getWord32be getInt32begetBytesisolatelabel putInt32be getDNSHeader parseOpCode parseRespCodegetQuerygetRRgetTypegetQType getQClassgetNamegetClassgetRData putDNSHeader renderOpCoderenderRespCodeputNameputQueryputTypeputQType putQClassputRRputClassputRDataMTUfromMTU$fSerializeMac $fAddressMac $fReadMac $fShowMac$fShowEtherTypehandleIncoming getDevice setDevicehandleOutgoing delDevice stopDevice startDevice EthernetState ethHandlers ethDevices ethHandleEthEthernetDevicedevTxdevRxdevUp emptyDeviceemptyEthernetState,$fProvidesHandlersEthernetStateEtherType(->)Flags HardwareTypeghc-prim GHC.TypesTrue broadcastFlagEthernetDhcp4Op BootRequest BootReplyhardwareTypeAddressLengthputPaddedByteStringselectKnownTags$fCodecAtomFlags$fCodecAtomHardwareType$fCodecAtomDhcp4Op$fCodecAtomXidwhoHashandleAddAddressArpStatearpTablearpAddrs arpWaiting arpEthernetarpSelfArp emptyArpStateaddEntry addWaiter runWaitingupdateExistingEntrylocalHwAddress sendArpPacketadvanceArpTableKeyEmptyPrefixBranch matchPrefixcompactDestNextHopVia sendPacket' findRouteforward localAddress routeLocalIP4State ip4Fragments ip4Routes ip4Handlers ip4NextIdent ip4ArpHandleIP emptyIP4StatefindSourceMaskbroadcastDestinationhandleFragments handleAddRule handleSource)$fProvidesHandlersIP4StateIP4Protocol(->) sendPacket handleAddhandleEchoRequest matchHandlersIcmp4 Icmp4HandlesicmpIp4 icmpHandlers icmpProtocol unreachableUdpStateudpPorts udpHandlers udpIp4HandleudpIcmp4HandleUdpNoPortsAvailable PortInUseemptyUdp4StatemodifyPortManager allocPort reservePortfreePort listening%$fProvidesHandlersUdpStateUdpPort(->)$fExceptionUdpExceptionqResultqUdpPortqRequestqServers qLastServerqTimeout NoNameServers OutOfServers DoesNotExistregisterRequest dnsTimeout createRequest sendRequesthandleResponse parseAddr sendQueryserverResponseDnsQuery DnsResultSourceFromHostFromIP4DnsStatednsSelf dnsUdpHandlednsNameServersdnsReqId dnsQueriesDnsDnsRequestFailed emptyDnsState stepReqIdregisterTimeout updateRequest lookupRequest removeRequest sourceQType sourceHosttoLabels getHostEntry expireRequestparseHostEntryparsePtr putResultputError mkDnsQuery mkDNSPacket$fExceptionDnsExceptionbaseGHC.BaseNothing slowTimer fastTimer updateTimers whenTimer tcpKeepIntVal handle2MSL finWait2IdlehandleFinWait2 handleRTOtimeWaitConnectioncheckSequenceNumber checkResetBit flushQueuesupdateTimestamp handleData handleAck enterTimeWaitgetMSS noConnectionhandleTimeWaitdiscardAndReturndonesegmentArrivesproceedFromStep6 checkSynBit checkAckBitprocessSegmentText checkFinBitcreateConnectionestablishConnection windowScale sackSupportedisnRatestepTcp blockResultSocketGenericError sockHandlesockId userClose outputBytes inputBytes$fExceptionCloseError$fExceptionAcceptError$fExceptionListenError$fExceptionConnectError$fExceptionSocketGenericErrorbootpsbootpc restoreIp4dhcpIP4Handler handleOffer dhcpRenew ackNsOptions AckHandlercurrentNetwork ethernetIp4 defaultRoute lookupGateway lookupSubnetgetNameServers sendMessage mkIpBytes