@@ -107,6 +107,13 @@ EAGAIN : Int
107107EAGAIN = 11
108108
109109-- TODO: Expand to non-string payloads
110+record UDPRecvData where
111+ remote_addr : SocketAddress
112+ remote_port : Port
113+ recv_data : String
114+ data_len : Int
115+
116+{-
110117record UDPRecvData : Type where
111118 MkUDPRecvData :
112119 (remote_addr : SocketAddress) ->
@@ -114,13 +121,19 @@ record UDPRecvData : Type where
114121 (recv_data : String) ->
115122 (data_len : Int) ->
116123 UDPRecvData
124+-}
117125
126+record UDPAddrInfo where
127+ remote_addr : SocketAddress
128+ remote_port : Port
129+
130+{-
118131record UDPAddrInfo : Type where
119132 MkUDPAddrInfo :
120133 (remote_addr : SocketAddress) ->
121134 (remote_port : Port) ->
122135 UDPAddrInfo
123−
136+-}
124137||| Frees a given pointer
125138public
126139sock_free : BufPtr -> IO ()
@@ -138,13 +151,20 @@ sock_alloc : ByteLength -> IO BufPtr
138151sock_alloc bl = map BPtr $ foreign FFI_C "idrnet_malloc" (Int -> IO Ptr) bl
139152
140153||| The metadata about a socket
154+record Socket where
155+ descriptor : SocketDescriptor
156+ family : SocketFamily
157+ socketType : SocketType
158+ protocalNumber : ProtocolNumber
159+
160+{-
141161record Socket : Type where
142162 MkSocket : (descriptor : SocketDescriptor) ->
143163 (family : SocketFamily) ->
144164 (socketType : SocketType) ->
145165 (protocolNumber : ProtocolNumber) ->
146166 Socket
147−
167+-}
148168||| Get the C error number
149169getErrno : IO Int
150170getErrno = foreign FFI_C "idrnet_errno" (IO Int)