-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell bindings for low-level packet sockets (AF_PACKET) -- -- Haskell bindings for low-level packet sockets (AF_PACKET) @package network-netpacket @version 0.0.1 module Network.Socket.NetPacket -- | Low-level sendto call. Normally, this would not be used, as sendToLL -- provides a | more convenient interface. c_sendto_ll :: CInt -> CString -> CSize -> CInt -> Ptr SockAddrLL -> CSize -> IO CSize -- | Low-level recvfrom call. Normally, this would not be used, as -- recvFromLL provides | a more convenient interface. c_recvfrom_ll :: CInt -> CString -> CSize -> CInt -> Ptr SockAddrLL -> Ptr CSize -> IO CSize -- | Low-level setsockopt operation. Normally, it will be more convenient -- to use | setPacketOption instead. c_setsockopt_ll :: CInt -> CInt -> CInt -> Ptr () -> CSize -> IO CInt -- | Low-level bind operation. Normally, this would not be used, as bindLL -- provides a | more convenient interface. c_bind_ll :: CInt -> Ptr SockAddrLL -> CSize -> IO CInt -- | Ethernet protocol numbers, for use with socket ethProtocolIPv4 :: ProtocolNumber -- | Represents a type of packet ethProtocolIPv6 :: ProtocolNumber data PktType PktType :: Word8 -> PktType unPktType :: PktType -> Word8 packetHost :: PktType ethProtocolAll :: ProtocolNumber packetBroadcast :: PktType -- | The address family of a packet socket. afPacket :: CInt packetMulticast :: PktType -- | Represents a low-level protocol appearing in an address. packetOtherhost :: PktType newtype LLProtocol LLProtocol :: Word16 -> LLProtocol lLProtocolIPv4 :: LLProtocol packetOutgoing :: PktType lLProtocolIPv6 :: LLProtocol -- | Represents a hardware type appearing in an address. packetLoopback :: PktType newtype HardwareType HardwareType :: Word16 -> HardwareType lLProtocolAll :: LLProtocol -- | Represents the Ethernet hardware type packetFastroute :: PktType hwTypeEther :: HardwareType -- | Hardware address data HWAddr HWAddr :: ByteString -> HWAddr noHWAddr :: HWAddr newtype IFIndex IFIndex :: Int -> IFIndex data SockAddrLL SockAddrLL :: LLProtocol -> IFIndex -> HardwareType -> PktType -> HWAddr -> SockAddrLL defaultSockAddrLL :: SockAddrLL solPacket :: CInt newtype PacketSocketOption PacketSocketOption :: Int -> PacketSocketOption packetAddMembership :: PacketSocketOption packetDropMembership :: PacketSocketOption newtype PacketMReqType PacketMReqType :: Word16 -> PacketMReqType mrMulticast :: PacketMReqType packetRecvOutput :: PacketSocketOption mrPromisc :: PacketMReqType data PacketMReq PacketMReq :: IFIndex -> PacketMReqType -> HWAddr -> PacketMReq packetRXRing :: PacketSocketOption mrAllMulti :: PacketMReqType packetStatistics :: PacketSocketOption data GetIndexForName GetIndexForName :: GetIndexForName -- | Gets the index for a named interface, for use with SockAddrLL getInterfaceIndex :: Socket -> String -> IO IFIndex -- | Sends a packet to a particular low-level socket address. sendToLL :: Socket -> ByteString -> SockAddrLL -> IO Int -- | Receives a packet from a socket, returning the address of the packet. recvFromLL :: Socket -> Int -> IO (SockAddrLL, ByteString) -- | Sets an option on a packet socket. This can be used to control the -- receipt of multicast packets setPacketOption :: Socket -> PacketSocketOption -> PacketMReq -> IO () -- | Binds a packet socket to an address. This is not essential, but acts -- as a filter on received packets. bindLL :: Socket -> SockAddrLL -> IO () instance Eq PktType instance Ord PktType instance Show PktType instance Eq LLProtocol instance Ord LLProtocol instance Show LLProtocol instance Eq HardwareType instance Ord HardwareType instance Show HardwareType instance Eq HWAddr instance Ord HWAddr instance Show HWAddr instance Eq IFIndex instance Ord IFIndex instance Show IFIndex instance Eq SockAddrLL instance Ord SockAddrLL instance Show SockAddrLL instance Eq PacketSocketOption instance Ord PacketSocketOption instance Show PacketSocketOption instance Eq PacketMReqType instance Ord PacketMReqType instance Show PacketMReqType instance IOControl GetIndexForName (DifferentPeekPoke (InterfaceRequest NoData) (InterfaceRequest CInt)) instance Storable PacketMReq instance Storable PacketMReqType instance Storable PacketSocketOption instance Storable SockAddrLL instance Storable IFIndex instance Storable PktType instance Storable HardwareType instance Storable LLProtocol