socket-icmp 0.1.0.0 → 0.1.0.1
raw patch · 5 files changed
+50/−42 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- README.md +1/−1
- changelog.md +7/−0
- socket-icmp.cabal +6/−5
- src/System/Socket/Option/HeaderInclude.hsc +23/−23
- src/System/Socket/Protocol/ICMP.hsc +13/−13
README.md view
@@ -1,3 +1,3 @@ # socket-icmp -A very very minimal package - provides Windows and Linux compatible definitions for the ICMP protocol and the IP Header Include option for the `socket` library.+A very very minimal package - provides Windows and Linux compatible definitions for the ICMP protocol and the IP Header Include option for the `socket` library. The library is theoretically also compatible with MacOS but has not been tested.
+ changelog.md view
@@ -0,0 +1,7 @@+# Changelog++## 0.1.0.1+Documentation fixes++## 0.1.0.0+Original package uploaded
socket-icmp.cabal view
@@ -1,16 +1,17 @@ name: socket-icmp-version: 0.1.0.0-synopsis: Definitions for ICMP with the `socket` library+version: 0.1.0.1+synopsis: Definitions for using ICMP with the `socket` library -- description:-homepage: https://github.com/TRManderson/socket-icmp#readme+homepage: https://github.com/TRManderson/hs-socket-icmp#readme license: BSD3 license-file: LICENSE-author: Tom Manderson+author: Taylor Manderson maintainer: me@trm.io-copyright: 2018 Tom Manderson+copyright: 2018 Taylor Manderson category: Web build-type: Simple extra-source-files: README.md+ , changelog.md cabal-version: >=1.10 library
src/System/Socket/Option/HeaderInclude.hsc view
@@ -1,24 +1,24 @@-module System.Socket.Option.HeaderInclude ( - HeaderInclude(..) -) where -import Data.Word -import System.Socket -import System.Socket.Unsafe - -#ifdef mingw32_HOST_OS -#include <ws2tcpip.h> -type HdrInclType = Word32 -#else -#include <netinet/in.h> -import Foreign.C.Types -type HdrInclType = CInt -#endif - --- |Represents the `IP_HDRINCL` option. --- It determines whether or not assume the IP header is included in any data sent over the socket -data HeaderInclude = HeaderInclude Bool deriving (Eq, Show) -instance SocketOption HeaderInclude where - getSocketOption s = - HeaderInclude . ((/=0) :: HdrInclType -> Bool) <$> unsafeGetSocketOption s 0 (#const IP_HDRINCL) - setSocketOption s (HeaderInclude o) = +module System.Socket.Option.HeaderInclude (+ HeaderInclude(..)+) where+import Data.Word+import System.Socket+import System.Socket.Unsafe++#ifdef mingw32_HOST_OS+#include <ws2tcpip.h>+type HdrInclType = Word32+#else+#include <netinet/in.h>+import Foreign.C.Types+type HdrInclType = CInt+#endif++-- |Represents the `IP_HDRINCL` option. +-- It determines whether or not to assume the IP header is included in any data sent over the socket+data HeaderInclude = HeaderInclude Bool deriving (Eq, Show)+instance SocketOption HeaderInclude where+ getSocketOption s =+ HeaderInclude . ((/=0) :: HdrInclType -> Bool) <$> unsafeGetSocketOption s 0 (#const IP_HDRINCL)+ setSocketOption s (HeaderInclude o) = unsafeSetSocketOption s 0 (#const IP_HDRINCL) (if o then 1 else 0 :: HdrInclType)
src/System/Socket/Protocol/ICMP.hsc view
@@ -1,14 +1,14 @@-module System.Socket.Protocol.ICMP ( - ICMP(..) -) where -import System.Socket - -#ifdef mingw32_HOST_OS -#include <ws2tcpip.h> -#else -#include <netinet/in.h> -#endif - --- |Represents the ICMP protocol (with the header IPPROTO_ICMP) -data ICMP +module System.Socket.Protocol.ICMP (+ ICMP(..)+) where+import System.Socket++#ifdef mingw32_HOST_OS+#include <ws2tcpip.h>+#else+#include <netinet/in.h>+#endif++-- |Represents the ICMP protocol (with the header IPPROTO_ICMP)+data ICMP instance Protocol ICMP where protocolNumber _ = #const IPPROTO_ICMP