Maintainer | ongy |
---|---|
Stability | testing |
Portability | Linux |
Safe Haskell | None |
Language | Haskell2010 |
System.Linux.Netlink.GeNetlink.Control
Description
This module provides utility functions and datatypes for the genetlink control protocol. This has to be used by implementations of netlink families based on genetlink to lookup their current id, since that is determined at runtime.
Synopsis
- data CtrlAttribute
- data CtrlAttrMcastGroup = CAMG {}
- data CtrlPacket = CtrlPacket {}
- type CTRLPacket = GenlPacket NoData
- ctrlPacketFromGenl :: CTRLPacket -> Maybe CtrlPacket
- data CtrlAttrOpData = CAO {}
- ctrlPackettoGenl :: CtrlPacket -> CTRLPacket
- getFamilyId :: NetlinkSocket -> String -> IO Word16
- getFamilyIdS :: NetlinkSocket -> String -> IO (Maybe Word16)
- getFamilyWithMulticasts :: NetlinkSocket -> String -> IO (Word16, [CtrlAttrMcastGroup])
- getFamilyWithMulticastsS :: NetlinkSocket -> String -> IO (Maybe (Word16, [CtrlAttrMcastGroup]))
- getMulticastGroups :: NetlinkSocket -> Word16 -> IO [CtrlAttrMcastGroup]
- getMulticast :: String -> [CtrlAttrMcastGroup] -> Maybe Word32
- getFamilie :: NetlinkSocket -> String -> IO (Maybe CtrlPacket)
- getFamilies :: NetlinkSocket -> IO [CtrlPacket]
Documentation
data CtrlAttribute Source #
Attributes defined by the control family
Constructors
Instances
Eq CtrlAttribute Source # | |
Defined in System.Linux.Netlink.GeNetlink.Control Methods (==) :: CtrlAttribute -> CtrlAttribute -> Bool # (/=) :: CtrlAttribute -> CtrlAttribute -> Bool # | |
Show CtrlAttribute Source # | |
Defined in System.Linux.Netlink.GeNetlink.Control Methods showsPrec :: Int -> CtrlAttribute -> ShowS # show :: CtrlAttribute -> String # showList :: [CtrlAttribute] -> ShowS # |
data CtrlAttrMcastGroup Source #
Datatype for multicast groups as returned by the control protocol
Instances
Eq CtrlAttrMcastGroup Source # | |
Defined in System.Linux.Netlink.GeNetlink.Control Methods (==) :: CtrlAttrMcastGroup -> CtrlAttrMcastGroup -> Bool # (/=) :: CtrlAttrMcastGroup -> CtrlAttrMcastGroup -> Bool # | |
Show CtrlAttrMcastGroup Source # | |
Defined in System.Linux.Netlink.GeNetlink.Control Methods showsPrec :: Int -> CtrlAttrMcastGroup -> ShowS # show :: CtrlAttrMcastGroup -> String # showList :: [CtrlAttrMcastGroup] -> ShowS # |
data CtrlPacket Source #
Typesafe control packet
Constructors
CtrlPacket | |
Fields |
Instances
Eq CtrlPacket Source # | |
Defined in System.Linux.Netlink.GeNetlink.Control | |
Show CtrlPacket Source # | |
Defined in System.Linux.Netlink.GeNetlink.Control Methods showsPrec :: Int -> CtrlPacket -> ShowS # show :: CtrlPacket -> String # showList :: [CtrlPacket] -> ShowS # |
type CTRLPacket = GenlPacket NoData Source #
typedef for control messages
ctrlPacketFromGenl :: CTRLPacket -> Maybe CtrlPacket Source #
Convert "normal" Packet
s into typesafe CtrlPacket
s
data CtrlAttrOpData Source #
Datatype for AttrOpData as returned by the control protocol
Instances
Eq CtrlAttrOpData Source # | |
Defined in System.Linux.Netlink.GeNetlink.Control Methods (==) :: CtrlAttrOpData -> CtrlAttrOpData -> Bool # (/=) :: CtrlAttrOpData -> CtrlAttrOpData -> Bool # | |
Show CtrlAttrOpData Source # | |
Defined in System.Linux.Netlink.GeNetlink.Control Methods showsPrec :: Int -> CtrlAttrOpData -> ShowS # show :: CtrlAttrOpData -> String # showList :: [CtrlAttrOpData] -> ShowS # |
ctrlPackettoGenl :: CtrlPacket -> CTRLPacket Source #
Convert the typesafe CtrPacket
into a CTRLPacket
so it can be sent
getFamilyId :: NetlinkSocket -> String -> IO Word16 Source #
Get the id for a netlink family by name
getFamilyIdS :: NetlinkSocket -> String -> IO (Maybe Word16) Source #
A safe version of getFamilyId
getFamilyWithMulticasts :: NetlinkSocket -> String -> IO (Word16, [CtrlAttrMcastGroup]) Source #
get the id and multicast groups of a netlink family by name
getFamilyWithMulticastsS :: NetlinkSocket -> String -> IO (Maybe (Word16, [CtrlAttrMcastGroup])) Source #
A safe version of getFamilyWithMulticasts
getMulticastGroups :: NetlinkSocket -> Word16 -> IO [CtrlAttrMcastGroup] Source #
get the mutlicast groups of a netlink family by id
getMulticast :: String -> [CtrlAttrMcastGroup] -> Maybe Word32 Source #
Get id of multicast group by name
getFamilie :: NetlinkSocket -> String -> IO (Maybe CtrlPacket) Source #
Get the CtrlPacket
describing a single family
getFamilies :: NetlinkSocket -> IO [CtrlPacket] Source #
Get CtrlPacket
s for every currently registered GeNetlink family