Il 25/03/2014 18:58, Holger Hans Peter Freyther ha scritto:

+Sockets.IPAddress extend [
+    determineSourceAddress  [
+        | sourceAddr res |
+        <category: '*Netlink'>
+        "Assuming that self is the destination address determine the
+        source address that will be used."
+        sourceAddr := ByteArray new: 4.
+        res := Netlink fromDestIPv4: address toLocal: sourceAddr.
+        res = 0
+            ifFalse: [^self error: 'Failed to determine source address'].
+        ^self class fromBytes: sourceAddr.
+    ]
+
+    fromDest: destAddress toLocal: localAddress [
+        <category: '*Netlink'>
+        "Given a destination IPv4 Address this function will
+        determine the local source address that would be used.
+        The addresses need to be a ByteArray with four entries."
+        <cCall: 'nl_route_source_ipv4' returning: #int args: #(#byteArray 
#cObject)>
+    ]
+

Is the call-out a remnant of older code?

Paolo

_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to