Skip to content

Commit

Permalink
CmsgIdFd export and Win32 definition
Browse files Browse the repository at this point in the history
Defines a CmsgIdFd pattern (unsupported) in Network.Socket.Win32.Cmsg
and exports CmsgIdFd in Network.Socket
  • Loading branch information
archaephyrryx committed Jul 16, 2020
1 parent 33d0043 commit d4a4bb1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions Network/Socket.hs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ module Network.Socket
,CmsgIdIPv6TClass
,CmsgIdIPv4PktInfo
,CmsgIdIPv6PktInfo
,CmsgIdFd
,UnsupportedCmsgId)
-- ** APIs for control message
, lookupCmsg
Expand Down
8 changes: 6 additions & 2 deletions Network/Socket/Win32/Cmsg.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ pattern CmsgIdIPv4PktInfo = CmsgId (#const IPPROTO_IP) (#const IP_PKTINFO)
pattern CmsgIdIPv6PktInfo :: CmsgId
pattern CmsgIdIPv6PktInfo = CmsgId (#const IPPROTO_IPV6) (#const IPV6_PKTINFO)

-- Use WSADuplicateSocket for CmsgIdFd
-- pattern CmsgIdFd :: CmsgId
-- | Control message ID for POSIX file-descriptor passing.
--
-- Not supported on Windows; use WSADuplicateSocket instead
pattern CmsgIdFd :: CmsgId
pattern CmsgIdFd = CmsgId (-1) (-1)

----------------------------------------------------------------

Expand Down Expand Up @@ -196,6 +199,7 @@ cmsgIdPairs =
, (CmsgIdIPv6TClass, "CmsgIdIPv6TClass")
, (CmsgIdIPv4PktInfo, "CmsgIdIPv4PktInfo")
, (CmsgIdIPv6PktInfo, "CmsgIdIPv6PktInfo")
, (CmsgIdFd, "CmsgIdFd")
]

cmsgIdBijection :: Bijection CmsgId String
Expand Down

0 comments on commit d4a4bb1

Please sign in to comment.