2015-07-03 03:03:34 +00:00
|
|
|
From 508b4701c1610d9772564b97a74b5fa01dab48e2 Mon Sep 17 00:00:00 2001
|
|
|
|
From: dummy <dummy@example.com>
|
|
|
|
Date: Thu, 2 Jul 2015 20:12:59 +0000
|
2013-04-19 20:32:16 +00:00
|
|
|
Subject: [PATCH] remove Network.BSD symbols not available in bionic
|
|
|
|
|
|
|
|
---
|
2015-07-03 03:03:34 +00:00
|
|
|
Network/BSD.hsc | 100 --------------------------------------------------------
|
|
|
|
1 file changed, 100 deletions(-)
|
2013-04-19 20:32:16 +00:00
|
|
|
|
|
|
|
diff --git a/Network/BSD.hsc b/Network/BSD.hsc
|
2015-07-03 03:03:34 +00:00
|
|
|
index b5e9a26..f085f2a 100644
|
2013-04-19 20:32:16 +00:00
|
|
|
--- a/Network/BSD.hsc
|
|
|
|
+++ b/Network/BSD.hsc
|
2015-07-03 03:03:34 +00:00
|
|
|
@@ -27,15 +27,6 @@ module Network.BSD
|
2013-04-19 20:32:16 +00:00
|
|
|
, getHostByAddr
|
|
|
|
, hostAddress
|
|
|
|
|
|
|
|
-#if defined(HAVE_GETHOSTENT) && !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32)
|
|
|
|
- , getHostEntries
|
|
|
|
-
|
|
|
|
- -- ** Low level functionality
|
|
|
|
- , setHostEntry
|
|
|
|
- , getHostEntry
|
|
|
|
- , endHostEntry
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
-- * Service names
|
|
|
|
, ServiceEntry(..)
|
|
|
|
, ServiceName
|
2015-07-03 03:03:34 +00:00
|
|
|
@@ -61,14 +52,6 @@ module Network.BSD
|
2013-04-19 20:32:16 +00:00
|
|
|
, getProtocolNumber
|
|
|
|
, defaultProtocol
|
|
|
|
|
|
|
|
-#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32)
|
|
|
|
- , getProtocolEntries
|
|
|
|
- -- ** Low level functionality
|
|
|
|
- , setProtocolEntry
|
|
|
|
- , getProtocolEntry
|
|
|
|
- , endProtocolEntry
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
-- * Port numbers
|
|
|
|
, PortNumber
|
|
|
|
|
2015-07-03 03:03:34 +00:00
|
|
|
@@ -80,11 +63,7 @@ module Network.BSD
|
2013-04-19 20:32:16 +00:00
|
|
|
#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32)
|
|
|
|
, getNetworkByName
|
|
|
|
, getNetworkByAddr
|
|
|
|
- , getNetworkEntries
|
|
|
|
-- ** Low level functionality
|
|
|
|
- , setNetworkEntry
|
|
|
|
- , getNetworkEntry
|
|
|
|
- , endNetworkEntry
|
|
|
|
#endif
|
|
|
|
|
2015-07-03 03:03:34 +00:00
|
|
|
#if defined(HAVE_IF_NAMETOINDEX)
|
|
|
|
@@ -298,31 +277,6 @@ getProtocolNumber proto = do
|
2013-04-19 20:32:16 +00:00
|
|
|
(ProtocolEntry _ _ num) <- getProtocolByName proto
|
|
|
|
return num
|
|
|
|
|
|
|
|
-#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32)
|
|
|
|
-getProtocolEntry :: IO ProtocolEntry -- Next Protocol Entry from DB
|
|
|
|
-getProtocolEntry = withLock $ do
|
|
|
|
- ent <- throwNoSuchThingIfNull "getProtocolEntry" "no such protocol entry"
|
2015-07-03 03:03:34 +00:00
|
|
|
- $ c_getprotoent
|
2013-04-19 20:32:16 +00:00
|
|
|
- peek ent
|
|
|
|
-
|
|
|
|
-foreign import ccall unsafe "getprotoent" c_getprotoent :: IO (Ptr ProtocolEntry)
|
|
|
|
-
|
|
|
|
-setProtocolEntry :: Bool -> IO () -- Keep DB Open ?
|
2015-07-03 03:03:34 +00:00
|
|
|
-setProtocolEntry flg = withLock $ c_setprotoent (fromBool flg)
|
2013-04-19 20:32:16 +00:00
|
|
|
-
|
|
|
|
-foreign import ccall unsafe "setprotoent" c_setprotoent :: CInt -> IO ()
|
|
|
|
-
|
|
|
|
-endProtocolEntry :: IO ()
|
2015-07-03 03:03:34 +00:00
|
|
|
-endProtocolEntry = withLock $ c_endprotoent
|
2013-04-19 20:32:16 +00:00
|
|
|
-
|
|
|
|
-foreign import ccall unsafe "endprotoent" c_endprotoent :: IO ()
|
|
|
|
-
|
|
|
|
-getProtocolEntries :: Bool -> IO [ProtocolEntry]
|
|
|
|
-getProtocolEntries stayOpen = withLock $ do
|
|
|
|
- setProtocolEntry stayOpen
|
|
|
|
- getEntries (getProtocolEntry) (endProtocolEntry)
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
-- ---------------------------------------------------------------------------
|
|
|
|
-- Host lookups
|
|
|
|
|
2015-07-03 03:03:34 +00:00
|
|
|
@@ -397,31 +351,6 @@ getHostByAddr family addr = do
|
2013-04-19 20:32:16 +00:00
|
|
|
foreign import CALLCONV safe "gethostbyaddr"
|
|
|
|
c_gethostbyaddr :: Ptr HostAddress -> CInt -> CInt -> IO (Ptr HostEntry)
|
|
|
|
|
|
|
|
-#if defined(HAVE_GETHOSTENT) && !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32)
|
|
|
|
-getHostEntry :: IO HostEntry
|
|
|
|
-getHostEntry = withLock $ do
|
|
|
|
- throwNoSuchThingIfNull "getHostEntry" "unable to retrieve host entry"
|
2015-07-03 03:03:34 +00:00
|
|
|
- $ c_gethostent
|
2013-04-19 20:32:16 +00:00
|
|
|
- >>= peek
|
|
|
|
-
|
|
|
|
-foreign import ccall unsafe "gethostent" c_gethostent :: IO (Ptr HostEntry)
|
|
|
|
-
|
|
|
|
-setHostEntry :: Bool -> IO ()
|
2015-07-03 03:03:34 +00:00
|
|
|
-setHostEntry flg = withLock $ c_sethostent (fromBool flg)
|
2013-04-19 20:32:16 +00:00
|
|
|
-
|
|
|
|
-foreign import ccall unsafe "sethostent" c_sethostent :: CInt -> IO ()
|
|
|
|
-
|
|
|
|
-endHostEntry :: IO ()
|
|
|
|
-endHostEntry = withLock $ c_endhostent
|
|
|
|
-
|
|
|
|
-foreign import ccall unsafe "endhostent" c_endhostent :: IO ()
|
|
|
|
-
|
|
|
|
-getHostEntries :: Bool -> IO [HostEntry]
|
|
|
|
-getHostEntries stayOpen = do
|
|
|
|
- setHostEntry stayOpen
|
|
|
|
- getEntries (getHostEntry) (endHostEntry)
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
-- ---------------------------------------------------------------------------
|
|
|
|
-- Accessing network information
|
|
|
|
|
2015-07-03 03:03:34 +00:00
|
|
|
@@ -483,35 +412,6 @@ getNetworkByAddr addr family = withLock $ do
|
2013-12-30 00:41:19 +00:00
|
|
|
foreign import ccall unsafe "getnetbyaddr"
|
2013-04-19 20:32:16 +00:00
|
|
|
c_getnetbyaddr :: NetworkAddr -> CInt -> IO (Ptr NetworkEntry)
|
|
|
|
|
|
|
|
-getNetworkEntry :: IO NetworkEntry
|
|
|
|
-getNetworkEntry = withLock $ do
|
|
|
|
- throwNoSuchThingIfNull "getNetworkEntry" "no more network entries"
|
2015-07-03 03:03:34 +00:00
|
|
|
- $ c_getnetent
|
2013-04-19 20:32:16 +00:00
|
|
|
- >>= peek
|
|
|
|
-
|
|
|
|
-foreign import ccall unsafe "getnetent" c_getnetent :: IO (Ptr NetworkEntry)
|
|
|
|
-
|
|
|
|
--- | Open the network name database. The parameter specifies
|
|
|
|
--- whether a connection is maintained open between various
|
|
|
|
--- networkEntry calls
|
|
|
|
-setNetworkEntry :: Bool -> IO ()
|
2015-07-03 03:03:34 +00:00
|
|
|
-setNetworkEntry flg = withLock $ c_setnetent (fromBool flg)
|
2013-04-19 20:32:16 +00:00
|
|
|
-
|
|
|
|
-foreign import ccall unsafe "setnetent" c_setnetent :: CInt -> IO ()
|
|
|
|
-
|
|
|
|
--- | Close the connection to the network name database.
|
|
|
|
-endNetworkEntry :: IO ()
|
2015-07-03 03:03:34 +00:00
|
|
|
-endNetworkEntry = withLock $ c_endnetent
|
2013-04-19 20:32:16 +00:00
|
|
|
-
|
|
|
|
-foreign import ccall unsafe "endnetent" c_endnetent :: IO ()
|
|
|
|
-
|
|
|
|
--- | Get the list of network entries.
|
|
|
|
-getNetworkEntries :: Bool -> IO [NetworkEntry]
|
|
|
|
-getNetworkEntries stayOpen = do
|
|
|
|
- setNetworkEntry stayOpen
|
|
|
|
- getEntries (getNetworkEntry) (endNetworkEntry)
|
2015-07-03 03:03:34 +00:00
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
-- ---------------------------------------------------------------------------
|
|
|
|
-- Interface names
|
2013-04-19 20:32:16 +00:00
|
|
|
|
|
|
|
--
|
2015-07-03 03:03:34 +00:00
|
|
|
2.1.4
|
2013-04-19 20:32:16 +00:00
|
|
|
|