<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-23196</id>
	<title>Nabble - Lisp</title>
	<updated>2009-12-03T08:01:51Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/Lisp-f23196.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Lisp-f23196.html" />
	<subtitle type="html"></subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26628474</id>
	<title>Re: rawsock sniffer demo</title>
	<published>2009-12-03T08:01:51Z</published>
	<updated>2009-12-03T08:01:51Z</updated>
	<author>
		<name>Fred Cohen-3</name>
	</author>
	<content type="html">My advice to you and all others is to test all such things on a system &amp;nbsp;
&lt;br&gt;that you can easily reboot and that is not critical to anything before &amp;nbsp;
&lt;br&gt;making it part of any operational system or system used for any other &amp;nbsp;
&lt;br&gt;purpose. My implementations of this technology tend to be on systems &amp;nbsp;
&lt;br&gt;with bootable CDs and floppy-based configuration files (write locked &amp;nbsp;
&lt;br&gt;except during down-time). Thus I can push reset and try again on a &amp;nbsp;
&lt;br&gt;moment's notice. Improper use may disrupt not only the local machine, &amp;nbsp;
&lt;br&gt;but also surrounding networks, and who knows what else.
&lt;br&gt;&lt;br&gt;Also - in trying your test script, even after recompiling clisp with &amp;nbsp;
&lt;br&gt;rawsock built in, it failed...
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt;sudo clisp -K full /u/fc/lisp/sniffer.lsp inet 100
&lt;br&gt;*** - UNIX error 43 (EPROTONOSUPPORT): Protocol not supported
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt;sudo clisp -K full /u/fc/lisp/sniffer.lsp packet 100
&lt;br&gt;*** - RAWSOCK:SOCKET: Lisp value :PACKET is not found in table &amp;nbsp;
&lt;br&gt;&amp;quot;check_socket_domain&amp;quot;:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((0 :UNSPEC) (1 :UNIX) (1 :LOCAL) (2 :INET) (3 :IMPLINK) &amp;nbsp;
&lt;br&gt;(4 :PUP) (5 :CHAOS) (9 :DATAKIT) (10 :CCITT) (23 :IPX) (6 :NS) (7 :ISO)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(7 :OSI) (8 :ECMA) (16 :APPLETALK) (30 :INET6) (12 :DECNET) &amp;nbsp;
&lt;br&gt;(13 :DLI) (14 :LAT) (15 :HYLINK) (17 :ROUTE) (11 :SNA) (33 :NETBIOS))
&lt;br&gt;&lt;br&gt;I tried various combinations including altering the values within the &amp;nbsp;
&lt;br&gt;program...
&lt;br&gt;&lt;br&gt;(defparameter *socket*
&lt;br&gt;&amp;nbsp; &amp;nbsp;(let ((arg (pop *args*)))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;(cond ((string= arg &amp;quot;inet&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (rawsock:socket :inet :dgram #x300))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;((string= arg &amp;quot;packet&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (rawsock:socket :packet :raw #x300))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(t (error &amp;quot;invalid socket argument ~S&amp;quot; arg)))))
&lt;br&gt;(unless (plusp *socket*)
&lt;br&gt;&amp;nbsp; &amp;nbsp;(error &amp;quot;Invalid socket created for ~S: ~S&amp;quot; *args* *socket*))
&lt;br&gt;&lt;br&gt;Somehow, a demo should work across all such situations...
&lt;br&gt;&lt;br&gt;This seems to not error out on my system:
&lt;br&gt;(defparameter *socket*
&lt;br&gt;&amp;nbsp; &amp;nbsp;(let ((arg (pop *args*)))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;(cond ((string= arg &amp;quot;inet&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (rawsock:socket :inet :dgram 0 #+ignore #x300))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;((string= arg &amp;quot;packet&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (rawsock:socket :inet :raw 0 #+ignore #x300))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(t (error &amp;quot;invalid socket argument ~S&amp;quot; arg)))))
&lt;br&gt;(unless (plusp *socket*)
&lt;br&gt;&amp;nbsp; &amp;nbsp;(error &amp;quot;Invalid socket created for ~S: ~S&amp;quot; *args* *socket*))
&lt;br&gt;&lt;br&gt;FC
&lt;br&gt;On Dec 3, 2009, at 7:38 AM, Sam Steingold wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Fred Cohen wrote:
&lt;br&gt;&amp;gt;&amp;gt; (IN-PACKAGE &amp;quot;RAWSOCK&amp;quot;)
&lt;br&gt;&amp;gt;&amp;gt; (setf socket (rawsock:socket :inet :RAW 0 #+ignore :all)
&lt;br&gt;&amp;gt;&amp;gt; 	device
&lt;br&gt;&amp;gt;&amp;gt; 	(rawsock:make-sockaddr :UNSPEC
&lt;br&gt;&amp;gt;&amp;gt; 		(make-array 14 :element-type '(unsigned-byte 8)))
&lt;br&gt;&amp;gt;&amp;gt; 	buffer
&lt;br&gt;&amp;gt;&amp;gt; 	(make-array 1518 :element-type '(unsigned-byte 8) :fill-pointer &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; 1518)))
&lt;br&gt;&amp;gt;&amp;gt; (configdev socket &amp;quot;eth0&amp;quot; 1 1 ) &amp;nbsp;; eth0 no arp raw mode on socket
&lt;br&gt;&amp;gt;&amp;gt; (defun getraw ()
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; (if (not (= -1 socket))
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; (setf (fill-pointer buffer) 1518
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; len #+ignore (rawsock::recvfr socket)
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (rawsock:recvfrom socket buffer device)
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (fill-pointer buffer) len)))
&lt;br&gt;&amp;gt;&amp;gt; (defun print-buffer () (loop for i below len do (format t &amp;quot;~2,'0X &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; &amp;quot; &amp;nbsp;(aref buffer i))))
&lt;br&gt;&amp;gt;&amp;gt; ;; a rudimentary dump of all packets seen.
&lt;br&gt;&amp;gt;&amp;gt; (loop while true do ((getraw)(print-buffer)))
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; my sniffer.lisp does not call configdev.
&lt;br&gt;&amp;gt; how does it affect its functioning?
&lt;br&gt;&amp;gt; I do not want to try because your explanations did not allay my &amp;nbsp;
&lt;br&gt;&amp;gt; fears that the changes configdev introduces to the system are &amp;nbsp;
&lt;br&gt;&amp;gt; completely reversed by closing the socket.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;- This communication is confidential to the parties it is intended to &amp;nbsp;
&lt;br&gt;serve -
&lt;br&gt;Fred Cohen &amp; Associates &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tel/fax: 925-454-0171
&lt;br&gt;&lt;a href=&quot;http://all.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://all.net/&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;572 Leona Drive &amp;nbsp; &amp;nbsp;Livermore, CA 94550
&lt;br&gt;Join &lt;a href=&quot;http://tech.groups.yahoo.com/group/FCA-announce/join&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tech.groups.yahoo.com/group/FCA-announce/join&lt;/a&gt;&amp;nbsp;for our &amp;nbsp;
&lt;br&gt;mailing list
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26628474&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26628474.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26628010</id>
	<title>Re: rawsock sniffer demo</title>
	<published>2009-12-03T07:38:47Z</published>
	<updated>2009-12-03T07:38:47Z</updated>
	<author>
		<name>Sam Steingold</name>
	</author>
	<content type="html">Fred Cohen wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; (IN-PACKAGE &amp;quot;RAWSOCK&amp;quot;)
&lt;br&gt;&amp;gt; (setf socket (rawsock:socket :inet :RAW 0 #+ignore :all)
&lt;br&gt;&amp;gt; 	device
&lt;br&gt;&amp;gt; 	(rawsock:make-sockaddr :UNSPEC
&lt;br&gt;&amp;gt; 		(make-array 14 :element-type '(unsigned-byte 8)))
&lt;br&gt;&amp;gt; 	buffer
&lt;br&gt;&amp;gt; 	(make-array 1518 :element-type '(unsigned-byte 8) :fill-pointer 1518)))
&lt;br&gt;&amp;gt; (configdev socket &amp;quot;eth0&amp;quot; 1 1 ) &amp;nbsp;; eth0 no arp raw mode on socket
&lt;br&gt;&amp;gt; (defun getraw ()
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;(if (not (= -1 socket))
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(setf (fill-pointer buffer) 1518
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;len #+ignore (rawsock::recvfr socket)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(rawsock:recvfrom socket buffer device)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(fill-pointer buffer) len)))
&lt;br&gt;&amp;gt; (defun print-buffer () (loop for i below len do (format t &amp;quot;~2,'0X &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;quot; &amp;nbsp;(aref buffer i))))
&lt;br&gt;&amp;gt; ;; a rudimentary dump of all packets seen.
&lt;br&gt;&amp;gt; (loop while true do ((getraw)(print-buffer)))
&lt;/div&gt;&lt;br&gt;my sniffer.lisp does not call configdev.
&lt;br&gt;how does it affect its functioning?
&lt;br&gt;I do not want to try because your explanations did not allay my fears that the 
&lt;br&gt;changes configdev introduces to the system are completely reversed by closing 
&lt;br&gt;the socket.
&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26628010&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26628010.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26624954</id>
	<title>clisp-cvs Digest, Vol 44, Issue 2</title>
	<published>2009-12-03T04:04:41Z</published>
	<updated>2009-12-03T04:04:41Z</updated>
	<author>
		<name>clisp-cvs-request</name>
	</author>
	<content type="html">Send clisp-cvs mailing list submissions to
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;To subscribe or unsubscribe via the World Wide Web, visit
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-cvs&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-cvs&lt;/a&gt;&lt;br&gt;or, via email, send a message with subject or body 'help' to
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs-request@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;You can reach the person managing the list at
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs-owner@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;When replying, please edit your Subject line so it is more specific
&lt;br&gt;than &amp;quot;Re: Contents of clisp-cvs digest...&amp;quot;
&lt;br&gt;&lt;br&gt;&lt;br&gt;CLISP CVS commits for today
&lt;br&gt;&lt;br&gt;Today's Topics:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;1. clisp/modules/rawsock rawsock.c,1.126,1.127
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; rawsock.xml,1.60,1.61 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;2. clisp/modules/rawsock rawsock.c,1.127,1.128 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;3. clisp/src ChangeLog,1.7216,1.7217 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;4. clisp/modules/rawsock test.tst,1.58,1.59 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;5. clisp/modules/rawsock/demos - New directory (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;6. clisp/modules/rawsock/demos README,NONE,1.1
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sniffer.lisp,NONE,1.1 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;7. clisp/modules/rawsock Makefile.in,1.13,1.14 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;8. clisp/src ChangeLog,1.7217,1.7218 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;9. clisp/modules/rawsock rawsock.xml,1.61,1.62 (Sam Steingold)
&lt;br&gt;&lt;br&gt;&lt;br&gt;----------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;Message: 1
&lt;br&gt;Date: Wed, 02 Dec 2009 21:06:04 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/modules/rawsock rawsock.c,1.126,1.127
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rawsock.xml,1.60,1.61
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFwOi-0003TA-15@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/modules/rawsock
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv13314/modules/rawsock
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rawsock.c rawsock.xml 
&lt;br&gt;Log Message:
&lt;br&gt;checksum buffer is an ethernet frame starting with 14 byte MAC address
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: rawsock.xml
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/modules/rawsock/rawsock.xml,v
&lt;br&gt;retrieving revision 1.60
&lt;br&gt;retrieving revision 1.61
&lt;br&gt;diff -u -d -r1.60 -r1.61
&lt;br&gt;--- rawsock.xml	1 Dec 2009 22:43:43 -0000	1.60
&lt;br&gt;+++ rawsock.xml	2 Dec 2009 21:05:59 -0000	1.61
&lt;br&gt;@@ -316,8 +316,9 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp;- &amp;udp;&amp;lt;/term&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;lt;listitem&amp;gt;&amp;lt;simpara&amp;gt;Compute the appropriate protocol checksum and record
&lt;br&gt;&amp;nbsp; &amp;nbsp; it in the appropriate location. &amp;nbsp;&amp;buf-r; is assumed to be a suitable
&lt;br&gt;- &amp;nbsp; packet for the protocol, with the appropriate header etc.
&lt;br&gt;- &amp;nbsp; The typical packet you send is both &amp;ip; and &amp;tcp; and thus has two
&lt;br&gt;+ &amp;nbsp; ethernet frame (starting with a 14 byte MAC address) for the protocol,
&lt;br&gt;+ &amp;nbsp; with the appropriate header etc.&amp;lt;/simpara&amp;gt;
&lt;br&gt;+ &amp;nbsp;&amp;lt;simpara&amp;gt;A typical packet you send is both &amp;ip; and &amp;tcp; and thus has two
&lt;br&gt;&amp;nbsp; &amp;nbsp; checksums, so you would want to call &amp;lt;emphasis&amp;gt;two&amp;lt;/emphasis&amp;gt; functions.
&lt;br&gt;&amp;nbsp;&amp;lt;/simpara&amp;gt;&amp;lt;/listitem&amp;gt;&amp;lt;/varlistentry&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;lt;varlistentry&amp;gt;&amp;lt;term&amp;gt;&amp;lt;code&amp;gt;(RAWSOCK:CONFIGDEV &amp;sock-r;
&lt;br&gt;&lt;br&gt;Index: rawsock.c
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/modules/rawsock/rawsock.c,v
&lt;br&gt;retrieving revision 1.126
&lt;br&gt;retrieving revision 1.127
&lt;br&gt;diff -u -d -r1.126 -r1.127
&lt;br&gt;--- rawsock.c	1 Dec 2009 18:39:27 -0000	1.126
&lt;br&gt;+++ rawsock.c	2 Dec 2009 21:05:58 -0000	1.127
&lt;br&gt;@@ -1439,6 +1439,8 @@
&lt;br&gt;&amp;nbsp;#endif
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;/* ================== CHECKSUM from Fred Cohen ================== */
&lt;br&gt;+/* these check sum functions operate on ethernet _frames_,
&lt;br&gt;+ &amp;nbsp; i.e., the 14 bytes MAC address followed by an IP datagram. */
&lt;br&gt;&amp;nbsp;static unsigned short ipcsum (unsigned char* buffer, size_t length) {
&lt;br&gt;&amp;nbsp; &amp;nbsp;register long sum=0; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* assumes long == 32 bits */
&lt;br&gt;&amp;nbsp; &amp;nbsp;unsigned short result;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 2
&lt;br&gt;Date: Wed, 02 Dec 2009 21:42:05 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/modules/rawsock rawsock.c,1.127,1.128
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=8&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFwxZ-0005Tw-Du@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/modules/rawsock
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv21002/modules/rawsock
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rawsock.c 
&lt;br&gt;Log Message:
&lt;br&gt;(get_socket_protocol) [HAVE_GETPROTOBYNAME]: fix argument order in the error message
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: rawsock.c
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/modules/rawsock/rawsock.c,v
&lt;br&gt;retrieving revision 1.127
&lt;br&gt;retrieving revision 1.128
&lt;br&gt;diff -u -d -r1.127 -r1.128
&lt;br&gt;--- rawsock.c	2 Dec 2009 21:05:58 -0000	1.127
&lt;br&gt;+++ rawsock.c	2 Dec 2009 21:42:02 -0000	1.128
&lt;br&gt;@@ -657,7 +657,7 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;});
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if (pe) return pe-&amp;gt;p_proto;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;pushSTACK(NIL); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* no PLACE */
&lt;br&gt;- &amp;nbsp; &amp;nbsp;pushSTACK(TheSubr(subr_self)-&amp;gt;name); pushSTACK(proto);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;pushSTACK(proto); pushSTACK(TheSubr(subr_self)-&amp;gt;name);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;check_value(error_condition,GETTEXT(&amp;quot;~S: invalid protocol name ~S&amp;quot;));
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;proto = value1;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;goto get_socket_protocol_restart;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 3
&lt;br&gt;Date: Wed, 02 Dec 2009 21:42:06 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=9&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/src ChangeLog,1.7216,1.7217
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=10&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=11&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFwxa-0005U2-8v@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/src
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv21002/src
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ChangeLog 
&lt;br&gt;Log Message:
&lt;br&gt;(get_socket_protocol) [HAVE_GETPROTOBYNAME]: fix argument order in the error message
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: ChangeLog
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
&lt;br&gt;retrieving revision 1.7216
&lt;br&gt;retrieving revision 1.7217
&lt;br&gt;diff -u -d -r1.7216 -r1.7217
&lt;br&gt;--- ChangeLog	1 Dec 2009 18:39:28 -0000	1.7216
&lt;br&gt;+++ ChangeLog	2 Dec 2009 21:42:03 -0000	1.7217
&lt;br&gt;@@ -1,3 +1,8 @@
&lt;br&gt;+2009-12-02 &amp;nbsp;Sam Steingold &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=12&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	* modules/rawsock/rawsock.c (get_socket_protocol)
&lt;br&gt;+	[HAVE_GETPROTOBYNAME]: fix argument order in the error message
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-12-01 &amp;nbsp;Sam Steingold &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=13&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	* modules/clx/new-clx/clx.f, modules/rawsock/rawsock.c (unused):
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 4
&lt;br&gt;Date: Wed, 02 Dec 2009 21:48:58 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=14&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/modules/rawsock test.tst,1.58,1.59
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=15&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=16&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFx4E-0005sM-AZ@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/modules/rawsock
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv22581
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test.tst 
&lt;br&gt;Log Message:
&lt;br&gt;add a test for check_socket_protocol
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: test.tst
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/modules/rawsock/test.tst,v
&lt;br&gt;retrieving revision 1.58
&lt;br&gt;retrieving revision 1.59
&lt;br&gt;diff -u -d -r1.58 -r1.59
&lt;br&gt;--- test.tst	8 Oct 2009 18:58:39 -0000	1.58
&lt;br&gt;+++ test.tst	2 Dec 2009 21:48:56 -0000	1.59
&lt;br&gt;@@ -106,11 +106,15 @@
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;(catch 'type-error-handler
&lt;br&gt;&amp;nbsp; &amp;nbsp;(handler-bind ((type-error #'type-error-handler))
&lt;br&gt;- &amp;nbsp; &amp;nbsp;(rawsock:socket :INET :FOO nil)))
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;(rawsock:socket :INET t nil)))
&lt;br&gt;&amp;nbsp;NIL
&lt;br&gt;&amp;nbsp;(catch 'type-error-handler
&lt;br&gt;&amp;nbsp; &amp;nbsp;(handler-bind ((type-error #'type-error-handler))
&lt;br&gt;- &amp;nbsp; &amp;nbsp;(rawsock:socket :FOO :STREAM nil)))
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;(rawsock:socket t :STREAM nil)))
&lt;br&gt;+NIL
&lt;br&gt;+(catch 'type-error-handler
&lt;br&gt;+ &amp;nbsp;(handler-bind ((type-error #'type-error-handler))
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;(rawsock:socket :INET :STREAM t)))
&lt;br&gt;&amp;nbsp;NIL
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;(integerp (show (setq *sock* (rawsock:socket :INET :STREAM nil)))) T
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 5
&lt;br&gt;Date: Wed, 02 Dec 2009 23:00:46 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=17&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/modules/rawsock/demos - New directory
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=18&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=19&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFyBi-0001tI-9k@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/modules/rawsock/demos
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv7228/demos
&lt;br&gt;&lt;br&gt;Log Message:
&lt;br&gt;Directory /cvsroot/clisp/clisp/modules/rawsock/demos added to the repository
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 6
&lt;br&gt;Date: Wed, 02 Dec 2009 23:03:14 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=20&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/modules/rawsock/demos README,NONE,1.1
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sniffer.lisp,NONE,1.1
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=21&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=22&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFyE6-000243-1N@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/modules/rawsock/demos
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv7919/modules/rawsock/demos
&lt;br&gt;&lt;br&gt;Added Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; README sniffer.lisp 
&lt;br&gt;Log Message:
&lt;br&gt;* modules/rawsock/demos/sniffer.lisp: add a demo
&lt;br&gt;* modules/rawsock/Makefile.in (clisp-module-distrib): install it
&lt;br&gt;&lt;br&gt;&lt;br&gt;--- NEW FILE: README ---
&lt;br&gt;These are various Rawsock demos.
&lt;br&gt;Most have to be run as a superuser, so beware!
&lt;br&gt;We assume no responsibility for your use of this software.
&lt;br&gt;&lt;br&gt;--- NEW FILE: sniffer.lisp ---
&lt;br&gt;;;; Packet sniffer
&lt;br&gt;;; run as root like this:
&lt;br&gt;;; sudo clisp sniffer.lisp inet 100
&lt;br&gt;&lt;br&gt;(require &amp;quot;rawsock&amp;quot;)
&lt;br&gt;&lt;br&gt;(defvar *buffer-len* 1518)
&lt;br&gt;&lt;br&gt;(defun my-rcvfrom (socket buffer device)
&lt;br&gt;&amp;nbsp; (setf (fill-pointer buffer) 1518)
&lt;br&gt;&amp;nbsp; (let ((len (rawsock:recvfrom socket buffer device)))
&lt;br&gt;&amp;nbsp; &amp;nbsp; (setf (fill-pointer buffer) len)))
&lt;br&gt;&lt;br&gt;(defun print-buffer (buffer)
&lt;br&gt;&amp;nbsp; (format t &amp;quot;len=~:D&amp;quot; (length buffer))
&lt;br&gt;&amp;nbsp; (loop :for byte :across buffer :do (format t &amp;quot; ~2,'0X&amp;quot; &amp;nbsp;byte))
&lt;br&gt;&amp;nbsp; (terpri))
&lt;br&gt;&lt;br&gt;(defun sniff (socket repeat)
&lt;br&gt;&amp;nbsp; (loop
&lt;br&gt;&amp;nbsp; &amp;nbsp; :with buffer = (make-array *buffer-len* :element-type '(unsigned-byte 8)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;:fill-pointer 0)
&lt;br&gt;&amp;nbsp; &amp;nbsp; :and device = (rawsock:make-sockaddr :UNSPEC)
&lt;br&gt;&amp;nbsp; &amp;nbsp; :repeat repeat :do
&lt;br&gt;&amp;nbsp; &amp;nbsp; (my-rcvfrom socket buffer device)
&lt;br&gt;&amp;nbsp; &amp;nbsp; (format t &amp;quot;~%family ~a &amp;quot; (rawsock:sockaddr-family device))
&lt;br&gt;&amp;nbsp; &amp;nbsp; (loop :for c :across (rawsock:sockaddr-data device)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; :do (format t &amp;quot;~c&amp;quot; (if (= c 0) #\space (code-char c ))))
&lt;br&gt;&amp;nbsp; &amp;nbsp; (print-buffer buffer)))
&lt;br&gt;&lt;br&gt;(unless (= 2 (length *args*))
&lt;br&gt;&amp;nbsp; (error &amp;quot;Expected: ({inet|packet} repeat-count), got ~S&amp;quot; *args*))
&lt;br&gt;&lt;br&gt;(defparameter *socket*
&lt;br&gt;&amp;nbsp; (let ((arg (pop *args*)))
&lt;br&gt;&amp;nbsp; &amp;nbsp; (cond ((string= arg &amp;quot;inet&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(rawsock:socket :inet :packet #x300))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((string= arg &amp;quot;packet&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(rawsock:socket :packet :raw #x300))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (t (error &amp;quot;invalid socket argument ~S&amp;quot; arg)))))
&lt;br&gt;(unless (plusp *socket*)
&lt;br&gt;&amp;nbsp; (error &amp;quot;Invalid socket created for ~S: ~S&amp;quot; *args* *socket*))
&lt;br&gt;&lt;br&gt;(sniff *socket* (parse-integer (pop *args*)))
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 7
&lt;br&gt;Date: Wed, 02 Dec 2009 23:03:13 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=23&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/modules/rawsock Makefile.in,1.13,1.14
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=24&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=25&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFyE6-000244-1M@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/modules/rawsock
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv7919/modules/rawsock
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Makefile.in 
&lt;br&gt;Log Message:
&lt;br&gt;* modules/rawsock/demos/sniffer.lisp: add a demo
&lt;br&gt;* modules/rawsock/Makefile.in (clisp-module-distrib): install it
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: Makefile.in
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/modules/rawsock/Makefile.in,v
&lt;br&gt;retrieving revision 1.13
&lt;br&gt;retrieving revision 1.14
&lt;br&gt;diff -u -d -r1.13 -r1.14
&lt;br&gt;--- Makefile.in	3 Sep 2009 15:28:58 -0000	1.13
&lt;br&gt;+++ Makefile.in	2 Dec 2009 23:03:11 -0000	1.14
&lt;br&gt;@@ -33,6 +33,8 @@
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;preload.lisp : $(srcdir)/preload.lisp
&lt;br&gt;&amp;nbsp;	$(LN_S) $(srcdir)/preload.lisp .
&lt;br&gt;+	mkdir -p $(distribdir)/demos
&lt;br&gt;+	$(LN) $(srcdir)/demos/*.lisp $(srcdir)/demos/README $(distribdir)/demos/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Make a module distribution into $(distribdir)
&lt;br&gt;&amp;nbsp;clisp-module-distrib : clisp-module force
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 8
&lt;br&gt;Date: Wed, 02 Dec 2009 23:03:15 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=26&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/src ChangeLog,1.7217,1.7218
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=27&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=28&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFyE7-00024E-Jl@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/src
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv7919/src
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ChangeLog 
&lt;br&gt;Log Message:
&lt;br&gt;* modules/rawsock/demos/sniffer.lisp: add a demo
&lt;br&gt;* modules/rawsock/Makefile.in (clisp-module-distrib): install it
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: ChangeLog
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
&lt;br&gt;retrieving revision 1.7217
&lt;br&gt;retrieving revision 1.7218
&lt;br&gt;diff -u -d -r1.7217 -r1.7218
&lt;br&gt;--- ChangeLog	2 Dec 2009 21:42:03 -0000	1.7217
&lt;br&gt;+++ ChangeLog	2 Dec 2009 23:03:11 -0000	1.7218
&lt;br&gt;@@ -1,5 +1,10 @@
&lt;br&gt;&amp;nbsp;2009-12-02 &amp;nbsp;Sam Steingold &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=29&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	* modules/rawsock/demos/sniffer.lisp: add a demo
&lt;br&gt;+	* modules/rawsock/Makefile.in (clisp-module-distrib): install it
&lt;br&gt;+
&lt;br&gt;+2009-12-02 &amp;nbsp;Sam Steingold &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=30&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	* modules/rawsock/rawsock.c (get_socket_protocol)
&lt;br&gt;&amp;nbsp;	[HAVE_GETPROTOBYNAME]: fix argument order in the error message
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 9
&lt;br&gt;Date: Wed, 02 Dec 2009 23:17:25 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=31&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/modules/rawsock rawsock.xml,1.61,1.62
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=32&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=33&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFyRp-0002qS-6u@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/modules/rawsock
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10930
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rawsock.xml 
&lt;br&gt;Log Message:
&lt;br&gt;mention modules/rawsock/demos/
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: rawsock.xml
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/modules/rawsock/rawsock.xml,v
&lt;br&gt;retrieving revision 1.61
&lt;br&gt;retrieving revision 1.62
&lt;br&gt;diff -u -d -r1.61 -r1.62
&lt;br&gt;--- rawsock.xml	2 Dec 2009 21:05:59 -0000	1.61
&lt;br&gt;+++ rawsock.xml	2 Dec 2009 23:17:23 -0000	1.62
&lt;br&gt;@@ -29,8 +29,9 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp;so you &amp;lt;emphasis&amp;gt;still&amp;lt;/emphasis&amp;gt; have to &amp;close; the original raw socket.
&lt;br&gt;&amp;nbsp;&amp;lt;/simpara&amp;gt;&amp;lt;/warning&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-&amp;lt;para&amp;gt;File &amp;lt;filename role=&amp;quot;clisp-cvs&amp;quot;&amp;gt;modules/rawsock/test.tst&amp;lt;/filename&amp;gt;
&lt;br&gt;- contains plenty of examples.&amp;lt;/para&amp;gt;
&lt;br&gt;+&amp;lt;para&amp;gt;Test file &amp;lt;filename role=&amp;quot;clisp-cvs&amp;quot;&amp;gt;modules/rawsock/test.tst&amp;lt;/filename&amp;gt;
&lt;br&gt;+ and the demos in &amp;lt;filename role=&amp;quot;clisp-cvs&amp;quot;&amp;gt;modules/rawsock/demos/&amp;lt;/filename&amp;gt;
&lt;br&gt;+ contain plenty of examples.&amp;lt;/para&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;lt;/section&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;&amp;lt;section id=&amp;quot;rawsock-func&amp;quot;&amp;gt;&amp;lt;title&amp;gt;Single System Call Functions&amp;lt;/title&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-cvs mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=34&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-cvs&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-cvs&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;End of clisp-cvs Digest, Vol 44, Issue 2
&lt;br&gt;****************************************
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26624954&amp;i=35&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-devel&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-devel-f3310.html&quot; embed=&quot;fixTarget[3310]&quot; target=&quot;_top&quot; &gt;clisp-devel&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/clisp-cvs-Digest%2C-Vol-44%2C-Issue-2-tp26624954p26624954.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26618749</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-12-02T15:50:02Z</published>
	<updated>2009-12-02T15:50:02Z</updated>
	<author>
		<name>Sam Steingold</name>
	</author>
	<content type="html">Fred Cohen wrote:
&lt;br&gt;&amp;gt; Fails:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt;sudo clisp sniffer.lisp inet 100
&lt;br&gt;&amp;gt; *** - LOAD: A file with name rawsock does not exist
&lt;br&gt;&lt;br&gt;either pass &amp;quot;-K full&amp;quot; to your clisp, or install a newer clisp (with dynamic 
&lt;br&gt;module loading)
&lt;br&gt;&lt;br&gt;&amp;gt; On Dec 2, 2009, at 3:17 PM, Sam Steingold wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; thanks, please take a look at
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://clisp.cvs.sourceforge.net/*checkout*/clisp/clisp/modules/rawsock/demos/sniffer.lisp&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://clisp.cvs.sourceforge.net/*checkout*/clisp/clisp/modules/rawsock/demos/sniffer.lisp&lt;/a&gt;&lt;br&gt;&lt;br&gt;contributions are welcome.
&lt;br&gt;&lt;br&gt;e.g.: ntp client; dns client
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26618749&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26618749.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26618652</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-12-02T15:38:47Z</published>
	<updated>2009-12-02T15:38:47Z</updated>
	<author>
		<name>Fred Cohen-3</name>
	</author>
	<content type="html">Fails:
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt;sudo clisp sniffer.lisp inet 100
&lt;br&gt;*** - LOAD: A file with name rawsock does not exist
&lt;br&gt;&lt;br&gt;On Dec 2, 2009, at 3:17 PM, Sam Steingold wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; thanks, please take a look at
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://clisp.cvs.sourceforge.net/*checkout*/clisp/clisp/modules/rawsock/demos/sniffer.lisp&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://clisp.cvs.sourceforge.net/*checkout*/clisp/clisp/modules/rawsock/demos/sniffer.lisp&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ------------------------------------------------------------------------------
&lt;br&gt;&amp;gt; Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;&amp;gt; a free event focused on virtualization and cloud computing.
&lt;br&gt;&amp;gt; Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; clisp-list mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26618652&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;- This communication is confidential to the parties it is intended to &amp;nbsp;
&lt;br&gt;serve -
&lt;br&gt;Fred Cohen &amp; Associates &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tel/fax: 925-454-0171
&lt;br&gt;&lt;a href=&quot;http://all.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://all.net/&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;572 Leona Drive &amp;nbsp; &amp;nbsp;Livermore, CA 94550
&lt;br&gt;Join &lt;a href=&quot;http://tech.groups.yahoo.com/group/FCA-announce/join&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tech.groups.yahoo.com/group/FCA-announce/join&lt;/a&gt;&amp;nbsp;for our &amp;nbsp;
&lt;br&gt;mailing list
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26618652&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26618652.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26618365</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-12-02T15:17:55Z</published>
	<updated>2009-12-02T15:17:55Z</updated>
	<author>
		<name>Sam Steingold</name>
	</author>
	<content type="html">thanks, please take a look at
&lt;br&gt;&lt;a href=&quot;http://clisp.cvs.sourceforge.net/*checkout*/clisp/clisp/modules/rawsock/demos/sniffer.lisp&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://clisp.cvs.sourceforge.net/*checkout*/clisp/clisp/modules/rawsock/demos/sniffer.lisp&lt;/a&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26618365&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26618365.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26617329</id>
	<title>Re: more on raw sockets</title>
	<published>2009-12-02T14:03:37Z</published>
	<updated>2009-12-02T14:03:37Z</updated>
	<author>
		<name>Sam Steingold</name>
	</author>
	<content type="html">Don Cohen wrote:
&lt;br&gt;&amp;gt; It now occurs to me that you have implemented much more of the socket
&lt;br&gt;&amp;gt; interface than what I would have called &amp;quot;raw&amp;quot; sockets. &amp;nbsp;It probably is
&lt;br&gt;&amp;gt; possible to use the non-raw parts to write a version of ping that does
&lt;br&gt;&amp;gt; not require root. &amp;nbsp;Perhaps this module should be renamed to something
&lt;br&gt;&amp;gt; more general than &amp;quot;raw&amp;quot;.
&lt;br&gt;&lt;br&gt;they are &amp;quot;raw&amp;quot; as opposed to &amp;quot;socket streams&amp;quot;, i.e., as close to the original 
&lt;br&gt;bsd syscalls as possible.
&lt;br&gt;&lt;br&gt;&amp;gt; Have I ever mentioned before this issue?
&lt;br&gt;&amp;gt; &amp;nbsp;(rawsock:socket :inet :packet #+ignore :all #x300)
&lt;br&gt;&amp;gt; :all seems to be 3, which doesn't work for me, whereas #x300 does.
&lt;br&gt;&amp;gt; Where did you get these constants? &amp;nbsp;I suspect some of the others
&lt;br&gt;&amp;gt; also. 
&lt;br&gt;&lt;br&gt;yes, you have complained about this before.
&lt;br&gt;:ETH-P-ALL is 3, as you can see by doing
&lt;br&gt;&lt;br&gt;(RAWSOCK:SOCKET :INET :STREAM T)
&lt;br&gt;&lt;br&gt;*** - RAWSOCK:SOCKET: Lisp value T is not found in table
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;check_socket_protocol&amp;quot;:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((0 :IPPROTO-IP) (41 :IPPROTO-IPV6) (1 :IPPROTO-ICMP) (255 :IPPROTO-RAW)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(6 :IPPROTO-TCP) (17 :IPPROTO-UDP) (2 :IPPROTO-IGMP) (4 :IPPROTO-IPIP)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(8 :IPPROTO-EGP) (12 :IPPROTO-PUP) (22 :IPPROTO-IDP)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(0 :IPPROTO-HOPOPTS) (43 :IPPROTO-ROUTING) (44 :IPPROTO-FRAGMENT)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(50 :IPPROTO-ESP) (51 :IPPROTO-AH) (58 :IPPROTO-ICMPV6)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(60 :IPPROTO-DSTOPTS) (59 :IPPROTO-NONE) (46 :IPPROTO-RSVP)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(47 :IPPROTO-GRE) (103 :IPPROTO-PIM) (108 :IPPROTO-COMP)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(96 :ETH-P-LOOP) (512 :ETH-P-PUP) (513 :ETH-P-PUPAT) (2048 :ETH-P-IP)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(2053 :ETH-P-X25) (2054 :ETH-P-ARP) (2303 :ETH-P-BPQ)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(2560 :ETH-P-IEEEPUP) (2561 :ETH-P-IEEEPUPAT) (24576 :ETH-P-DEC)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(24577 :ETH-P-DNA-DL) (24578 :ETH-P-DNA-RC) (24579 :ETH-P-DNA-RT)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(24580 :ETH-P-LAT) (24581 :ETH-P-DIAG) (24582 :ETH-P-CUST)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(24583 :ETH-P-SCA) (32821 :ETH-P-RARP) (32923 :ETH-P-ATALK)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(33011 :ETH-P-AARP) (33079 :ETH-P-IPX) (34525 :ETH-P-IPV6)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(34915 :ETH-P-PPP-DISC) (34916 :ETH-P-PPP-SES) (34892 :ETH-P-ATMMPOA)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(34948 :ETH-P-ATMFATE) (1 :ETH-P-802-3) (2 :ETH-P-AX25) (3 :ETH-P-ALL)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(4 :ETH-P-802-2) (5 :ETH-P-SNAP) (6 :ETH-P-DDCMP) (7 :ETH-P-WAN-PPP)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(8 :ETH-P-PPP-MP) (9 :ETH-P-LOCALTALK) (16 :ETH-P-PPPTALK)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(17 :ETH-P-TR-802-2) (21 :ETH-P-MOBITEX) (22 :ETH-P-CONTROL)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(23 :ETH-P-IRDA) (24 :ETH-P-ECONET))
&lt;br&gt;&lt;br&gt;these numbers come from
&lt;br&gt;/usr/include/linux/if_ether.h:#define ETH_P_ALL 0x0003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* Every packet 
&lt;br&gt;(be careful!!!) */
&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26617329&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/more-on-raw-sockets-tp26614378p26617329.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26617140</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-12-02T13:52:22Z</published>
	<updated>2009-12-02T13:52:22Z</updated>
	<author>
		<name>Don Cohen-12</name>
	</author>
	<content type="html">Sam Steingold writes:
&lt;br&gt;&amp;nbsp;&amp;gt; 1. (setf socket (rawsock:socket :inet :RAW 0))
&lt;br&gt;&amp;nbsp;&amp;gt; *** - UNIX error 93 (EPROTONOSUPPORT): Protocol not supported
&lt;br&gt;&amp;nbsp;&amp;gt; so I used :eth-p-all instead
&lt;br&gt;Ok, since you're trying this I send my version.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; 2. (setf socket (rawsock:socket :inet :RAW :eth-p-all))
&lt;br&gt;&amp;nbsp;&amp;gt; *** - UNIX error 1 (EPERM): Operation not permitted
&lt;br&gt;&amp;nbsp;&amp;gt; so I has to do sudo.
&lt;br&gt;As root won't help - my #x300 is the answer.
&lt;br&gt;Try loading this:
&lt;br&gt;====
&lt;br&gt;(setf socket (rawsock:socket :inet :packet #+ignore :all #x300))
&lt;br&gt;&lt;br&gt;#+ignore ; alternative version to try
&lt;br&gt;(setf socket (rawsock:socket :packet :raw #x300))
&lt;br&gt;&lt;br&gt;(setf device (rawsock:make-sockaddr :UNSPEC))
&lt;br&gt;&lt;br&gt;(setf buffer (make-array 1518 :element-type '(unsigned-byte 8) :fill-pointer 0))
&lt;br&gt;&lt;br&gt;(defun getraw () 
&lt;br&gt;&amp;nbsp; &amp;nbsp;(if (not (= -1 socket)) 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(setf (fill-pointer buffer) 1518 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;len (rawsock:recvfrom socket buffer device) 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(fill-pointer buffer) len)))
&lt;br&gt;&lt;br&gt;(defun print-buffer ()
&lt;br&gt;&amp;nbsp; (loop for i below len do (format t &amp;quot;~2,'0X &amp;quot; &amp;nbsp;(aref buffer i)))) 
&lt;br&gt;&lt;br&gt;;; 9 show packets 
&lt;br&gt;&lt;br&gt;(loop for i below 9 do
&lt;br&gt;&amp;nbsp; (getraw)
&lt;br&gt;&amp;nbsp; (format t &amp;quot;~%family ~a &amp;quot; (rawsock:sockaddr-family device))
&lt;br&gt;&amp;nbsp; (loop for i below (length (rawsock:sockaddr-data device))
&lt;br&gt;&amp;nbsp; &amp;nbsp; as c = (aref (rawsock:sockaddr-data device) i) do
&lt;br&gt;&amp;nbsp; &amp;nbsp; (format t &amp;quot;~c&amp;quot; (if (= c 0) #\space (code-char c ))))
&lt;br&gt;&amp;nbsp; (terpri)(print-buffer)(terpri))
&lt;br&gt;====
&lt;br&gt;&lt;br&gt;If it just sits there try sending some network traffic.
&lt;br&gt;Then you can try the alternative socket (uncomment 2nd expression).
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26617140&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26617140.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26617012</id>
	<title>Re: Doing everything with bytes =&gt; rawsock</title>
	<published>2009-12-02T13:44:18Z</published>
	<updated>2009-12-02T13:44:18Z</updated>
	<author>
		<name>Don Cohen-12</name>
	</author>
	<content type="html">&lt;br&gt;Sam Steingold writes:
&lt;br&gt;Oh, good - this is the message I should have replied to before.
&lt;br&gt;So I'll copy the relevant parts of the other message
&lt;br&gt;with subject: &amp;quot;[clisp-list] more on raw sockets&amp;quot;
&lt;br&gt;to here.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; Don Cohen wrote:
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; For instance, you could provide a udp socket interface and there might
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; be some demand for it among non-root users. &amp;nbsp;I don't even know what
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; other higher level facilities are available to non-root users.
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; could you please be more specific?
&lt;br&gt;&amp;nbsp;&amp;gt; what is missing?
&lt;br&gt;&lt;br&gt;I now suspect that you do have all you need:
&lt;br&gt;&amp;nbsp;It now occurs to me that you have implemented much more of the socket
&lt;br&gt;&amp;nbsp;interface than what I would have called &amp;quot;raw&amp;quot; sockets. &amp;nbsp;It probably is
&lt;br&gt;&amp;nbsp;possible to use the non-raw parts to write a version of ping that does
&lt;br&gt;&amp;nbsp;not require root. &amp;nbsp;Perhaps this module should be renamed to something
&lt;br&gt;&amp;nbsp;more general than &amp;quot;raw&amp;quot;.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; How does os:resolve-host-ipaddr find the dns server?
&lt;br&gt;&amp;nbsp;&amp;gt; it calls gethostbyname or gethostbyaddr.
&lt;br&gt;&amp;nbsp;&amp;gt; &lt;a href=&quot;http://clisp.cons.org/impnotes/syscalls.html#resolve-host&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://clisp.cons.org/impnotes/syscalls.html#resolve-host&lt;/a&gt;&lt;br&gt;Ok, just another system call that does all of the communication
&lt;br&gt;without us ever having to figure out how.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; Let's see if this helps to clarify the problem.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; For every packet you want to send you have to decide on an interface
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; (device) that will send it. &amp;nbsp;You also have to supply the ethernet
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; header. &amp;nbsp;This contains a from and to MAC address and two more bytes
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; which for ip packets will be 0800. &amp;nbsp;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; I don't know how to do any of this on non-linux machines.
&lt;br&gt;&amp;nbsp;&amp;gt; (RAWSOCK:IF-NAME-INDEX)
&lt;br&gt;&amp;nbsp;&amp;gt; (RAWSOCK:IFADDRS)
&lt;br&gt;&amp;nbsp;&amp;gt; &lt;a href=&quot;http://clisp.cons.org/impnotes/rawsock.html#rawsock-high-level&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://clisp.cons.org/impnotes/rawsock.html#rawsock-high-level&lt;/a&gt;&lt;br&gt;Well, that's interesting, but I'm having a hard time figuring out 
&lt;br&gt;what the results mean.
&lt;br&gt;For me the relevant one seems to be
&lt;br&gt;&amp;nbsp;#&amp;lt;RAWSOCK:IFADDRS :NAME &amp;quot;wlan0&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp;:FLAGS (:UP :BROADCAST :RUNNING :MULTICAST 65536)
&lt;br&gt;&amp;nbsp; &amp;nbsp;:ADDRESS #&amp;lt;RAWSOCK:SOCKADDR :%DATA #(2 0 0 0 10 0 2 100 0 0 0 0 0 0 0 0)&amp;gt;
&lt;br&gt;I gather the first 2 0 corresponds to &amp;nbsp;(2 :INET)
&lt;br&gt;The 10 0 2 100 is the ip address of this interface
&lt;br&gt;I wonder why it happens to be in the position above. &amp;nbsp;I'd have
&lt;br&gt;expected either at the left or right end.
&lt;br&gt;&amp;nbsp; &amp;nbsp;:NETMASK #&amp;lt;RAWSOCK:SOCKADDR :%DATA #(2 0 0 0 255 255 255 0 0 0 0 0 0 0 0 0)&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;:DESTINATION
&lt;br&gt;&amp;nbsp; &amp;nbsp;#&amp;lt;RAWSOCK:SOCKADDR :%DATA #(2 0 0 0 10 0 2 255 0 0 0 0 0 0 0 0)&amp;gt;
&lt;br&gt;This is the corresponding broadcast address.
&lt;br&gt;&amp;nbsp; &amp;nbsp;:DATA NIL&amp;gt;
&lt;br&gt;Nothing above tells us the mac address or any reason to choose this
&lt;br&gt;interface rather than any of the others.
&lt;br&gt;&lt;br&gt;However I now notice that the data does seem related to a different
&lt;br&gt;question I asked:
&lt;br&gt;&amp;nbsp;When I use (rawsock:socket :packet :raw #x300) instead I get back
&lt;br&gt;&amp;nbsp;similar data in the buffer but some other strange data in the address
&lt;br&gt;&amp;nbsp;object, such as 
&lt;br&gt;&amp;nbsp;#&amp;lt;RAWSOCK:SOCKADDR :%DATA #(17 0 8 0 3 0 0 0 33 3 4 6 0 33 107 64)&amp;gt;
&lt;br&gt;In this case the data above seem to correspond to
&lt;br&gt;&amp;nbsp;#&amp;lt;RAWSOCK:IFADDRS :NAME &amp;quot;wmaster0&amp;quot; :FLAGS (:UP :RUNNING 65536)
&lt;br&gt;&amp;nbsp; &amp;nbsp;:ADDRESS #&amp;lt;RAWSOCK:SOCKADDR :%DATA #(17 0 0 0 3 0 0 0 33 3 0 6 0 33 107 64)&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;:NETMASK NIL :DESTINATION NIL :DATA #&amp;lt;FOREIGN-POINTER #x00007F4808015E88&amp;gt;&amp;gt;
&lt;br&gt;I don't know enough about wmaster0 to begin to understand the address
&lt;br&gt;above - what I know about it is that it does not follow the expected
&lt;br&gt;frame format, which was giving me trouble.
&lt;br&gt;But if I look at this result of IFADDRS
&lt;br&gt;&amp;nbsp;#&amp;lt;RAWSOCK:IFADDRS :NAME &amp;quot;wlan0&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp;:FLAGS (:UP :BROADCAST :RUNNING :MULTICAST 65536)
&lt;br&gt;&amp;nbsp; &amp;nbsp;:ADDRESS #&amp;lt;RAWSOCK:SOCKADDR :%DATA #(17 0 0 0 4 0 0 0 1 0 0 6 0 33 107 64)&amp;gt;
&lt;br&gt;The data above does correspond to other data I saw in the address
&lt;br&gt;object. &amp;nbsp;The mac address of that interface is 00:21:6B:40:06:7E, or
&lt;br&gt;in decimal 0 33 107 64 6 126 -- suspiciously similar but not the same
&lt;br&gt;as the data above.
&lt;br&gt;&amp;nbsp; &amp;nbsp;:NETMASK NIL
&lt;br&gt;&amp;nbsp; &amp;nbsp;:DESTINATION
&lt;br&gt;&amp;nbsp; &amp;nbsp;#&amp;lt;RAWSOCK:SOCKADDR :%DATA #(17 0 0 0 4 0 0 0 1 0 0 6 255 255 255 255)&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;:DATA #&amp;lt;FOREIGN-POINTER #x00007F4808015EE4&amp;gt;&amp;gt;
&lt;br&gt;&lt;br&gt;And this gives some hint about the another part of the question:
&lt;br&gt;&amp;nbsp;(rawsock:socket :inet :packet #+ignore :all #x300)
&lt;br&gt;&amp;nbsp;When I call (rawsock:sockaddr-family device) I get back UNIX on
&lt;br&gt;&amp;nbsp;packets that clearly came over the network. 
&lt;br&gt;The results in this case are actually
&lt;br&gt;&amp;nbsp;1 0 (which I gather means UNIX)
&lt;br&gt;&amp;nbsp;and then the character codes for &amp;quot;wlan0&amp;quot; followed by nulls.
&lt;br&gt;So perhaps the address data for address family unix is the character
&lt;br&gt;name of the interface. &amp;nbsp;But it's not at all clear why using the
&lt;br&gt;AF :inet to create the socket should give addresses of family UNIX when 
&lt;br&gt;using AF :packet to create the socket gives addresses of family PACKET.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; On linux you can normally get a list of the available devices with
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; ifconfig. &amp;nbsp;I would prefer to use the ip command (see below) but my
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; impression is that it is not as universally available as ifconfig.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; As a default, at least for addresses out in the internet,
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; I'd suggest using (if available)
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; ip route |grep default
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; which would tell you the default device
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; in combination with
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; ip addr 
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; which would tell you its ip and mac address and
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; ip nei
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; which would tell you the destination mac address to use.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; There are probably equivalent ways of getting that info from /proc but
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; I don't think those are any more universal.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; universal or not, parsing the output of a shell command is not what
&lt;br&gt;&amp;nbsp;&amp;gt; the rawsock module should do.
&lt;br&gt;&amp;nbsp;&amp;gt; do you need an interface to netlink &amp; netdevice?
&lt;br&gt;&amp;nbsp;&amp;gt; &lt;a href=&quot;http://linux.about.com/library/cmd/blcmdl7_netdevice.htm&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://linux.about.com/library/cmd/blcmdl7_netdevice.htm&lt;/a&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &lt;a href=&quot;http://linux.about.com/library/cmd/blcmdl7_netlink.htm&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://linux.about.com/library/cmd/blcmdl7_netlink.htm&lt;/a&gt;&lt;br&gt;Why are these better than shell commands?
&lt;br&gt;Do we already have ways to use them from lisp?
&lt;br&gt;Perhaps the answer is that we can do that from rawsock, but not in
&lt;br&gt;order to figure out what data to pass in to rawsock!
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; Another approach to filling in the same info would be to read packets
&lt;br&gt;&amp;nbsp;&amp;gt; this appear to involve catching the packets (frames) that gethostbyname(2) 
&lt;br&gt;&amp;nbsp;&amp;gt; generates, which, I guess, requires running as root.
&lt;br&gt;Right, but when I wrote that I was imagining that we were using raw
&lt;br&gt;sockets rather than the more general c socket interface.
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26617012&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26617012.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26616946</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-12-02T13:38:08Z</published>
	<updated>2009-12-02T13:38:08Z</updated>
	<author>
		<name>Fred Cohen-3</name>
	</author>
	<content type="html">On Dec 2, 2009, at 1:19 PM, Sam Steingold wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Fred Cohen wrote:
&lt;br&gt;&amp;gt;&amp;gt; (IN-PACKAGE &amp;quot;RAWSOCK&amp;quot;)
&lt;br&gt;&amp;gt;&amp;gt; (setf socket (rawsock:socket :inet :RAW 0 #+ignore :all)
&lt;br&gt;&amp;gt;&amp;gt; 	device
&lt;br&gt;&amp;gt;&amp;gt; 	(rawsock:make-sockaddr :UNSPEC
&lt;br&gt;&amp;gt;&amp;gt; 		(make-array 14 :element-type '(unsigned-byte 8)))
&lt;br&gt;&amp;gt;&amp;gt; 	buffer
&lt;br&gt;&amp;gt;&amp;gt; 	(make-array 1518 :element-type '(unsigned-byte 8) :fill-pointer &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; 1518)))
&lt;br&gt;&amp;gt;&amp;gt; (configdev socket &amp;quot;eth0&amp;quot; 1 1 ) &amp;nbsp;; eth0 no arp raw mode on socket
&lt;br&gt;&amp;gt;&amp;gt; (defun getraw ()
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; (if (not (= -1 socket))
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; (setf (fill-pointer buffer) 1518
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; len #+ignore (rawsock::recvfr socket)
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (rawsock:recvfrom socket buffer device)
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (fill-pointer buffer) len)))
&lt;br&gt;&amp;gt;&amp;gt; (defun print-buffer () (loop for i below len do (format t &amp;quot;~2,'0X &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; &amp;quot; &amp;nbsp;(aref buffer i))))
&lt;br&gt;&amp;gt;&amp;gt; ;; a rudimentary dump of all packets seen.
&lt;br&gt;&amp;gt;&amp;gt; (loop while true do ((getraw)(print-buffer)))
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 1. (setf socket (rawsock:socket :inet :RAW 0))
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; *** - UNIX error 93 (EPROTONOSUPPORT): Protocol not supported
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; so I used :eth-p-all instead
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 2. (setf socket (rawsock:socket :inet :RAW :eth-p-all))
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; *** - UNIX error 1 (EPERM): Operation not permitted
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; so I has to do sudo.
&lt;/div&gt;&lt;br&gt;Yes - you will have to run as root no matter what for raw sockets to &amp;nbsp;
&lt;br&gt;work.
&lt;br&gt;&lt;br&gt;&amp;gt; 3. with the obvious syntax fixes, the last look just sits there &amp;nbsp;
&lt;br&gt;&amp;gt; without printing anything.
&lt;br&gt;&lt;br&gt;Right - till the socket gets something, nothing will print out. You &amp;nbsp;
&lt;br&gt;need to send it something...
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I mean the address argument is expected to be an int32.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Not even a string is accepted.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; It would seem, btw, that the IP address argument should actually &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; be &amp;nbsp;a socket address, as returned by host-&amp;gt;ip in rawsock/test.tst.
&lt;br&gt;&amp;gt;&amp;gt; IPv4 addresses are 4 bytes (octets) long - an int32.
&lt;br&gt;&lt;br&gt;This is about shoving bytes in and out of interfaces. IP addresses are &amp;nbsp;
&lt;br&gt;never stings...
&lt;br&gt;&lt;br&gt;&amp;gt; so, why configdev cannot handle IPv6 addresses?
&lt;br&gt;&lt;br&gt;It probably could, but I haven't had time to go through all of the &amp;nbsp;
&lt;br&gt;possible uses for it.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Nothing to fix.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I thought you said that configdev modifies the behavior of both &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; the &amp;nbsp;socket and the device (e.g., eth0).
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I can close the socket and open a new one, but how do I bring the &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; device back to the original behavior?
&lt;br&gt;&amp;gt;&amp;gt; (defun close-sock ()
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; (if (= (rawsock:sock-close #+ignore rawsock::closesock socket) -1)
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; (error &amp;quot;can't close socket&amp;quot;)))
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; you mean this resets the device as well?
&lt;/div&gt;&lt;br&gt;It removes the socket handler from the handlers list in the kernel. &amp;nbsp;
&lt;br&gt;There are permanent (OS-wide) changes and by-handler changes that &amp;nbsp;
&lt;br&gt;happen to the process of handling packets. Changes that apply to all &amp;nbsp;
&lt;br&gt;handlers are not changed by the close, but all handling done by the &amp;nbsp;
&lt;br&gt;handler is no longer done, so for example, if there is an IP handler &amp;nbsp;
&lt;br&gt;still running (e.g., a TCP handler), it might still operate after &amp;nbsp;
&lt;br&gt;removing the raw handler (and may even run while the raw handler is &amp;nbsp;
&lt;br&gt;running... talk about dangerous)!
&lt;br&gt;&lt;br&gt;As a rule of thumb, I would say you should redo any ifconfig you have &amp;nbsp;
&lt;br&gt;for an interface after you are no longer using raw sockets on it, and &amp;nbsp;
&lt;br&gt;not try to use both raw sockets and regular IP traffic handling on the &amp;nbsp;
&lt;br&gt;same interface. It is likely that you will have unpredictable and &amp;nbsp;
&lt;br&gt;possible catastrophic results (to your mechanisms and others).
&lt;br&gt;&lt;br&gt;Having said that, I have, from time to time, decided to observe such &amp;nbsp;
&lt;br&gt;results for scientific purposes...
&lt;br&gt;&lt;br&gt;FC
&lt;br&gt;- This communication is confidential to the parties it is intended to &amp;nbsp;
&lt;br&gt;serve -
&lt;br&gt;Fred Cohen &amp; Associates &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tel/fax: 925-454-0171
&lt;br&gt;&lt;a href=&quot;http://all.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://all.net/&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;572 Leona Drive &amp;nbsp; &amp;nbsp;Livermore, CA 94550
&lt;br&gt;Join &lt;a href=&quot;http://tech.groups.yahoo.com/group/FCA-announce/join&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tech.groups.yahoo.com/group/FCA-announce/join&lt;/a&gt;&amp;nbsp;for our &amp;nbsp;
&lt;br&gt;mailing list
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26616946&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26616946.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26616681</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-12-02T13:19:57Z</published>
	<updated>2009-12-02T13:19:57Z</updated>
	<author>
		<name>Sam Steingold</name>
	</author>
	<content type="html">Fred Cohen wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; (IN-PACKAGE &amp;quot;RAWSOCK&amp;quot;)
&lt;br&gt;&amp;gt; (setf socket (rawsock:socket :inet :RAW 0 #+ignore :all)
&lt;br&gt;&amp;gt; 	device
&lt;br&gt;&amp;gt; 	(rawsock:make-sockaddr :UNSPEC
&lt;br&gt;&amp;gt; 		(make-array 14 :element-type '(unsigned-byte 8)))
&lt;br&gt;&amp;gt; 	buffer
&lt;br&gt;&amp;gt; 	(make-array 1518 :element-type '(unsigned-byte 8) :fill-pointer 1518)))
&lt;br&gt;&amp;gt; (configdev socket &amp;quot;eth0&amp;quot; 1 1 ) &amp;nbsp;; eth0 no arp raw mode on socket
&lt;br&gt;&amp;gt; (defun getraw ()
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;(if (not (= -1 socket))
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(setf (fill-pointer buffer) 1518
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;len #+ignore (rawsock::recvfr socket)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(rawsock:recvfrom socket buffer device)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(fill-pointer buffer) len)))
&lt;br&gt;&amp;gt; (defun print-buffer () (loop for i below len do (format t &amp;quot;~2,'0X &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;quot; &amp;nbsp;(aref buffer i))))
&lt;br&gt;&amp;gt; ;; a rudimentary dump of all packets seen.
&lt;br&gt;&amp;gt; (loop while true do ((getraw)(print-buffer)))
&lt;/div&gt;&lt;br&gt;&lt;br&gt;1. (setf socket (rawsock:socket :inet :RAW 0))
&lt;br&gt;&lt;br&gt;*** - UNIX error 93 (EPROTONOSUPPORT): Protocol not supported
&lt;br&gt;&lt;br&gt;so I used :eth-p-all instead
&lt;br&gt;&lt;br&gt;2. (setf socket (rawsock:socket :inet :RAW :eth-p-all))
&lt;br&gt;&lt;br&gt;*** - UNIX error 1 (EPERM): Operation not permitted
&lt;br&gt;&lt;br&gt;so I has to do sudo.
&lt;br&gt;&lt;br&gt;3. with the obvious syntax fixes, the last look just sits there without 
&lt;br&gt;printing anything.
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; I mean the address argument is expected to be an int32.
&lt;br&gt;&amp;gt;&amp;gt; Not even a string is accepted.
&lt;br&gt;&amp;gt;&amp;gt; It would seem, btw, that the IP address argument should actually be &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; a socket address, as returned by host-&amp;gt;ip in rawsock/test.tst.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; IPv4 addresses are 4 bytes (octets) long - an int32.
&lt;br&gt;&lt;br&gt;so, why configdev cannot handle IPv6 addresses?
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Nothing to fix.
&lt;br&gt;&amp;gt;&amp;gt; I thought you said that configdev modifies the behavior of both the &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; socket and the device (e.g., eth0).
&lt;br&gt;&amp;gt;&amp;gt; I can close the socket and open a new one, but how do I bring the &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; device back to the original behavior?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; (defun close-sock ()
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;(if (= (rawsock:sock-close #+ignore rawsock::closesock socket) -1)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(error &amp;quot;can't close socket&amp;quot;)))
&lt;br&gt;&lt;br&gt;you mean this resets the device as well?
&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26616681&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26616681.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26615314</id>
	<title>Re: Doing everything with bytes =&gt; rawsock</title>
	<published>2009-12-02T11:53:27Z</published>
	<updated>2009-12-02T11:53:27Z</updated>
	<author>
		<name>Sam Steingold</name>
	</author>
	<content type="html">Don Cohen wrote:
&lt;br&gt;&amp;gt; Then you need to provide access to other low level facilities that are
&lt;br&gt;&amp;gt; not as capable as raw sockets and therefore require less privilege.
&lt;br&gt;&lt;br&gt;what system calls are missing?
&lt;br&gt;&lt;br&gt;&amp;gt; For instance, you could provide a udp socket interface and there might
&lt;br&gt;&amp;gt; be some demand for it among non-root users. &amp;nbsp;I don't even know what
&lt;br&gt;&amp;gt; other higher level facilities are available to non-root users.
&lt;br&gt;&lt;br&gt;could you please be more specific?
&lt;br&gt;what is missing?
&lt;br&gt;&lt;br&gt;&amp;gt; How does os:resolve-host-ipaddr find the dns server?
&lt;br&gt;&lt;br&gt;it calls gethostbyname or gethostbyaddr.
&lt;br&gt;&lt;a href=&quot;http://clisp.cons.org/impnotes/syscalls.html#resolve-host&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://clisp.cons.org/impnotes/syscalls.html#resolve-host&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;gt; Let's see if this helps to clarify the problem.
&lt;br&gt;&amp;gt; For every packet you want to send you have to decide on an interface
&lt;br&gt;&amp;gt; (device) that will send it. &amp;nbsp;You also have to supply the ethernet
&lt;br&gt;&amp;gt; header. &amp;nbsp;This contains a from and to MAC address and two more bytes
&lt;br&gt;&amp;gt; which for ip packets will be 0800. &amp;nbsp;
&lt;br&gt;&amp;gt; I don't know how to do any of this on non-linux machines.
&lt;br&gt;&lt;br&gt;(RAWSOCK:IF-NAME-INDEX)
&lt;br&gt;(RAWSOCK:IFADDRS)
&lt;br&gt;&lt;a href=&quot;http://clisp.cons.org/impnotes/rawsock.html#rawsock-high-level&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://clisp.cons.org/impnotes/rawsock.html#rawsock-high-level&lt;/a&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On linux you can normally get a list of the available devices with
&lt;br&gt;&amp;gt; ifconfig. &amp;nbsp;I would prefer to use the ip command (see below) but my
&lt;br&gt;&amp;gt; impression is that it is not as universally available as ifconfig.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; As a default, at least for addresses out in the internet,
&lt;br&gt;&amp;gt; I'd suggest using (if available)
&lt;br&gt;&amp;gt; ip route |grep default
&lt;br&gt;&amp;gt; which would tell you the default device
&lt;br&gt;&amp;gt; in combination with
&lt;br&gt;&amp;gt; ip addr 
&lt;br&gt;&amp;gt; which would tell you its ip and mac address and
&lt;br&gt;&amp;gt; ip nei
&lt;br&gt;&amp;gt; which would tell you the destination mac address to use.
&lt;br&gt;&amp;gt; There are probably equivalent ways of getting that info from /proc but
&lt;br&gt;&amp;gt; I don't think those are any more universal.
&lt;/div&gt;&lt;br&gt;universal or not, parsing the output of a shell command is not what the rawsock 
&lt;br&gt;module should do.
&lt;br&gt;do you need an interface to netlink &amp; netdevice?
&lt;br&gt;&lt;a href=&quot;http://linux.about.com/library/cmd/blcmdl7_netdevice.htm&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://linux.about.com/library/cmd/blcmdl7_netdevice.htm&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://linux.about.com/library/cmd/blcmdl7_netlink.htm&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://linux.about.com/library/cmd/blcmdl7_netlink.htm&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;gt; Another approach to filling in the same info would be to read packets
&lt;br&gt;&amp;gt; coming in from the internet, perhaps in response to a command that you
&lt;br&gt;&amp;gt; execute. &amp;nbsp;For instance, if you do an os:resolve-host-ipaddr you can
&lt;br&gt;&amp;gt; expect to see a dns reply which will tell you among other things
&lt;br&gt;&amp;gt; - the ip address of the dns server
&lt;br&gt;&amp;gt; - the interface used to reach it
&lt;br&gt;&amp;gt; - the mac addresses you'd need to send packets out that interface
&lt;br&gt;&amp;gt; - your ip address (the one to which the reply was sent)
&lt;br&gt;&lt;br&gt;this appear to involve catching the packets (frames) that gethostbyname(2) 
&lt;br&gt;generates, which, I guess, requires running as root.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26615314&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26615314.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26614378</id>
	<title>more on raw sockets</title>
	<published>2009-12-02T10:58:44Z</published>
	<updated>2009-12-02T10:58:44Z</updated>
	<author>
		<name>Don Cohen-12</name>
	</author>
	<content type="html">&lt;br&gt;Sorry about not continuing the previous thread but I've already
&lt;br&gt;deleted the messages.
&lt;br&gt;&lt;br&gt;It now occurs to me that you have implemented much more of the socket
&lt;br&gt;interface than what I would have called &amp;quot;raw&amp;quot; sockets. &amp;nbsp;It probably is
&lt;br&gt;possible to use the non-raw parts to write a version of ping that does
&lt;br&gt;not require root. &amp;nbsp;Perhaps this module should be renamed to something
&lt;br&gt;more general than &amp;quot;raw&amp;quot;.
&lt;br&gt;&lt;br&gt;Have I ever mentioned before this issue?
&lt;br&gt;&amp;nbsp;(rawsock:socket :inet :packet #+ignore :all #x300)
&lt;br&gt;:all seems to be 3, which doesn't work for me, whereas #x300 does.
&lt;br&gt;Where did you get these constants? &amp;nbsp;I suspect some of the others
&lt;br&gt;also. 
&lt;br&gt;When I call (rawsock:sockaddr-family device) I get back UNIX on
&lt;br&gt;packets that clearly came over the network. &amp;nbsp;I also see it returning
&lt;br&gt;801 though I don't see where that is defined.
&lt;br&gt;&lt;br&gt;Another question: When I use the call above with :inet I get back
&lt;br&gt;reasonable looking results from rawsock:sockaddr-data - things that
&lt;br&gt;look like the device names shown by ifconfig.
&lt;br&gt;When I use (rawsock:socket :packet :raw #x300) instead I get back
&lt;br&gt;similar data in the buffer but some other strange data in the address
&lt;br&gt;object, such as 
&lt;br&gt;#&amp;lt;RAWSOCK:SOCKADDR :%DATA #(17 0 8 0 3 0 0 0 33 3 4 6 0 33 107 64)&amp;gt;
&lt;br&gt;This line in man socket suggests that :packet is what I want.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AF_PACKET &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Low level packet interface &amp;nbsp; &amp;nbsp; &amp;nbsp; packet(7)
&lt;br&gt;Any ideas?
&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26614378&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/more-on-raw-sockets-tp26614378p26614378.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26607813</id>
	<title>clisp-cvs Digest, Vol 44, Issue 1</title>
	<published>2009-12-02T04:04:26Z</published>
	<updated>2009-12-02T04:04:26Z</updated>
	<author>
		<name>clisp-cvs-request</name>
	</author>
	<content type="html">Send clisp-cvs mailing list submissions to
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;To subscribe or unsubscribe via the World Wide Web, visit
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-cvs&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-cvs&lt;/a&gt;&lt;br&gt;or, via email, send a message with subject or body 'help' to
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs-request@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;You can reach the person managing the list at
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs-owner@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;When replying, please edit your Subject line so it is more specific
&lt;br&gt;than &amp;quot;Re: Contents of clisp-cvs digest...&amp;quot;
&lt;br&gt;&lt;br&gt;&lt;br&gt;CLISP CVS commits for today
&lt;br&gt;&lt;br&gt;Today's Topics:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;1. clisp/src ChangeLog,1.7214,1.7215 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;2. clisp/modules/rawsock rawsock.c,1.124,1.125 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;3. clisp/doc common.xsl,1.77,1.78 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;4. clisp/modules/rawsock rawsock.c,1.125,1.126 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;5. clisp/modules/clx/new-clx clx.f,2.178,2.179 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;6. clisp/src ChangeLog,1.7215,1.7216 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;7. clisp/modules/rawsock rawsock.xml,1.58,1.59 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;8. clisp/modules/rawsock rawsock.xml,1.59,1.60 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;9. clisp/doc impent.xml,1.361,1.362 (Sam Steingold)
&lt;br&gt;&lt;br&gt;&lt;br&gt;----------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;Message: 1
&lt;br&gt;Date: Tue, 01 Dec 2009 18:34:22 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/src ChangeLog,1.7214,1.7215
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFXYN-0007rS-1n@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/src
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv30172/src
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ChangeLog 
&lt;br&gt;Log Message:
&lt;br&gt;(configdev): use strncpy/IFNAMSIZ
&lt;br&gt;instead of strcpy for copying the interface name
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: ChangeLog
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
&lt;br&gt;retrieving revision 1.7214
&lt;br&gt;retrieving revision 1.7215
&lt;br&gt;diff -u -d -r1.7214 -r1.7215
&lt;br&gt;--- ChangeLog	30 Nov 2009 04:30:27 -0000	1.7214
&lt;br&gt;+++ ChangeLog	1 Dec 2009 18:34:20 -0000	1.7215
&lt;br&gt;@@ -1,3 +1,8 @@
&lt;br&gt;+2009-12-01 &amp;nbsp;Sam Steingold &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	* modules/rawsock/rawsock.c (configdev): use strncpy/IFNAMSIZ
&lt;br&gt;+	instead of strcpy for copying the interface name
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-11-29 &amp;nbsp;Sam Steingold &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	* m4/clisp.m4 (CL_CLISP): use &amp;quot;.&amp;quot; instead of &amp;quot;source&amp;quot; (bash-specific)
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 2
&lt;br&gt;Date: Tue, 01 Dec 2009 18:34:22 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=8&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/modules/rawsock rawsock.c,1.124,1.125
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=9&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=10&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFXYM-0007rM-Ka@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/modules/rawsock
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv30172/modules/rawsock
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rawsock.c 
&lt;br&gt;Log Message:
&lt;br&gt;(configdev): use strncpy/IFNAMSIZ
&lt;br&gt;instead of strcpy for copying the interface name
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: rawsock.c
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/modules/rawsock/rawsock.c,v
&lt;br&gt;retrieving revision 1.124
&lt;br&gt;retrieving revision 1.125
&lt;br&gt;diff -u -d -r1.124 -r1.125
&lt;br&gt;--- rawsock.c	12 Nov 2009 20:36:13 -0000	1.124
&lt;br&gt;+++ rawsock.c	1 Dec 2009 18:34:20 -0000	1.125
&lt;br&gt;@@ -1145,12 +1145,12 @@
&lt;br&gt;&amp;nbsp;}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;#if defined(HAVE_NET_IF_H)
&lt;br&gt;-/* STACK_1 = name, for error reporting */
&lt;br&gt;-static void configdev (rawsock_t sock, char* name, int ipaddress, int flags) {
&lt;br&gt;+/* STACK_1 = ifname, for error reporting */
&lt;br&gt;+static void configdev (rawsock_t sock, char* ifname, int ipaddress, int flags) {
&lt;br&gt;&amp;nbsp; &amp;nbsp;struct ifreq ifrequest;
&lt;br&gt;&amp;nbsp;#if defined(SIOCGIFFLAGS) &amp;&amp; defined(SIOCSIFFLAGS)
&lt;br&gt;&amp;nbsp; &amp;nbsp;memset(&amp;ifrequest, 0, sizeof(struct ifreq));
&lt;br&gt;- &amp;nbsp;strcpy(ifrequest.ifr_name, name);
&lt;br&gt;+ &amp;nbsp;strncpy(ifrequest.ifr_name, ifname, IFNAMSIZ);
&lt;br&gt;&amp;nbsp; &amp;nbsp;if (ioctl(sock, SIOCGIFFLAGS, &amp;ifrequest) &amp;lt; 0)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;OS_file_error(STACK_1);
&lt;br&gt;&amp;nbsp; &amp;nbsp;ifrequest.ifr_flags |= flags;
&lt;br&gt;@@ -1159,7 +1159,7 @@
&lt;br&gt;&amp;nbsp;#endif
&lt;br&gt;&amp;nbsp;#if defined(SIOCGIFADDR) &amp;&amp; defined(SIOCSIFADDR)
&lt;br&gt;&amp;nbsp; &amp;nbsp;memset(&amp;ifrequest, 0, sizeof(struct ifreq));
&lt;br&gt;- &amp;nbsp;strcpy(ifrequest.ifr_name, name);
&lt;br&gt;+ &amp;nbsp;strncpy(ifrequest.ifr_name, ifname, IFNAMSIZ);
&lt;br&gt;&amp;nbsp; &amp;nbsp;if (ioctl(sock, SIOCGIFADDR, &amp;ifrequest) &amp;lt; 0)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;OS_file_error(STACK_1);
&lt;br&gt;&amp;nbsp; &amp;nbsp;/* address was 0.0.0.0 -&amp;gt; error */
&lt;br&gt;@@ -1177,13 +1177,13 @@
&lt;br&gt;&amp;nbsp;}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;DEFFLAGSET(configdev_flags,IFF_PROMISC IFF_NOARP)
&lt;br&gt;-DEFUN(RAWSOCK:CONFIGDEV, socket name ipaddress &amp;key PROMISC NOARP) {
&lt;br&gt;+DEFUN(RAWSOCK:CONFIGDEV, socket ifname ipaddress &amp;key PROMISC NOARP) {
&lt;br&gt;&amp;nbsp; &amp;nbsp;int flags = configdev_flags();
&lt;br&gt;&amp;nbsp; &amp;nbsp;uint32 ipaddress = I_to_UL(check_uint32(STACK_0));
&lt;br&gt;&amp;nbsp; &amp;nbsp;rawsock_t sock = I_to_uint(check_uint(STACK_2));
&lt;br&gt;- &amp;nbsp;with_string_0(check_string(STACK_1),Symbol_value(S(utf_8)),name, {
&lt;br&gt;+ &amp;nbsp;with_string_0(check_string(STACK_1),Symbol_value(S(utf_8)),ifname, {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;begin_blocking_system_call();
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;configdev(sock, name, ipaddress, flags);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;configdev(sock, ifname, ipaddress, flags);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end_blocking_system_call();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;});
&lt;br&gt;&amp;nbsp; &amp;nbsp;VALUES0; skipSTACK(3);
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 3
&lt;br&gt;Date: Tue, 01 Dec 2009 18:35:46 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=11&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/doc common.xsl,1.77,1.78
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=12&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=13&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFXZi-00087P-47@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/doc
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv31185
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; common.xsl 
&lt;br&gt;Log Message:
&lt;br&gt;RFC: rfc.net seems dead, use www.ietf.org/rfc instead
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: common.xsl
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/doc/common.xsl,v
&lt;br&gt;retrieving revision 1.77
&lt;br&gt;retrieving revision 1.78
&lt;br&gt;diff -u -d -r1.77 -r1.78
&lt;br&gt;--- common.xsl	29 Jun 2009 18:12:25 -0000	1.77
&lt;br&gt;+++ common.xsl	1 Dec 2009 18:35:44 -0000	1.78
&lt;br&gt;@@ -88,9 +88,9 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;gt;&amp;lt;xsl:apply-templates/&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/xsl:template&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;&amp;lt;!-- =============================== RFC =============================== --&amp;gt;
&lt;br&gt;-&amp;lt;xsl:param name=&amp;quot;rfc.top&amp;quot; select=&amp;quot;'&lt;a href=&quot;http://rfc.net/rfc'&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rfc.net/rfc'&lt;/a&gt;&amp;quot;/&amp;gt;
&lt;br&gt;+&amp;lt;xsl:param name=&amp;quot;rfc.top&amp;quot; select=&amp;quot;'&lt;a href=&quot;http://www.ietf.org/rfc/rfc'&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ietf.org/rfc/rfc'&lt;/a&gt;&amp;quot;/&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;lt;xsl:template match=&amp;quot;ulink[@role='rfc']&amp;quot;&amp;gt;
&lt;br&gt;- &amp;lt;a class=&amp;quot;{@role}&amp;quot; href=&amp;quot;{$rfc.top}{@url}.html&amp;quot;&amp;gt;&amp;lt;code&amp;gt;
&lt;br&gt;+ &amp;lt;a class=&amp;quot;{@role}&amp;quot; href=&amp;quot;{$rfc.top}{@url}.txt&amp;quot;&amp;gt;&amp;lt;code&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;xsl:choose&amp;gt;&amp;lt;xsl:when test=&amp;quot;.=''&amp;quot;&amp;gt;&amp;lt;xsl:text&amp;gt;RFC&amp;lt;/xsl:text&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;xsl:value-of select=&amp;quot;@url&amp;quot;/&amp;gt;&amp;lt;/xsl:when&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;xsl:otherwise&amp;gt;&amp;lt;xsl:apply-templates/&amp;gt;&amp;lt;/xsl:otherwise&amp;gt;&amp;lt;/xsl:choose&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 4
&lt;br&gt;Date: Tue, 01 Dec 2009 18:39:30 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=14&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/modules/rawsock rawsock.c,1.125,1.126
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=15&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=16&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFXdK-0000Mu-1H@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/modules/rawsock
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv1382/modules/rawsock
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rawsock.c 
&lt;br&gt;Log Message:
&lt;br&gt;(unused): define depending on __GNUC__, not GNU
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: rawsock.c
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/modules/rawsock/rawsock.c,v
&lt;br&gt;retrieving revision 1.125
&lt;br&gt;retrieving revision 1.126
&lt;br&gt;diff -u -d -r1.125 -r1.126
&lt;br&gt;--- rawsock.c	1 Dec 2009 18:34:20 -0000	1.125
&lt;br&gt;+++ rawsock.c	1 Dec 2009 18:39:27 -0000	1.126
&lt;br&gt;@@ -1548,7 +1548,7 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp;VALUES1(fixnum(length)); skipSTACK(1);
&lt;br&gt;&amp;nbsp;}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-#ifdef GNU &amp;nbsp; &amp;nbsp; /* to prevent a gcc-warning &amp;quot;statement with no effect&amp;quot; */
&lt;br&gt;+#ifdef __GNUC__ /* to prevent a gcc-warning &amp;quot;statement with no effect&amp;quot; */
&lt;br&gt;&amp;nbsp;# define unused &amp;nbsp;(void)
&lt;br&gt;&amp;nbsp;#else
&lt;br&gt;&amp;nbsp;# define unused
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 5
&lt;br&gt;Date: Tue, 01 Dec 2009 18:39:29 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=17&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/modules/clx/new-clx clx.f,2.178,2.179
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=18&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=19&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFXdK-0000Ms-0m@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/modules/clx/new-clx
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv1382/modules/clx/new-clx
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clx.f 
&lt;br&gt;Log Message:
&lt;br&gt;(unused): define depending on __GNUC__, not GNU
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: clx.f
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/modules/clx/new-clx/clx.f,v
&lt;br&gt;retrieving revision 2.178
&lt;br&gt;retrieving revision 2.179
&lt;br&gt;diff -u -d -r2.178 -r2.179
&lt;br&gt;--- clx.f	12 Nov 2009 20:36:13 -0000	2.178
&lt;br&gt;+++ clx.f	1 Dec 2009 18:39:27 -0000	2.179
&lt;br&gt;@@ -442,7 +442,7 @@
&lt;br&gt;&amp;nbsp;#include &amp;lt;X11/extensions/shape.h&amp;gt;
&lt;br&gt;&amp;nbsp;##endif
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-#ifdef GNU &amp;nbsp; &amp;nbsp; /* to prevent a gcc-warning &amp;quot;statement with no effect&amp;quot; */
&lt;br&gt;+#ifdef __GNUC__ /* to prevent a gcc-warning &amp;quot;statement with no effect&amp;quot; */
&lt;br&gt;&amp;nbsp;# define unused &amp;nbsp;(void)
&lt;br&gt;&amp;nbsp;#else
&lt;br&gt;&amp;nbsp;# define unused
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 6
&lt;br&gt;Date: Tue, 01 Dec 2009 18:39:30 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=20&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/src ChangeLog,1.7215,1.7216
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=21&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=22&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFXdK-0000N2-9A@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/src
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv1382/src
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ChangeLog 
&lt;br&gt;Log Message:
&lt;br&gt;(unused): define depending on __GNUC__, not GNU
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: ChangeLog
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
&lt;br&gt;retrieving revision 1.7215
&lt;br&gt;retrieving revision 1.7216
&lt;br&gt;diff -u -d -r1.7215 -r1.7216
&lt;br&gt;--- ChangeLog	1 Dec 2009 18:34:20 -0000	1.7215
&lt;br&gt;+++ ChangeLog	1 Dec 2009 18:39:28 -0000	1.7216
&lt;br&gt;@@ -1,5 +1,10 @@
&lt;br&gt;&amp;nbsp;2009-12-01 &amp;nbsp;Sam Steingold &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=23&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	* modules/clx/new-clx/clx.f, modules/rawsock/rawsock.c (unused):
&lt;br&gt;+	define depending on __GNUC__, not GNU
&lt;br&gt;+
&lt;br&gt;+2009-12-01 &amp;nbsp;Sam Steingold &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=24&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	* modules/rawsock/rawsock.c (configdev): use strncpy/IFNAMSIZ
&lt;br&gt;&amp;nbsp;	instead of strcpy for copying the interface name
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 7
&lt;br&gt;Date: Tue, 01 Dec 2009 19:16:39 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=25&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/modules/rawsock rawsock.xml,1.58,1.59
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=26&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=27&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFYDH-0002O0-PH@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/modules/rawsock
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9168
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rawsock.xml 
&lt;br&gt;Log Message:
&lt;br&gt;typos
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: rawsock.xml
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/modules/rawsock/rawsock.xml,v
&lt;br&gt;retrieving revision 1.58
&lt;br&gt;retrieving revision 1.59
&lt;br&gt;diff -u -d -r1.58 -r1.59
&lt;br&gt;--- rawsock.xml	1 Sep 2009 14:25:23 -0000	1.58
&lt;br&gt;+++ rawsock.xml	1 Dec 2009 19:16:37 -0000	1.59
&lt;br&gt;@@ -242,9 +242,9 @@
&lt;br&gt;&amp;nbsp;&amp;lt;varlistentry id=&amp;quot;rawsock-if-name-index&amp;quot;&amp;gt;&amp;lt;term&amp;gt;&amp;lt;code&amp;gt;(RAWSOCK:IF-NAME-INDEX
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;optional-amp; &amp;what-r;)&amp;lt;/code&amp;gt;&amp;lt;/term&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;lt;listitem&amp;gt;&amp;lt;simpara&amp;gt;Call &amp;lt;function role=&amp;quot;unix&amp;quot;&amp;gt;if_nametoindex&amp;lt;/function&amp;gt;
&lt;br&gt;- &amp;nbsp; when &amp;net-r; is a &amp;string-t; and return an &amp;integer-t;;
&lt;br&gt;+ &amp;nbsp; when &amp;when-r; is a &amp;string-t; and return an &amp;integer-t;;
&lt;br&gt;&amp;nbsp; &amp;nbsp; or call &amp;lt;function role=&amp;quot;unix&amp;quot;&amp;gt;if_indextoname&amp;lt;/function&amp;gt; when
&lt;br&gt;- &amp;nbsp; &amp;net-r; is an &amp;integer-t; and return a &amp;string-t;.
&lt;br&gt;+ &amp;nbsp; &amp;what-r; is an &amp;integer-t; and return a &amp;string-t;.
&lt;br&gt;&amp;nbsp; &amp;nbsp; When &amp;what-r; is &amp;nil;, return an &amp;alist; of
&lt;br&gt;&amp;nbsp; &amp;nbsp; pairs &amp;lt;literal role=&amp;quot;data&amp;quot;&amp;gt;(&amp;index-r; . &amp;name-r;)&amp;lt;/literal&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; using &amp;lt;function role=&amp;quot;unix&amp;quot;&amp;gt;if_nameindex&amp;lt;/function&amp;gt;.
&lt;br&gt;@@ -320,8 +320,9 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; The typical packet you send is both &amp;ip; and &amp;tcp; and thus has two
&lt;br&gt;&amp;nbsp; &amp;nbsp; checksums, so you would want to call &amp;lt;emphasis&amp;gt;two&amp;lt;/emphasis&amp;gt; functions.
&lt;br&gt;&amp;nbsp;&amp;lt;/simpara&amp;gt;&amp;lt;/listitem&amp;gt;&amp;lt;/varlistentry&amp;gt;
&lt;br&gt;-&amp;lt;varlistentry&amp;gt;&amp;lt;term&amp;gt;&amp;lt;code&amp;gt;(RAWSOCK:CONFIGDEV &amp;sock-r; &amp;name-r; &amp;addr-r;
&lt;br&gt;- &amp;nbsp; &amp;key-amp; &amp;lt;replaceable&amp;gt;promisc&amp;lt;/replaceable&amp;gt;
&lt;br&gt;+&amp;lt;varlistentry&amp;gt;&amp;lt;term&amp;gt;&amp;lt;code&amp;gt;(RAWSOCK:CONFIGDEV &amp;sock-r;
&lt;br&gt;+ &amp;nbsp; &amp;lt;replaceable&amp;gt;ifname&amp;lt;/replaceable&amp;gt; &amp;addr-r; &amp;key-amp;
&lt;br&gt;+ &amp;nbsp; &amp;lt;replaceable&amp;gt;promisc&amp;lt;/replaceable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;replaceable&amp;gt;noarp&amp;lt;/replaceable&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/term&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;lt;listitem&amp;gt;&amp;lt;simpara&amp;gt;Set some socket options and &amp;ip; &amp;addr-r;
&lt;br&gt;&amp;nbsp; &amp;nbsp; with &amp;lt;function role=&amp;quot;unix&amp;quot;&amp;gt;ioctl&amp;lt;/function&amp;gt;.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 8
&lt;br&gt;Date: Tue, 01 Dec 2009 22:43:45 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=28&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/modules/rawsock rawsock.xml,1.59,1.60
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=29&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=30&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFbRh-0005ZI-JK@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/modules/rawsock
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv21392/modules/rawsock
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rawsock.xml 
&lt;br&gt;Log Message:
&lt;br&gt;add &amp;or-e;
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: rawsock.xml
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/modules/rawsock/rawsock.xml,v
&lt;br&gt;retrieving revision 1.59
&lt;br&gt;retrieving revision 1.60
&lt;br&gt;diff -u -d -r1.59 -r1.60
&lt;br&gt;--- rawsock.xml	1 Dec 2009 19:16:37 -0000	1.59
&lt;br&gt;+++ rawsock.xml	1 Dec 2009 22:43:43 -0000	1.60
&lt;br&gt;@@ -256,7 +256,7 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; filtered using flags, e.g., &amp;lt;code&amp;gt;(ifaddrs :flags-or '(a b)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;:flags-and '(c d))&amp;lt;/code&amp;gt; will return a list of objects which have
&lt;br&gt;&amp;nbsp; &amp;nbsp; flags &amp;lt;literal&amp;gt;c&amp;lt;/literal&amp;gt; &amp;and-e; &amp;lt;literal&amp;gt;d&amp;lt;/literal&amp;gt; &amp;and-e; at
&lt;br&gt;- &amp;nbsp; least one of &amp;lt;literal&amp;gt;a&amp;lt;/literal&amp;gt; or &amp;lt;literal&amp;gt;b&amp;lt;/literal&amp;gt; set.
&lt;br&gt;+ &amp;nbsp; least one of &amp;lt;literal&amp;gt;a&amp;lt;/literal&amp;gt; &amp;or-e; &amp;lt;literal&amp;gt;b&amp;lt;/literal&amp;gt; set.
&lt;br&gt;&amp;nbsp;&amp;lt;/simpara&amp;gt;&amp;lt;/listitem&amp;gt;&amp;lt;/varlistentry&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;lt;varlistentry id=&amp;quot;rawsock-sockopt&amp;quot;&amp;gt;&amp;lt;term&amp;gt;&amp;lt;code&amp;gt;(RAWSOCK:SOCKET-OPTION
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;sock-r; &amp;name-r; &amp;key-amp; :LEVEL)&amp;lt;/code&amp;gt;&amp;lt;/term&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 9
&lt;br&gt;Date: Tue, 01 Dec 2009 22:43:45 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=31&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/doc impent.xml,1.361,1.362
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=32&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=33&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NFbRh-0005ZG-I7@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/doc
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv21392/doc
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; impent.xml 
&lt;br&gt;Log Message:
&lt;br&gt;add &amp;or-e;
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: impent.xml
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/doc/impent.xml,v
&lt;br&gt;retrieving revision 1.361
&lt;br&gt;retrieving revision 1.362
&lt;br&gt;diff -u -d -r1.361 -r1.362
&lt;br&gt;--- impent.xml	19 Nov 2009 21:02:22 -0000	1.361
&lt;br&gt;+++ impent.xml	1 Dec 2009 22:43:43 -0000	1.362
&lt;br&gt;@@ -1070,6 +1070,7 @@
&lt;br&gt;&amp;nbsp;&amp;lt;!ENTITY yes-en '&amp;lt;entry&amp;gt;yes&amp;lt;/entry&amp;gt;'&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;lt;!ENTITY no-en '&amp;lt;entry&amp;gt;no&amp;lt;/entry&amp;gt;'&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;lt;!ENTITY and-e '&amp;lt;emphasis role=&amp;quot;strong&amp;quot;&amp;gt;and&amp;lt;/emphasis&amp;gt;'&amp;gt;
&lt;br&gt;+&amp;lt;!ENTITY or-e '&amp;lt;emphasis role=&amp;quot;strong&amp;quot;&amp;gt;or&amp;lt;/emphasis&amp;gt;'&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;lt;!ENTITY not-e '&amp;lt;emphasis role=&amp;quot;strong&amp;quot;&amp;gt;not&amp;lt;/emphasis&amp;gt;'&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;lt;!ENTITY is-e '&amp;lt;emphasis role=&amp;quot;strong&amp;quot;&amp;gt;is&amp;lt;/emphasis&amp;gt;'&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;lt;!ENTITY after-e '&amp;lt;emphasis role=&amp;quot;strong&amp;quot;&amp;gt;after&amp;lt;/emphasis&amp;gt;'&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-cvs mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=34&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-cvs&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-cvs&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;End of clisp-cvs Digest, Vol 44, Issue 1
&lt;br&gt;****************************************
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26607813&amp;i=35&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-devel&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-devel-f3310.html&quot; embed=&quot;fixTarget[3310]&quot; target=&quot;_top&quot; &gt;clisp-devel&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/clisp-cvs-Digest%2C-Vol-44%2C-Issue-1-tp26607813p26607813.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26599463</id>
	<title>Re: Doing everything with bytes =&gt; rawsock</title>
	<published>2009-12-01T13:35:13Z</published>
	<updated>2009-12-01T13:35:13Z</updated>
	<author>
		<name>Don Cohen-12</name>
	</author>
	<content type="html">Sam Steingold writes:
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; Although ping does not require root, an implementation of ping
&lt;br&gt;&amp;nbsp;&amp;gt; using &amp;gt; rawsock WOULD require root, because you would be opening a
&lt;br&gt;&amp;nbsp;&amp;gt; raw socket.
&lt;br&gt;&amp;nbsp;&amp;gt; I don't understand this, so I will take your word.
&lt;br&gt;The real ping program does not create a raw socket.
&lt;br&gt;The people who put together OS environments think it's reasonable to
&lt;br&gt;allow non-root users to call that program.
&lt;br&gt;They don't think it's reasonable for non-root users to be able to open
&lt;br&gt;raw sockets because once you have one you can use it for a lot more 
&lt;br&gt;than ping.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; of course, I would much prefer an implementation which would not
&lt;br&gt;&amp;nbsp;&amp;gt; require root privileges. &amp;nbsp;nobody in his right mind would ever run
&lt;br&gt;&amp;nbsp;&amp;gt; sudo demo
&lt;br&gt;Then you need to provide access to other low level facilities that are
&lt;br&gt;not as capable as raw sockets and therefore require less privilege.
&lt;br&gt;For instance, you could provide a udp socket interface and there might
&lt;br&gt;be some demand for it among non-root users. &amp;nbsp;I don't even know what
&lt;br&gt;other higher level facilities are available to non-root users.
&lt;br&gt;I think that most of what rawsock users will want to do really
&lt;br&gt;deserves to be limited to root.
&lt;br&gt;(That's true of pretty much everything that Fred and I do with raw
&lt;br&gt;sockets. &amp;nbsp;Do you know of any other users?)
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; we already have os:resolve-host-ipaddr.
&lt;br&gt;&amp;nbsp;&amp;gt; actually, we have had it for 10.5 years, since 1999-03-10!
&lt;br&gt;Ok, though I thought maybe you'd like that as the first demo.
&lt;br&gt;Maybe you can use tcp for dns. &amp;nbsp;It might depend on your dns server.
&lt;br&gt;How does os:resolve-host-ipaddr find the dns server? &amp;nbsp;Is that also
&lt;br&gt;available as a lisp function? &amp;nbsp;
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; Above only begins to hint at how low level this stuff is. &amp;nbsp;This is a
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; problem for demos because there are too many details for anyone to
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; want to control, but it's not clear which ones the user (demo viewer)
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; will want to control, and each one leads to its own issue of how to
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; even find out which options are available. &amp;nbsp;I could write something
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; that would work out of MY box, but when it fails on your box you'll
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; have to understand a lot in order to figure out why. 
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; this is no good, of course.
&lt;br&gt;&amp;nbsp;&amp;gt; can you write a simple general purpose application, like ping or traceroute?
&lt;br&gt;&amp;nbsp;...
&lt;br&gt;&amp;nbsp;&amp;gt; how about a trivial ntp client instead then?
&lt;br&gt;&lt;br&gt;Let's see if this helps to clarify the problem.
&lt;br&gt;For every packet you want to send you have to decide on an interface
&lt;br&gt;(device) that will send it. &amp;nbsp;You also have to supply the ethernet
&lt;br&gt;header. &amp;nbsp;This contains a from and to MAC address and two more bytes
&lt;br&gt;which for ip packets will be 0800. &amp;nbsp;
&lt;br&gt;I don't know how to do any of this on non-linux machines.
&lt;br&gt;On linux you can normally get a list of the available devices with
&lt;br&gt;ifconfig. &amp;nbsp;I would prefer to use the ip command (see below) but my
&lt;br&gt;impression is that it is not as universally available as ifconfig.
&lt;br&gt;&lt;br&gt;As a default, at least for addresses out in the internet,
&lt;br&gt;I'd suggest using (if available)
&lt;br&gt;ip route |grep default
&lt;br&gt;which would tell you the default device
&lt;br&gt;in combination with
&lt;br&gt;ip addr 
&lt;br&gt;which would tell you its ip and mac address and
&lt;br&gt;ip nei
&lt;br&gt;which would tell you the destination mac address to use.
&lt;br&gt;There are probably equivalent ways of getting that info from /proc but
&lt;br&gt;I don't think those are any more universal.
&lt;br&gt;&lt;br&gt;Another approach to filling in the same info would be to read packets
&lt;br&gt;coming in from the internet, perhaps in response to a command that you
&lt;br&gt;execute. &amp;nbsp;For instance, if you do an os:resolve-host-ipaddr you can
&lt;br&gt;expect to see a dns reply which will tell you among other things
&lt;br&gt;- the ip address of the dns server
&lt;br&gt;- the interface used to reach it
&lt;br&gt;- the mac addresses you'd need to send packets out that interface
&lt;br&gt;- your ip address (the one to which the reply was sent)
&lt;br&gt;Of course, if you're unlucky, the interface you use to reach your
&lt;br&gt;dns server might not be capable of reaching the host you want to ping.
&lt;br&gt;On the other hand, with my solution your default interface might not
&lt;br&gt;be able to reach the host you want to ping either (which is why I said
&lt;br&gt;&amp;quot;out on the internet&amp;quot; above).
&lt;br&gt;&lt;br&gt;At this point we're ready to start filling in the IP header. &amp;nbsp;If
&lt;br&gt;you've looked at the rfc's you'll know there are gobs of choices
&lt;br&gt;there. &amp;nbsp;At least most of them don't require querying your environment.
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26599463&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26599463.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26599331</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-12-01T13:26:30Z</published>
	<updated>2009-12-01T13:26:30Z</updated>
	<author>
		<name>Fred Cohen-3</name>
	</author>
	<content type="html">On Dec 1, 2009, at 12:52 PM, Sam Steingold wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Fred Cohen wrote:
&lt;br&gt;&amp;gt;&amp;gt; On Dec 1, 2009, at 11:08 AM, Sam Steingold wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Fred Cohen wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; configdev sets of the IO device (network card - the &amp;quot;dev&amp;quot; &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; argument) &amp;nbsp;on
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;quot;configdev sets the IO device&amp;quot;?
&lt;br&gt;&amp;gt;&amp;gt; Yes - the interface being used to send and receive. (e.g., eth0, &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; etc.)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; could you please provide some code which uses this function?
&lt;/div&gt;&lt;br&gt;(IN-PACKAGE &amp;quot;RAWSOCK&amp;quot;)
&lt;br&gt;(setf socket (rawsock:socket :inet :RAW 0 #+ignore :all)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; device
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (rawsock:make-sockaddr :UNSPEC
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (make-array 14 :element-type '(unsigned-byte 8)))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; buffer
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (make-array 1518 :element-type '(unsigned-byte 8) :fill-pointer 1518)))
&lt;br&gt;(configdev socket &amp;quot;eth0&amp;quot; 1 1 ) &amp;nbsp;; eth0 no arp raw mode on socket
&lt;br&gt;(defun getraw ()
&lt;br&gt;&amp;nbsp; &amp;nbsp;(if (not (= -1 socket))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(setf (fill-pointer buffer) 1518
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;len #+ignore (rawsock::recvfr socket)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(rawsock:recvfrom socket buffer device)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(fill-pointer buffer) len)))
&lt;br&gt;(defun print-buffer () (loop for i below len do (format t &amp;quot;~2,'0X &amp;nbsp;
&lt;br&gt;&amp;quot; &amp;nbsp;(aref buffer i))))
&lt;br&gt;;; a rudimentary dump of all packets seen.
&lt;br&gt;(loop while true do ((getraw)(print-buffer)))
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; e.g.,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; (defparameter *sock* (rawsock:socket ???))
&lt;br&gt;&amp;gt; (rawsock:configdev *sock* &amp;quot;eth0&amp;quot; ...)
&lt;br&gt;&amp;gt; (rawsock:sock-read *sock* ...)
&lt;br&gt;&amp;gt; or whatever.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the identified raw socket (scocket argument) to promiscuous &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; mode &amp;nbsp; (accept all packets and pass them into the program) no ARP &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; mode &amp;nbsp;(the &amp;nbsp;interface does not automatically respond to ARP &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; requests, &amp;nbsp;and &amp;nbsp;configures its built-in address to 0.0.0.0 (which &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; is to say, &amp;nbsp;it has no &amp;nbsp;particular address).
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; actually, the code only does something when address is non 0.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; (and it only handles ipv4, not ipv6).
&lt;br&gt;&amp;gt;&amp;gt; Actually, it handles any raw bytes on an interface - the checksum &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; code &amp;nbsp;is for IPV4
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I mean the address argument is expected to be an int32.
&lt;br&gt;&amp;gt; Not even a string is accepted.
&lt;br&gt;&amp;gt; It would seem, btw, that the IP address argument should actually be &amp;nbsp;
&lt;br&gt;&amp;gt; a socket address, as returned by host-&amp;gt;ip in rawsock/test.tst.
&lt;/div&gt;&lt;br&gt;IPv4 addresses are 4 bytes (octets) long - an int32.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Normally, if you want a silent interface which &amp;nbsp;allows true &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; arbitrary behavior bases on what the program tells the &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; interface &amp;nbsp;to do, you want all of these to be the case. When you &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; are &amp;nbsp;done, &amp;nbsp;you may want to turn these things back to some &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; previous state &amp;nbsp; (i.e., the normal IP address, ARP responses per &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the configured ARP &amp;nbsp; address of the Ethernet card, and ignoring &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; non-broadcast packets &amp;nbsp;sent &amp;nbsp;to the interface, since this is the &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; normal behavior of an &amp;nbsp;ethernet &amp;nbsp;card and reduces system resource &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; consumption (if there &amp;nbsp;are no &amp;nbsp;promiscuous modes set by other &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; processes.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; so, we are not providing a way to restore the original behavior, &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; right?
&lt;br&gt;&amp;gt;&amp;gt; You do another configdev to set things to whatever you want them to &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; be &amp;nbsp;when you don't want &amp;quot;raw&amp;quot;. The row socket is not persistent or &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; in &amp;nbsp;effect past the process, so other processes may do as they &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; please and &amp;nbsp;handle other raw or non-raw interfaces - although &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; performance will be &amp;nbsp;hit because the interface is looking at &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; everything instead of ignoring &amp;nbsp;packets not broadcast or to its MAC &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; address / IP address. The OS keeps &amp;nbsp;a list of interfaces and the &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; processes that get each of them at what &amp;nbsp;phase in its processing. A &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; raw socket avoids the OS handling (except &amp;nbsp;for the low-level driver &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; code to move bytes via the DMA to and from &amp;nbsp;the hardware and &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; memory). The configdev code uses IOCTL to alter the &amp;nbsp;hardware &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; configuration and tell the OS to put you at an earlier place &amp;nbsp;in &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; the list of handlers.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; this should be fixed.
&lt;br&gt;&amp;gt;&amp;gt; Nothing to fix.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I thought you said that configdev modifies the behavior of both the &amp;nbsp;
&lt;br&gt;&amp;gt; socket and the device (e.g., eth0).
&lt;br&gt;&amp;gt; I can close the socket and open a new one, but how do I bring the &amp;nbsp;
&lt;br&gt;&amp;gt; device back to the original behavior?
&lt;/div&gt;&lt;br&gt;(defun close-sock ()
&lt;br&gt;&amp;nbsp; &amp;nbsp;(if (= (rawsock:sock-close #+ignore rawsock::closesock socket) -1)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(error &amp;quot;can't close socket&amp;quot;)))
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 2. checksum functions: what is their contract? (e.g., min/max &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; buffer &amp;nbsp;size? do they modify their argument? how?)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; where specifically are these checksums documented?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; how are these functions supposed to be used?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; IP datagrams are limited in total size by RFC791 (&lt;a href=&quot;http://www.ietf.org/rfc/rfc791.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ietf.org/rfc/rfc791.txt&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; looking at page 10, I see Figure 4. (Example Internet Datagram &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Header).
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; it says that the &amp;quot;Total Length&amp;quot; is in bytes 2 and 3 (0-based, &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; i.e., &amp;nbsp;bits 16-31)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; while &amp;quot;Header Checksum&amp;quot; is in bytes 10 and 11.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; code in ipcsum takes length not buffer[14] and writes the csum &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; into &amp;nbsp;bytes 25&amp;26.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I am confused.
&lt;br&gt;&amp;gt;&amp;gt; That's because the first 14 bytes of an Ethernet frame are &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; (normally) &amp;nbsp;for the MAC address. IP datagrams sit inside ethernet &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; frames (or other &amp;nbsp;frames depending on the particulars). rawsock &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; assumes an ethernet - &amp;nbsp;which is the most common situation. So &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; everything is offset from IP by &amp;nbsp;14 bytes. But ethernet frames are &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; also alterable by rawsock - so you &amp;nbsp;can operate many different &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; ethernet MAC addresses. Ethernet frames &amp;nbsp;include things like &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; manufacturer identification information and from &amp;nbsp;and to MAC &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; addresses (and broadcast addresses), which also have to get &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; changed around to send and receive, and have to get changed when &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; forwarding if the interfaces deal with other infrastructure &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; elements &amp;nbsp;(e.g., switches) that use MAC addresses for decision- 
&lt;br&gt;&amp;gt;&amp;gt; making.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I see, so &amp;quot;buffer&amp;quot; is not a &amp;quot;datagram&amp;quot; but a &amp;quot;frame&amp;quot;.
&lt;/div&gt;&lt;br&gt;Yes.
&lt;br&gt;&lt;br&gt;&amp;gt; what can clisp do with such a frame?
&lt;br&gt;&lt;br&gt;Anything you want - read it, write it, load from the ethernet &amp;nbsp;
&lt;br&gt;interface, send to the ethernet interface, alter when in your &amp;nbsp;
&lt;br&gt;possession.
&lt;br&gt;&lt;br&gt;&amp;gt; can you give a code sample?
&lt;br&gt;&lt;br&gt;(loop while true do ((getraw)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (setf (aref buffer 14) 5)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (sendt socket len)
&lt;br&gt;)		)
&lt;br&gt;&lt;br&gt;This will change the IP version number to 5 (if it was 4, it will &amp;nbsp;
&lt;br&gt;cause problems...) and send the frame out with the new bytes.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; It gets even worse because loopback (the lo interface) does not &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; have &amp;nbsp;ethernet frames (it's not on an ethernet) so for these cases &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; the code &amp;nbsp;has to be abused (you do the checksums than shift the &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; bytes to go from &amp;nbsp;ethernet to lo, and add your own MAC addresses &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; which have to be right &amp;nbsp;to lo datagrams to put then in ethernet &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; frames. rawsock does not do &amp;nbsp;this for you.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; the csum functions now take :start/:end arguments, so, I guess, you &amp;nbsp;
&lt;br&gt;&amp;gt; can format them for loopback too.
&lt;br&gt;&amp;gt; actually, I would love to see a piece of code for that.
&lt;/div&gt;&lt;br&gt;As I said, I haven't looked at this for a while - and haven't seen the &amp;nbsp;
&lt;br&gt;new versions. It's the same thing as before - just start at 0 instead &amp;nbsp;
&lt;br&gt;of 14 offset.
&lt;br&gt;&lt;br&gt;FC
&lt;br&gt;- This communication is confidential to the parties it is intended to &amp;nbsp;
&lt;br&gt;serve -
&lt;br&gt;Fred Cohen &amp; Associates &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tel/fax: 925-454-0171
&lt;br&gt;&lt;a href=&quot;http://all.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://all.net/&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;572 Leona Drive &amp;nbsp; &amp;nbsp;Livermore, CA 94550
&lt;br&gt;Join &lt;a href=&quot;http://tech.groups.yahoo.com/group/FCA-announce/join&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tech.groups.yahoo.com/group/FCA-announce/join&lt;/a&gt;&amp;nbsp;for our &amp;nbsp;
&lt;br&gt;mailing list
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26599331&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26599331.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26598876</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-12-01T12:52:25Z</published>
	<updated>2009-12-01T12:52:25Z</updated>
	<author>
		<name>Sam Steingold</name>
	</author>
	<content type="html">Fred Cohen wrote:
&lt;br&gt;&amp;gt; On Dec 1, 2009, at 11:08 AM, Sam Steingold wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Fred Cohen wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; configdev sets of the IO device (network card - the &amp;quot;dev&amp;quot; argument) &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; on
&lt;br&gt;&amp;gt;&amp;gt; &amp;quot;configdev sets the IO device&amp;quot;?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Yes - the interface being used to send and receive. (e.g., eth0, etc.)
&lt;br&gt;&lt;br&gt;could you please provide some code which uses this function?
&lt;br&gt;&lt;br&gt;e.g.,
&lt;br&gt;&lt;br&gt;(defparameter *sock* (rawsock:socket ???))
&lt;br&gt;(rawsock:configdev *sock* &amp;quot;eth0&amp;quot; ...)
&lt;br&gt;(rawsock:sock-read *sock* ...)
&lt;br&gt;or whatever.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; the identified raw socket (scocket argument) to promiscuous mode &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; (accept all packets and pass them into the program) no ARP mode &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; (the &amp;nbsp;interface does not automatically respond to ARP requests, &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; and &amp;nbsp;configures its built-in address to 0.0.0.0 (which is to say, &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; it has no &amp;nbsp;particular address).
&lt;br&gt;&amp;gt;&amp;gt; actually, the code only does something when address is non 0.
&lt;br&gt;&amp;gt;&amp;gt; (and it only handles ipv4, not ipv6).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Actually, it handles any raw bytes on an interface - the checksum code &amp;nbsp;
&lt;br&gt;&amp;gt; is for IPV4
&lt;/div&gt;&lt;br&gt;I mean the address argument is expected to be an int32.
&lt;br&gt;Not even a string is accepted.
&lt;br&gt;It would seem, btw, that the IP address argument should actually be a socket 
&lt;br&gt;address, as returned by host-&amp;gt;ip in rawsock/test.tst.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Normally, if you want a silent interface which &amp;nbsp;allows true &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; arbitrary behavior bases on what the program tells the &amp;nbsp;interface &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; to do, you want all of these to be the case. When you are &amp;nbsp;done, &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; you may want to turn these things back to some previous state &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; (i.e., the normal IP address, ARP responses per the configured ARP &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; address of the Ethernet card, and ignoring non-broadcast packets &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; sent &amp;nbsp;to the interface, since this is the normal behavior of an &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; ethernet &amp;nbsp;card and reduces system resource consumption (if there &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; are no &amp;nbsp;promiscuous modes set by other processes.
&lt;br&gt;&amp;gt;&amp;gt; so, we are not providing a way to restore the original behavior, &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; right?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; You do another configdev to set things to whatever you want them to be &amp;nbsp;
&lt;br&gt;&amp;gt; when you don't want &amp;quot;raw&amp;quot;. The row socket is not persistent or in &amp;nbsp;
&lt;br&gt;&amp;gt; effect past the process, so other processes may do as they please and &amp;nbsp;
&lt;br&gt;&amp;gt; handle other raw or non-raw interfaces - although performance will be &amp;nbsp;
&lt;br&gt;&amp;gt; hit because the interface is looking at everything instead of ignoring &amp;nbsp;
&lt;br&gt;&amp;gt; packets not broadcast or to its MAC address / IP address. The OS keeps &amp;nbsp;
&lt;br&gt;&amp;gt; a list of interfaces and the processes that get each of them at what &amp;nbsp;
&lt;br&gt;&amp;gt; phase in its processing. A raw socket avoids the OS handling (except &amp;nbsp;
&lt;br&gt;&amp;gt; for the low-level driver code to move bytes via the DMA to and from &amp;nbsp;
&lt;br&gt;&amp;gt; the hardware and memory). The configdev code uses IOCTL to alter the &amp;nbsp;
&lt;br&gt;&amp;gt; hardware configuration and tell the OS to put you at an earlier place &amp;nbsp;
&lt;br&gt;&amp;gt; in the list of handlers.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; this should be fixed.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Nothing to fix.
&lt;/div&gt;&lt;br&gt;I thought you said that configdev modifies the behavior of both the socket and 
&lt;br&gt;the device (e.g., eth0).
&lt;br&gt;I can close the socket and open a new one, but how do I bring the device back 
&lt;br&gt;to the original behavior?
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 2. checksum functions: what is their contract? (e.g., min/max &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; buffer &amp;nbsp;size? do they modify their argument? how?)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; where specifically are these checksums documented?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; how are these functions supposed to be used?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; IP datagrams are limited in total size by RFC791 (&lt;a href=&quot;http://www.ietf.org/rfc/rfc791.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ietf.org/rfc/rfc791.txt&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; looking at page 10, I see Figure 4. (Example Internet Datagram &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; Header).
&lt;br&gt;&amp;gt;&amp;gt; it says that the &amp;quot;Total Length&amp;quot; is in bytes 2 and 3 (0-based, i.e., &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; bits 16-31)
&lt;br&gt;&amp;gt;&amp;gt; while &amp;quot;Header Checksum&amp;quot; is in bytes 10 and 11.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; code in ipcsum takes length not buffer[14] and writes the csum into &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; bytes 25&amp;26.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I am confused.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; That's because the first 14 bytes of an Ethernet frame are (normally) &amp;nbsp;
&lt;br&gt;&amp;gt; for the MAC address. IP datagrams sit inside ethernet frames (or other &amp;nbsp;
&lt;br&gt;&amp;gt; frames depending on the particulars). rawsock assumes an ethernet - &amp;nbsp;
&lt;br&gt;&amp;gt; which is the most common situation. So everything is offset from IP by &amp;nbsp;
&lt;br&gt;&amp;gt; 14 bytes. But ethernet frames are also alterable by rawsock - so you &amp;nbsp;
&lt;br&gt;&amp;gt; can operate many different ethernet MAC addresses. Ethernet frames &amp;nbsp;
&lt;br&gt;&amp;gt; include things like manufacturer identification information and from &amp;nbsp;
&lt;br&gt;&amp;gt; and to MAC addresses (and broadcast addresses), which also have to get &amp;nbsp;
&lt;br&gt;&amp;gt; changed around to send and receive, and have to get changed when &amp;nbsp;
&lt;br&gt;&amp;gt; forwarding if the interfaces deal with other infrastructure elements &amp;nbsp;
&lt;br&gt;&amp;gt; (e.g., switches) that use MAC addresses for decision-making.
&lt;/div&gt;&lt;br&gt;I see, so &amp;quot;buffer&amp;quot; is not a &amp;quot;datagram&amp;quot; but a &amp;quot;frame&amp;quot;.
&lt;br&gt;what can clisp do with such a frame?
&lt;br&gt;can you give a code sample?
&lt;br&gt;&lt;br&gt;&amp;gt; It gets even worse because loopback (the lo interface) does not have &amp;nbsp;
&lt;br&gt;&amp;gt; ethernet frames (it's not on an ethernet) so for these cases the code &amp;nbsp;
&lt;br&gt;&amp;gt; has to be abused (you do the checksums than shift the bytes to go from &amp;nbsp;
&lt;br&gt;&amp;gt; ethernet to lo, and add your own MAC addresses which have to be right &amp;nbsp;
&lt;br&gt;&amp;gt; to lo datagrams to put then in ethernet frames. rawsock does not do &amp;nbsp;
&lt;br&gt;&amp;gt; this for you.
&lt;br&gt;&lt;br&gt;the csum functions now take :start/:end arguments, so, I guess, you can format 
&lt;br&gt;them for loopback too.
&lt;br&gt;actually, I would love to see a piece of code for that.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26598876&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26598876.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26598592</id>
	<title>Re: Doing everything with bytes =&gt; rawsock</title>
	<published>2009-12-01T12:31:57Z</published>
	<updated>2009-12-01T12:31:57Z</updated>
	<author>
		<name>Sam Steingold</name>
	</author>
	<content type="html">Don Cohen wrote:
&lt;br&gt;&amp;gt; Sam Steingold writes:
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; OS support is on a feature-by-feature basis.
&lt;br&gt;&amp;gt; Which features are supported by which os's and how does one in general
&lt;br&gt;&amp;gt; find out?
&lt;br&gt;&lt;br&gt;either read the sources, or compile and test.
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; tests serve two major goals:
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; 2. Demoing the functionality:
&lt;br&gt;&amp;gt; Of course some of this could be done in the doc.
&lt;br&gt;&lt;br&gt;yes, and I am all for that too.
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; If you do have root access and a typical network connection, you could
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; use raw sockets to implement things like ping or traceroute, or
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; tcpdump but testing these things relies on the behavior of other
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; machines.
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; ping does not require root.
&lt;br&gt;&amp;gt; Although ping does not require root, an implementation of ping using
&lt;br&gt;&amp;gt; rawsock WOULD require root, because you would be opening a raw socket.
&lt;br&gt;&lt;br&gt;I don't understand this, so I will take your word.
&lt;br&gt;of course, I would much prefer an implementation which would not require root 
&lt;br&gt;privileges.
&lt;br&gt;nobody in his right mind would ever run
&lt;br&gt;sudo demo
&lt;br&gt;&lt;br&gt;&amp;gt; - would require a lot of inputs describing things like what network
&lt;br&gt;&amp;gt; &amp;nbsp; interface to use, what IP address, etc. &amp;nbsp;Reasonable defaults for
&lt;br&gt;&amp;gt; &amp;nbsp; these things can generally be determined by various system calls
&lt;br&gt;&amp;gt; &amp;nbsp; or shell commands, but those are also system dependent, even more
&lt;br&gt;&amp;gt; &amp;nbsp; so than raw sockets themselves.
&lt;br&gt;&lt;br&gt;much can be already done, e.g.,
&lt;br&gt;&lt;br&gt;&amp;gt; - the first step would be finding the ip address for www.gnu.org
&lt;br&gt;&lt;br&gt;we already have os:resolve-host-ipaddr.
&lt;br&gt;actually, we have had it for 10.5 years, since 1999-03-10!
&lt;br&gt;&lt;br&gt;&amp;gt; Above only begins to hint at how low level this stuff is. &amp;nbsp;This is a
&lt;br&gt;&amp;gt; problem for demos because there are too many details for anyone to
&lt;br&gt;&amp;gt; want to control, but it's not clear which ones the user (demo viewer)
&lt;br&gt;&amp;gt; will want to control, and each one leads to its own issue of how to
&lt;br&gt;&amp;gt; even find out which options are available. &amp;nbsp;I could write something
&lt;br&gt;&amp;gt; that would work out of MY box, but when it fails on your box you'll
&lt;br&gt;&amp;gt; have to understand a lot in order to figure out why. 
&lt;br&gt;&lt;br&gt;this is no good, of course.
&lt;br&gt;can you write a simple general purpose application, like ping or traceroute?
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; In fact, ideally the tests would make use of a raw socket
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; interface on that other machine.
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;quot;ssh host clisp&amp;quot; is your friend.
&lt;br&gt;&amp;gt; So you're now suggesting that the test script require a parameter
&lt;br&gt;&amp;gt; of a partner host directly connected to this one to which you can 
&lt;br&gt;&amp;gt; ssh without a password and run clisp on it in a place where the
&lt;br&gt;&amp;gt; necessary code will already be installed?
&lt;br&gt;&amp;gt; This does not sound like a reasonable requirement for a test.
&lt;br&gt;&amp;gt; It might be for a demo, but not a demo that a normal person can
&lt;br&gt;&amp;gt; be expected to run on his own.
&lt;/div&gt;&lt;br&gt;how about a trivial ntp client instead then?
&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26598592&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26598592.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26597785</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-12-01T11:35:29Z</published>
	<updated>2009-12-01T11:35:29Z</updated>
	<author>
		<name>Don Cohen-12</name>
	</author>
	<content type="html">Sam Steingold writes:
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &amp;quot;configdev sets the IO device&amp;quot;?
&lt;br&gt;This is the sort of thing I'd normally expect to do with a shell
&lt;br&gt;command, or perhaps /proc. &amp;nbsp;And it can be reversed that way also.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; actually, the code only does something when address is non 0.
&lt;br&gt;&amp;nbsp;&amp;gt; (and it only handles ipv4, not ipv6).
&lt;br&gt;Similarly ipv6 addresses can be set by shell command.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; IP datagrams are limited in total size by RFC791 (&lt;a href=&quot;http://www.ietf.org/rfc/rfc791.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ietf.org/rfc/rfc791.txt&lt;/a&gt;&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; looking at page 10, I see Figure 4. (Example Internet Datagram Header).
&lt;br&gt;&amp;nbsp;&amp;gt; it says that the &amp;quot;Total Length&amp;quot; is in bytes 2 and 3 (0-based, i.e., bits 16-31)
&lt;br&gt;&amp;nbsp;&amp;gt; while &amp;quot;Header Checksum&amp;quot; is in bytes 10 and 11.
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; code in ipcsum takes length not buffer[14] and writes the csum into bytes 25&amp;26.
&lt;br&gt;looks to me like 24,25
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; I am confused.
&lt;br&gt;&lt;br&gt;The buffer starts with the ethernet header I mentioned in some
&lt;br&gt;previous message - 14 bytes.
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26597785&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26597785.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26597590</id>
	<title>Re: Doing everything with bytes =&gt; rawsock</title>
	<published>2009-12-01T11:24:34Z</published>
	<updated>2009-12-01T11:24:34Z</updated>
	<author>
		<name>Don Cohen-12</name>
	</author>
	<content type="html">Sam Steingold writes:
&lt;br&gt;&amp;nbsp;&amp;gt; OS support is on a feature-by-feature basis.
&lt;br&gt;Which features are supported by which os's and how does one in general
&lt;br&gt;find out?
&lt;br&gt;&amp;nbsp;&amp;gt; tests serve two major goals:
&lt;br&gt;&amp;nbsp;&amp;gt; 2. Demoing the functionality:
&lt;br&gt;Of course some of this could be done in the doc.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; If you do have root access and a typical network connection, you could
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; use raw sockets to implement things like ping or traceroute, or
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; tcpdump but testing these things relies on the behavior of other
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; machines.
&lt;br&gt;&amp;nbsp;&amp;gt; ping does not require root.
&lt;br&gt;Although ping does not require root, an implementation of ping using
&lt;br&gt;rawsock WOULD require root, because you would be opening a raw socket.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; if you can write a bare-bones ping/tcpdump/traceroute, I would love
&lt;br&gt;&amp;nbsp;&amp;gt; to add them to rawsock/demos/, similar to new-clx/demos/.
&lt;br&gt;&amp;nbsp;&amp;gt; e.g., can you make it possible to do
&lt;br&gt;&amp;nbsp;&amp;gt; $ clisp -i rawsock/demos/ping -x '(ping:ping &amp;quot;www.gnu.org&amp;quot;)'
&lt;br&gt;Yes, it would be pretty straight forward but
&lt;br&gt;- would require root
&lt;br&gt;- would require a lot of inputs describing things like what network
&lt;br&gt;&amp;nbsp; interface to use, what IP address, etc. &amp;nbsp;Reasonable defaults for
&lt;br&gt;&amp;nbsp; these things can generally be determined by various system calls
&lt;br&gt;&amp;nbsp; or shell commands, but those are also system dependent, even more
&lt;br&gt;&amp;nbsp; so than raw sockets themselves.
&lt;br&gt;- the first step would be finding the ip address for www.gnu.org
&lt;br&gt;&amp;nbsp; (unless you're willing to enter the ip address instead)
&lt;br&gt;&amp;nbsp; This is yet another thing that could be done with raw sockets
&lt;br&gt;&amp;nbsp; (dns client), but again requires a lot of system dependent things,
&lt;br&gt;&amp;nbsp; such as what dns server to use -- or where to find out
&lt;br&gt;&lt;br&gt;I suppose the most straight forward and portable way to find the
&lt;br&gt;ip address of www.gnu.org would be to create a tcp socket to it and
&lt;br&gt;read the address from that -- but of course a real ping would be
&lt;br&gt;pretty useless if it required first creating a tcp connection to the
&lt;br&gt;target.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; okay, so the code will not be automatically run.
&lt;br&gt;&amp;nbsp;&amp;gt; it is still very valuable, both as a test (ran by hand) and as a demo.
&lt;br&gt;&lt;br&gt;Above only begins to hint at how low level this stuff is. &amp;nbsp;This is a
&lt;br&gt;problem for demos because there are too many details for anyone to
&lt;br&gt;want to control, but it's not clear which ones the user (demo viewer)
&lt;br&gt;will want to control, and each one leads to its own issue of how to
&lt;br&gt;even find out which options are available. &amp;nbsp;I could write something
&lt;br&gt;that would work out of MY box, but when it fails on your box you'll
&lt;br&gt;have to understand a lot in order to figure out why. 
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; In fact, ideally the tests would make use of a raw socket
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; interface on that other machine.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;quot;ssh host clisp&amp;quot; is your friend.
&lt;br&gt;So you're now suggesting that the test script require a parameter
&lt;br&gt;of a partner host directly connected to this one to which you can 
&lt;br&gt;ssh without a password and run clisp on it in a place where the
&lt;br&gt;necessary code will already be installed?
&lt;br&gt;This does not sound like a reasonable requirement for a test.
&lt;br&gt;It might be for a demo, but not a demo that a normal person can
&lt;br&gt;be expected to run on his own.
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26597590&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26597590.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26597604</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-12-01T11:24:32Z</published>
	<updated>2009-12-01T11:24:32Z</updated>
	<author>
		<name>Fred Cohen-3</name>
	</author>
	<content type="html">&lt;br&gt;On Dec 1, 2009, at 11:08 AM, Sam Steingold wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; Fred Cohen wrote:
&lt;br&gt;&amp;gt;&amp;gt; configdev sets of the IO device (network card - the &amp;quot;dev&amp;quot; argument) &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; on
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;quot;configdev sets the IO device&amp;quot;?
&lt;br&gt;&lt;br&gt;Yes - the interface being used to send and receive. (e.g., eth0, etc.)
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; the identified raw socket (scocket argument) to promiscuous mode &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; (accept all packets and pass them into the program) no ARP mode &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; (the &amp;nbsp;interface does not automatically respond to ARP requests, &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; and &amp;nbsp;configures its built-in address to 0.0.0.0 (which is to say, &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; it has no &amp;nbsp;particular address).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; actually, the code only does something when address is non 0.
&lt;br&gt;&amp;gt; (and it only handles ipv4, not ipv6).
&lt;br&gt;&lt;br&gt;Actually, it handles any raw bytes on an interface - the checksum code &amp;nbsp;
&lt;br&gt;is for IPV4
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; Normally, if you want a silent interface which &amp;nbsp;allows true &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; arbitrary behavior bases on what the program tells the &amp;nbsp;interface &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; to do, you want all of these to be the case. When you are &amp;nbsp;done, &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; you may want to turn these things back to some previous state &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; (i.e., the normal IP address, ARP responses per the configured ARP &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; address of the Ethernet card, and ignoring non-broadcast packets &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; sent &amp;nbsp;to the interface, since this is the normal behavior of an &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; ethernet &amp;nbsp;card and reduces system resource consumption (if there &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; are no &amp;nbsp;promiscuous modes set by other processes.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; so, we are not providing a way to restore the original behavior, &amp;nbsp;
&lt;br&gt;&amp;gt; right?
&lt;/div&gt;&lt;br&gt;You do another configdev to set things to whatever you want them to be &amp;nbsp;
&lt;br&gt;when you don't want &amp;quot;raw&amp;quot;. The row socket is not persistent or in &amp;nbsp;
&lt;br&gt;effect past the process, so other processes may do as they please and &amp;nbsp;
&lt;br&gt;handle other raw or non-raw interfaces - although performance will be &amp;nbsp;
&lt;br&gt;hit because the interface is looking at everything instead of ignoring &amp;nbsp;
&lt;br&gt;packets not broadcast or to its MAC address / IP address. The OS keeps &amp;nbsp;
&lt;br&gt;a list of interfaces and the processes that get each of them at what &amp;nbsp;
&lt;br&gt;phase in its processing. A raw socket avoids the OS handling (except &amp;nbsp;
&lt;br&gt;for the low-level driver code to move bytes via the DMA to and from &amp;nbsp;
&lt;br&gt;the hardware and memory). The configdev code uses IOCTL to alter the &amp;nbsp;
&lt;br&gt;hardware configuration and tell the OS to put you at an earlier place &amp;nbsp;
&lt;br&gt;in the list of handlers.
&lt;br&gt;&lt;br&gt;&amp;gt; this should be fixed.
&lt;br&gt;&lt;br&gt;Nothing to fix.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; 2. checksum functions: what is their contract? (e.g., min/max &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; buffer &amp;nbsp;size? do they modify their argument? how?)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; where specifically are these checksums documented?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; how are these functions supposed to be used?
&lt;br&gt;&amp;gt;&amp;gt; IP datagrams are limited in total size by RFC791 (&lt;a href=&quot;http://www.ietf.org/rfc/rfc791.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ietf.org/rfc/rfc791.txt&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; looking at page 10, I see Figure 4. (Example Internet Datagram &amp;nbsp;
&lt;br&gt;&amp;gt; Header).
&lt;br&gt;&amp;gt; it says that the &amp;quot;Total Length&amp;quot; is in bytes 2 and 3 (0-based, i.e., &amp;nbsp;
&lt;br&gt;&amp;gt; bits 16-31)
&lt;br&gt;&amp;gt; while &amp;quot;Header Checksum&amp;quot; is in bytes 10 and 11.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; code in ipcsum takes length not buffer[14] and writes the csum into &amp;nbsp;
&lt;br&gt;&amp;gt; bytes 25&amp;26.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I am confused.
&lt;/div&gt;&lt;br&gt;That's because the first 14 bytes of an Ethernet frame are (normally) &amp;nbsp;
&lt;br&gt;for the MAC address. IP datagrams sit inside ethernet frames (or other &amp;nbsp;
&lt;br&gt;frames depending on the particulars). rawsock assumes an ethernet - &amp;nbsp;
&lt;br&gt;which is the most common situation. So everything is offset from IP by &amp;nbsp;
&lt;br&gt;14 bytes. But ethernet frames are also alterable by rawsock - so you &amp;nbsp;
&lt;br&gt;can operate many different ethernet MAC addresses. Ethernet frames &amp;nbsp;
&lt;br&gt;include things like manufacturer identification information and from &amp;nbsp;
&lt;br&gt;and to MAC addresses (and broadcast addresses), which also have to get &amp;nbsp;
&lt;br&gt;changed around to send and receive, and have to get changed when &amp;nbsp;
&lt;br&gt;forwarding if the interfaces deal with other infrastructure elements &amp;nbsp;
&lt;br&gt;(e.g., switches) that use MAC addresses for decision-making.
&lt;br&gt;&lt;br&gt;It gets even worse because loopback (the lo interface) does not have &amp;nbsp;
&lt;br&gt;ethernet frames (it's not on an ethernet) so for these cases the code &amp;nbsp;
&lt;br&gt;has to be abused (you do the checksums than shift the bytes to go from &amp;nbsp;
&lt;br&gt;ethernet to lo, and add your own MAC addresses which have to be right &amp;nbsp;
&lt;br&gt;to lo datagrams to put then in ethernet frames. rawsock does not do &amp;nbsp;
&lt;br&gt;this for you.
&lt;br&gt;&lt;br&gt;I hope that helps - but it may merely confuse...
&lt;br&gt;&lt;br&gt;FC
&lt;br&gt;- This communication is confidential to the parties it is intended to &amp;nbsp;
&lt;br&gt;serve -
&lt;br&gt;Fred Cohen &amp; Associates &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tel/fax: 925-454-0171
&lt;br&gt;&lt;a href=&quot;http://all.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://all.net/&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;572 Leona Drive &amp;nbsp; &amp;nbsp;Livermore, CA 94550
&lt;br&gt;Join &lt;a href=&quot;http://tech.groups.yahoo.com/group/FCA-announce/join&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tech.groups.yahoo.com/group/FCA-announce/join&lt;/a&gt;&amp;nbsp;for our &amp;nbsp;
&lt;br&gt;mailing list
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26597604&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26597604.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26597330</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-12-01T11:08:53Z</published>
	<updated>2009-12-01T11:08:53Z</updated>
	<author>
		<name>Sam Steingold</name>
	</author>
	<content type="html">Fred Cohen wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; configdev sets of the IO device (network card - the &amp;quot;dev&amp;quot; argument) on &amp;nbsp;
&lt;br&gt;&lt;br&gt;&amp;quot;configdev sets the IO device&amp;quot;?
&lt;br&gt;&lt;br&gt;&amp;gt; the identified raw socket (scocket argument) to promiscuous mode &amp;nbsp;
&lt;br&gt;&amp;gt; (accept all packets and pass them into the program) no ARP mode (the &amp;nbsp;
&lt;br&gt;&amp;gt; interface does not automatically respond to ARP requests, and &amp;nbsp;
&lt;br&gt;&amp;gt; configures its built-in address to 0.0.0.0 (which is to say, it has no &amp;nbsp;
&lt;br&gt;&amp;gt; particular address). 
&lt;br&gt;&lt;br&gt;actually, the code only does something when address is non 0.
&lt;br&gt;(and it only handles ipv4, not ipv6).
&lt;br&gt;&lt;br&gt;&amp;gt; Normally, if you want a silent interface which &amp;nbsp;
&lt;br&gt;&amp;gt; allows true arbitrary behavior bases on what the program tells the &amp;nbsp;
&lt;br&gt;&amp;gt; interface to do, you want all of these to be the case. When you are &amp;nbsp;
&lt;br&gt;&amp;gt; done, you may want to turn these things back to some previous state &amp;nbsp;
&lt;br&gt;&amp;gt; (i.e., the normal IP address, ARP responses per the configured ARP &amp;nbsp;
&lt;br&gt;&amp;gt; address of the Ethernet card, and ignoring non-broadcast packets sent &amp;nbsp;
&lt;br&gt;&amp;gt; to the interface, since this is the normal behavior of an ethernet &amp;nbsp;
&lt;br&gt;&amp;gt; card and reduces system resource consumption (if there are no &amp;nbsp;
&lt;br&gt;&amp;gt; promiscuous modes set by other processes.
&lt;br&gt;&lt;br&gt;so, we are not providing a way to restore the original behavior, right?
&lt;br&gt;this should be fixed.
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; 2. checksum functions: what is their contract? (e.g., min/max buffer &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; size? do they modify their argument? how?)
&lt;br&gt;&amp;gt;&amp;gt; where specifically are these checksums documented?
&lt;br&gt;&amp;gt;&amp;gt; how are these functions supposed to be used?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; IP datagrams are limited in total size by RFC791 (&lt;a href=&quot;http://www.ietf.org/rfc/rfc791.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ietf.org/rfc/rfc791.txt&lt;/a&gt;&lt;br&gt;&lt;br&gt;looking at page 10, I see Figure 4. (Example Internet Datagram Header).
&lt;br&gt;it says that the &amp;quot;Total Length&amp;quot; is in bytes 2 and 3 (0-based, i.e., bits 16-31)
&lt;br&gt;while &amp;quot;Header Checksum&amp;quot; is in bytes 10 and 11.
&lt;br&gt;&lt;br&gt;code in ipcsum takes length not buffer[14] and writes the csum into bytes 25&amp;26.
&lt;br&gt;&lt;br&gt;I am confused.
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26597330&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26597330.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26596820</id>
	<title>Re: Doing everything with bytes =&gt; rawsock</title>
	<published>2009-12-01T10:34:09Z</published>
	<updated>2009-12-01T10:34:09Z</updated>
	<author>
		<name>Fred Cohen-3</name>
	</author>
	<content type="html">On Dec 1, 2009, at 10:18 AM, Sam Steingold wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; Don Cohen wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; It's not clear to me what sort of tests would be appropriate.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; e.g., a piece of code which creates a packet, sets the checksums, &amp;nbsp;
&lt;br&gt;&amp;gt; sends it to a
&lt;br&gt;&amp;gt; socket (created, e.g., using socketpair) &amp;c.
&lt;br&gt;&lt;br&gt;The problem is that you cannot send to yourself because the physical &amp;nbsp;
&lt;br&gt;interface that places the bits on the wire does not see them coming &amp;nbsp;
&lt;br&gt;back in. You need a server to do a test.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; First what OS's are supported?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; OS support is on a feature-by-feature basis.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; tests serve two major goals:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 1. Testing the functionality. This is not easy to separate from the &amp;nbsp;
&lt;br&gt;&amp;gt; system
&lt;br&gt;&amp;gt; configuration problems (as you point out yourself), including &amp;nbsp;
&lt;br&gt;&amp;gt; portability,
&lt;br&gt;&amp;gt; permissions network availability &amp;c.
&lt;/div&gt;&lt;br&gt;The functionality is, unfortunately, too general to do a complete test &amp;nbsp;
&lt;br&gt;- or even close to it.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 2. Demoing the functionality:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; If you do have root access and a typical network connection, you &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; could
&lt;br&gt;&amp;gt;&amp;gt; use raw sockets to implement things like ping or traceroute, or
&lt;br&gt;&amp;gt;&amp;gt; tcpdump but testing these things relies on the behavior of other
&lt;br&gt;&amp;gt;&amp;gt; machines.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ping does not require root.
&lt;br&gt;&amp;gt; if you can write a bare-bones ping/tcpdump/traceroute, I would love &amp;nbsp;
&lt;br&gt;&amp;gt; to add them
&lt;br&gt;&amp;gt; to rawsock/demos/, similar to new-clx/demos/.
&lt;br&gt;&amp;gt; e.g., can you make it possible to do
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; $ clisp -i rawsock/demos/ping -x '(ping:ping &amp;quot;www.gnu.org&amp;quot;)'
&lt;/div&gt;&lt;br&gt;Ping is easy enough, but rawsock lets you do far more and more complex &amp;nbsp;
&lt;br&gt;things. If you want to configure an infrastructure server to support &amp;nbsp;
&lt;br&gt;such tests, we can do it, but be warned, you are unlikely to want what &amp;nbsp;
&lt;br&gt;you are likely to get as a result.
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; Ideally a test would involve another machine directly
&lt;br&gt;&amp;gt;&amp;gt; connected to the one being tested, where that machine is controlled &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; by
&lt;br&gt;&amp;gt;&amp;gt; the test and, of course, is known (or at least assumed) to be working
&lt;br&gt;&amp;gt;&amp;gt; correctly.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; okay, so the code will not be automatically run.
&lt;br&gt;&amp;gt; it is still very valuable, both as a test (ran by hand) and as a demo.
&lt;br&gt;&lt;br&gt;I have a variety of tests that I run - but they are part of &amp;nbsp;
&lt;br&gt;proprietary software I provide (also patents apply to parts of the &amp;nbsp;
&lt;br&gt;functionality). The simple thing to do is simply reverse the sending &amp;nbsp;
&lt;br&gt;and receiving IP addresses, checksum the result, and send it back out &amp;nbsp;
&lt;br&gt;the port it came in on. The result will be that whatever they send to &amp;nbsp;
&lt;br&gt;you, you send back. You can then set up 2 processes - one sending &amp;nbsp;
&lt;br&gt;arbitrary content (subject to the proper header format for &amp;nbsp;
&lt;br&gt;transmission across infrastructure), and the other checking the &amp;nbsp;
&lt;br&gt;returns. While mirroring of this sort is patented, I can give you a &amp;nbsp;
&lt;br&gt;free license...
&lt;br&gt;&lt;br&gt;The best approach for a normal user would be to setup a second &amp;nbsp;
&lt;br&gt;machine, both running rawsoc, and send and verify arbitrary byte &amp;nbsp;
&lt;br&gt;sequences pushed out the interface (put them on a LAN by themselves, &amp;nbsp;
&lt;br&gt;generate random sequences, and verify them at the other side. Or you &amp;nbsp;
&lt;br&gt;can do it with one machine that has 2 interfaces... That's what I do.
&lt;br&gt;&lt;br&gt;FC
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; In fact, ideally the tests would make use of a raw socket
&lt;br&gt;&amp;gt;&amp;gt; interface on that other machine.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;quot;ssh host clisp&amp;quot; is your friend.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; ------------------------------------------------------------------------------
&lt;br&gt;&amp;gt; Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;&amp;gt; a free event focused on virtualization and cloud computing.
&lt;br&gt;&amp;gt; Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; clisp-list mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26596820&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;- This communication is confidential to the parties it is intended to &amp;nbsp;
&lt;br&gt;serve -
&lt;br&gt;Fred Cohen &amp; Associates &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tel/fax: 925-454-0171
&lt;br&gt;&lt;a href=&quot;http://all.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://all.net/&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;572 Leona Drive &amp;nbsp; &amp;nbsp;Livermore, CA 94550
&lt;br&gt;Join &lt;a href=&quot;http://tech.groups.yahoo.com/group/FCA-announce/join&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tech.groups.yahoo.com/group/FCA-announce/join&lt;/a&gt;&amp;nbsp;for our &amp;nbsp;
&lt;br&gt;mailing list
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26596820&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26596820.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26596580</id>
	<title>Re: Doing everything with bytes =&gt; rawsock</title>
	<published>2009-12-01T10:18:22Z</published>
	<updated>2009-12-01T10:18:22Z</updated>
	<author>
		<name>Sam Steingold</name>
	</author>
	<content type="html">Don Cohen wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; It's not clear to me what sort of tests would be appropriate.
&lt;br&gt;&lt;br&gt;e.g., a piece of code which creates a packet, sets the checksums, sends it to a 
&lt;br&gt;socket (created, e.g., using socketpair) &amp;c.
&lt;br&gt;&lt;br&gt;&amp;gt; First what OS's are supported?
&lt;br&gt;&lt;br&gt;OS support is on a feature-by-feature basis.
&lt;br&gt;&lt;br&gt;tests serve two major goals:
&lt;br&gt;&lt;br&gt;1. Testing the functionality. This is not easy to separate from the system 
&lt;br&gt;configuration problems (as you point out yourself), including portability, 
&lt;br&gt;permissions network availability &amp;c.
&lt;br&gt;&lt;br&gt;2. Demoing the functionality:
&lt;br&gt;&lt;br&gt;&amp;gt; If you do have root access and a typical network connection, you could
&lt;br&gt;&amp;gt; use raw sockets to implement things like ping or traceroute, or
&lt;br&gt;&amp;gt; tcpdump but testing these things relies on the behavior of other
&lt;br&gt;&amp;gt; machines.
&lt;br&gt;&lt;br&gt;ping does not require root.
&lt;br&gt;if you can write a bare-bones ping/tcpdump/traceroute, I would love to add them 
&lt;br&gt;to rawsock/demos/, similar to new-clx/demos/.
&lt;br&gt;e.g., can you make it possible to do
&lt;br&gt;&lt;br&gt;$ clisp -i rawsock/demos/ping -x '(ping:ping &amp;quot;www.gnu.org&amp;quot;)'
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp;Ideally a test would involve another machine directly
&lt;br&gt;&amp;gt; connected to the one being tested, where that machine is controlled by
&lt;br&gt;&amp;gt; the test and, of course, is known (or at least assumed) to be working
&lt;br&gt;&amp;gt; correctly. 
&lt;br&gt;&lt;br&gt;okay, so the code will not be automatically run.
&lt;br&gt;it is still very valuable, both as a test (ran by hand) and as a demo.
&lt;br&gt;&lt;br&gt;&amp;gt; In fact, ideally the tests would make use of a raw socket
&lt;br&gt;&amp;gt; interface on that other machine.
&lt;br&gt;&lt;br&gt;&amp;quot;ssh host clisp&amp;quot; is your friend.
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26596580&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26596580.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26596132</id>
	<title>Re: Doing everything with bytes =&gt; rawsock</title>
	<published>2009-12-01T09:54:21Z</published>
	<updated>2009-12-01T09:54:21Z</updated>
	<author>
		<name>Don Cohen-12</name>
	</author>
	<content type="html">Sam Steingold writes:
&lt;br&gt;&amp;nbsp;&amp;gt; great!
&lt;br&gt;&amp;nbsp;&amp;gt; the final touch:
&lt;br&gt;&amp;nbsp;&amp;gt; can you provide a few test cases for clisp/modules/rawsock/test.tst?
&lt;br&gt;&lt;br&gt;It's not clear to me what sort of tests would be appropriate. &amp;nbsp;Other
&lt;br&gt;tests seems to be intended to indicate either that everything is
&lt;br&gt;working or that some particular things are not. &amp;nbsp;In this case the
&lt;br&gt;tests are likely to be partial for several reasons. &amp;nbsp;So perhaps the
&lt;br&gt;notion of a test should be generalized to return another category of
&lt;br&gt;result, a set of things that could not be tested in the current
&lt;br&gt;environment. &amp;nbsp;It occurs to me that the same issues apply also to tcp
&lt;br&gt;sockets, though to a lesser extent.
&lt;br&gt;&lt;br&gt;First what OS's are supported? &amp;nbsp;I expected to see the rawsock section
&lt;br&gt;of impnotes in the platform dependent section. &amp;nbsp;It seems at least as
&lt;br&gt;platform dependent as tcp sockets. &amp;nbsp;I knew it worked in linux and
&lt;br&gt;thought it might work on some other unix versions. &amp;nbsp;I seem to recall
&lt;br&gt;attempts to make it work on mac. &amp;nbsp;I have no idea about windows.
&lt;br&gt;&lt;br&gt;I assume the tests should be run only on supported platforms.
&lt;br&gt;Is that already the case for rawsock? &amp;nbsp;How about tcp sockets?
&lt;br&gt;&lt;br&gt;Second, even on a supported OS you might or might not have the
&lt;br&gt;required OS facilities installed, so tests should be further
&lt;br&gt;conditioned on that. &amp;nbsp;Perhaps you're not too concerned with custom OS
&lt;br&gt;builds, but even without that there are lots of versions and lots of
&lt;br&gt;run time configuration options. &amp;nbsp;Maybe you're happy to view as test
&lt;br&gt;failures whatever problems arise when the environment is missing
&lt;br&gt;facilities used by the test.
&lt;br&gt;&lt;br&gt;Third you might not be connected to a network.
&lt;br&gt;&lt;br&gt;Looking at the current test file I see a lot of #+unix, a fair amount 
&lt;br&gt;of localhost (which seems a good idea since that interface seems more 
&lt;br&gt;likely than any other to be available), also some comments about root
&lt;br&gt;only. &amp;nbsp;That's another big problem. &amp;nbsp;Raw socket access is generally
&lt;br&gt;available only to root. &amp;nbsp;Even in tcp sockets I think it's common to
&lt;br&gt;restrict listeners on low numbered sockets to root.
&lt;br&gt;&lt;br&gt;If you do have root access and a typical network connection, you could
&lt;br&gt;use raw sockets to implement things like ping or traceroute, or
&lt;br&gt;tcpdump but testing these things relies on the behavior of other
&lt;br&gt;machines. &amp;nbsp;Ideally a test would involve another machine directly
&lt;br&gt;connected to the one being tested, where that machine is controlled by
&lt;br&gt;the test and, of course, is known (or at least assumed) to be working
&lt;br&gt;correctly. &amp;nbsp;In fact, ideally the tests would make use of a raw socket
&lt;br&gt;interface on that other machine.
&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26596132&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26596132.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26592966</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-12-01T06:42:51Z</published>
	<updated>2009-12-01T06:42:51Z</updated>
	<author>
		<name>Sam Steingold</name>
	</author>
	<content type="html">great!
&lt;br&gt;the final touch:
&lt;br&gt;can you provide a few test cases for clisp/modules/rawsock/test.tst?
&lt;br&gt;thanks
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26592966&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26592966.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26584672</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-11-30T16:29:32Z</published>
	<updated>2009-11-30T16:29:32Z</updated>
	<author>
		<name>Don Cohen-12</name>
	</author>
	<content type="html">Sam Steingold writes:
&lt;br&gt;&amp;nbsp;&amp;gt; Don Cohen wrote:
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; ip checksum in rfc 791
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; The checksum field is the 16 bit one's complement of the one's
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; complement sum of all 16 bit words in the header. &amp;nbsp;For purposes of
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; computing the checksum, the value of the checksum field is zero.
&lt;br&gt;bytes 10,11 (starting from zero) of IP header, which can be anywhere
&lt;br&gt;from 20 to 60 bytes long (IHL is second half of byte 0 and is in 4
&lt;br&gt;byte units)
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; udp checksum in rfc 768
&lt;br&gt;bytes 7,8 of udp header which comes right after IP header
&lt;br&gt;&amp;nbsp;Checksum is the 16-bit one's complement of the one's complement sum of a
&lt;br&gt;&amp;nbsp;pseudo header of information from the IP header, the UDP header, and the
&lt;br&gt;&amp;nbsp;data, &amp;nbsp;padded &amp;nbsp;with zero octets &amp;nbsp;at the end (if &amp;nbsp;necessary) &amp;nbsp;to &amp;nbsp;make a
&lt;br&gt;&amp;nbsp;multiple of two octets.
&lt;br&gt;&lt;br&gt;&amp;nbsp;The pseudo &amp;nbsp;header &amp;nbsp;conceptually prefixed to the UDP header contains the
&lt;br&gt;&amp;nbsp;source &amp;nbsp;address, &amp;nbsp;the destination &amp;nbsp;address, &amp;nbsp;the protocol, &amp;nbsp;and the UDP
&lt;br&gt;&amp;nbsp;length. &amp;nbsp; This information gives protection against misrouted datagrams.
&lt;br&gt;&amp;nbsp;This checksum procedure is the same as is used in TCP.
&lt;br&gt;&lt;br&gt;so approximately the entire packet, which could in theory be up to
&lt;br&gt;2^16-1 bytes, but is typically 1500.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; tcp in rfc 793
&lt;br&gt;same as udp but the tcp header is much longer, and this is bytes 16,17
&lt;br&gt;of that header.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; icmp in rfc 792
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; The checksum is the 16-bit ones's complement of the one's
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; complement sum of the ICMP message starting with the ICMP Type.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; For computing the checksum , the checksum field should be zero.
&lt;br&gt;bytes 2,3 of icmp header
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; 3. DIUC that every UDP, ICMP &amp; TCP packet is also an IP packet?
&lt;br&gt;&amp;nbsp;&amp;gt; what other inclusions hold?
&lt;br&gt;No packet is more than one of udp,icmp,tcp.
&lt;br&gt;There are non-IP packets and also IP packets other than udp,tcp,icmp.
&lt;br&gt;The &amp;quot;protocol&amp;quot; in byte 9 of an IP packet distinguishes among udp (17 I
&lt;br&gt;think), tcp(6), icmp (1 I think) and other values. &amp;nbsp;The fact that a
&lt;br&gt;packet is IP is encoded in the header before the ip header, I think
&lt;br&gt;it's 0800 - bytes 12,13 in the ethernet header. &amp;nbsp;I don't recall the
&lt;br&gt;rfc for that one. &amp;nbsp;I guess if you use something other than ethernet
&lt;br&gt;it's likely to be somewhere else. 
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; for each inclusion, specify the correct order in which the checksum
&lt;br&gt;&amp;nbsp;&amp;gt; functions must be called.
&lt;br&gt;I believe that for udp,tcp,icmp packets either order is ok (ip sum
&lt;br&gt;either before or after).
&lt;br&gt;Of course, ipsum should only be used on ip packets, udpsum on udp
&lt;br&gt;packets, etc.
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26584672&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26584672.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26584295</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-11-30T15:55:19Z</published>
	<updated>2009-11-30T15:55:19Z</updated>
	<author>
		<name>Sam Steingold</name>
	</author>
	<content type="html">Don Cohen wrote:
&lt;br&gt;&amp;gt; ip checksum in rfc 791
&lt;br&gt;&amp;gt; udp checksum in rfc 768
&lt;br&gt;&amp;gt; icmp in rfc 792
&lt;br&gt;&amp;gt; tcp in rfc 793
&lt;br&gt;&lt;br&gt;how about some very basic stuff (I am sure I can fish it from the RFCs, but I 
&lt;br&gt;would rather be spoon-fed here).
&lt;br&gt;&lt;br&gt;1. how many bytes do these functions look at. just give me an int.
&lt;br&gt;2. where in the buffer do they write the checksums.
&lt;br&gt;please answer these questions using RFCs only, not the source code.
&lt;br&gt;&lt;br&gt;3. DIUC that every UDP, ICMP &amp; TCP packet is also an IP packet?
&lt;br&gt;what other inclusions hold?
&lt;br&gt;for each inclusion, specify the correct order in which the checksum functions 
&lt;br&gt;must be called.
&lt;br&gt;&lt;br&gt;thanks for your replies, they are actually much much more helpful than I ever 
&lt;br&gt;hoped for.
&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26584295&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26584295.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26584202</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-11-30T15:45:19Z</published>
	<updated>2009-11-30T15:45:19Z</updated>
	<author>
		<name>Don Cohen-12</name>
	</author>
	<content type="html">Fred Cohen writes:
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp;In particular, you always want to &amp;nbsp;
&lt;br&gt;&amp;nbsp;&amp;gt; do the IPsum after the UDP, ICMP, or TCP checksum so that the IP &amp;nbsp;
&lt;br&gt;&amp;nbsp;&amp;gt; checksum properly checksums the result of the inner checksum &amp;nbsp;
&lt;br&gt;&amp;nbsp;&amp;gt; appropriate to the inner datagram protocol.
&lt;br&gt;&lt;br&gt;I don't think the order matters.
&lt;br&gt;IP csum only covers the IP header.
&lt;br&gt;TCP/UDP csum does not include the IP header - does include some of its
&lt;br&gt;data but not the ip csum.
&lt;br&gt;ICMP csum does not include anything in IP header.
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26584202&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26584202.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26584001</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-11-30T15:24:42Z</published>
	<updated>2009-11-30T15:24:42Z</updated>
	<author>
		<name>Fred Cohen-3</name>
	</author>
	<content type="html">On Nov 30, 2009, at 2:25 PM, Sam Steingold wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Fred Cohen wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; ...also, some of your old code could use more comments.
&lt;br&gt;&amp;gt;&amp;gt; I'm not big fan of comments - especially for something that short. &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; If &amp;nbsp;you look at the relevant RFCs, there's very little to it. All &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; it &amp;nbsp;really does is pull in the bytes from the interface, push out &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; bytes to &amp;nbsp;the interface, and perform checksums of various sorts per &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; the &amp;nbsp;definitions in the protocols. The rest of my code is in lisp &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; (and not &amp;nbsp;that well written)... But if you have questions or places &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; you would &amp;nbsp;like a comment, I'd be fine with writing them...
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 1. configdev : what it does, how it is supposed to be used.
&lt;/div&gt;&lt;br&gt;configdev sets of the IO device (network card - the &amp;quot;dev&amp;quot; argument) on &amp;nbsp;
&lt;br&gt;the identified raw socket (scocket argument) to promiscuous mode &amp;nbsp;
&lt;br&gt;(accept all packets and pass them into the program) no ARP mode (the &amp;nbsp;
&lt;br&gt;interface does not automatically respond to ARP requests, and &amp;nbsp;
&lt;br&gt;configures its built-in address to 0.0.0.0 (which is to say, it has no &amp;nbsp;
&lt;br&gt;particular address). Normally, if you want a silent interface which &amp;nbsp;
&lt;br&gt;allows true arbitrary behavior bases on what the program tells the &amp;nbsp;
&lt;br&gt;interface to do, you want all of these to be the case. When you are &amp;nbsp;
&lt;br&gt;done, you may want to turn these things back to some previous state &amp;nbsp;
&lt;br&gt;(i.e., the normal IP address, ARP responses per the configured ARP &amp;nbsp;
&lt;br&gt;address of the Ethernet card, and ignoring non-broadcast packets sent &amp;nbsp;
&lt;br&gt;to the interface, since this is the normal behavior of an ethernet &amp;nbsp;
&lt;br&gt;card and reduces system resource consumption (if there are no &amp;nbsp;
&lt;br&gt;promiscuous modes set by other processes.
&lt;br&gt;&lt;br&gt;Example:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (configdev socket &amp;quot;eth0&amp;quot; 1 1 )	; eth0 no arp raw mode on socket
&lt;br&gt;&lt;br&gt;&amp;gt; 2. checksum functions: what is their contract? (e.g., min/max buffer &amp;nbsp;
&lt;br&gt;&amp;gt; size? do they modify their argument? how?)
&lt;br&gt;&amp;gt; where specifically are these checksums documented?
&lt;br&gt;&amp;gt; how are these functions supposed to be used?
&lt;br&gt;&lt;br&gt;IP datagrams are limited in total size by RFC791 (&lt;a href=&quot;http://www.ietf.org/rfc/rfc791.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ietf.org/rfc/rfc791.txt&lt;/a&gt;&amp;nbsp;
&lt;br&gt;). They operate on the buffer they are provided with, and alter the &amp;nbsp;
&lt;br&gt;appropriate areas of the datagrams so that the checksum of the &amp;nbsp;
&lt;br&gt;resulting datagram (contained in the buffer they operate on) is &amp;nbsp;
&lt;br&gt;appropriate to the protocol in use. In particular, you always want to &amp;nbsp;
&lt;br&gt;do the IPsum after the UDP, ICMP, or TCP checksum so that the IP &amp;nbsp;
&lt;br&gt;checksum properly checksums the result of the inner checksum &amp;nbsp;
&lt;br&gt;appropriate to the inner datagram protocol.
&lt;br&gt;&lt;br&gt;The IP checksum is documented in RFC791 (&lt;a href=&quot;http://www.ietf.org/rfc/rfc791.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ietf.org/rfc/rfc791.txt&lt;/a&gt;&amp;nbsp;
&lt;br&gt;) Example: (ipcsum)
&lt;br&gt;The TCP checksum is documented in RFC793 (&lt;a href=&quot;http://www.ietf.org/rfc/rfc793.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ietf.org/rfc/rfc793.txt&lt;/a&gt;&amp;nbsp;
&lt;br&gt;) Example: (tcpcsum) (ipcsum)
&lt;br&gt;The UDP checksum is documented in RFC768 (&lt;a href=&quot;http://www.ietf.org/rfc/rfc768.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ietf.org/rfc/rfc768.txt&lt;/a&gt;&amp;nbsp;
&lt;br&gt;) Example: (udpcsum) (ipcsum)
&lt;br&gt;The ICMP checksum is documented in RFC792 (&lt;a href=&quot;http://www.ietf.org/rfc/rfc792.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ietf.org/rfc/rfc792.txt&lt;/a&gt;&amp;nbsp;
&lt;br&gt;) Example: (icmpcsum) (ipcsum)
&lt;br&gt;&lt;br&gt;The design is optimized toward receiving a raw packet (which includes &amp;nbsp;
&lt;br&gt;an ethernet header and IP datagram for Internet uses, but may contain &amp;nbsp;
&lt;br&gt;any bit sequence), examining and altering the content of the packet, &amp;nbsp;
&lt;br&gt;and sending it out another interface (as an example). So, for example, &amp;nbsp;
&lt;br&gt;after the sockets are set up, to forward a datagram out another &amp;nbsp;
&lt;br&gt;interface, you simply do a (sendt socket2 (getraw socket1)), which &amp;nbsp;
&lt;br&gt;takes almost no time. On the other hand, if you want to alter the &amp;nbsp;
&lt;br&gt;outbound, for example by replacing the IP address, you simply set the &amp;nbsp;
&lt;br&gt;bytes appropriate for the From IP address to the desired From address, &amp;nbsp;
&lt;br&gt;and do (setf i (getraw socket1)) (ipcsum)(sendt socket2 i).
&lt;br&gt;&lt;br&gt;If, on the other hand, you don;t want to change the checksum, you &amp;nbsp;
&lt;br&gt;don;t have to do so (and may produce infrastructure errors). &amp;nbsp;
&lt;br&gt;Similarly, if you simply want to shove some byte sequence into the &amp;nbsp;
&lt;br&gt;ether(net), you set the bytes into the buffer, and do a sendt
&lt;br&gt;&lt;br&gt;That's about it... any other questions?
&lt;br&gt;&lt;br&gt;FC
&lt;br&gt;- This communication is confidential to the parties it is intended to &amp;nbsp;
&lt;br&gt;serve -
&lt;br&gt;Fred Cohen &amp; Associates &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tel/fax: 925-454-0171
&lt;br&gt;&lt;a href=&quot;http://all.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://all.net/&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;572 Leona Drive &amp;nbsp; &amp;nbsp;Livermore, CA 94550
&lt;br&gt;Join &lt;a href=&quot;http://tech.groups.yahoo.com/group/FCA-announce/join&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tech.groups.yahoo.com/group/FCA-announce/join&lt;/a&gt;&amp;nbsp;for our &amp;nbsp;
&lt;br&gt;mailing list
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26584001&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26584001.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26583939</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-11-30T15:20:18Z</published>
	<updated>2009-11-30T15:20:18Z</updated>
	<author>
		<name>Don Cohen-12</name>
	</author>
	<content type="html">Sam Steingold writes:
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; 1. configdev : what it does, how it is supposed to be used.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; 2. checksum functions: what is their contract? (e.g., min/max
&lt;br&gt;&amp;nbsp;&amp;gt; buffer size? do they modify their argument? how?) &amp;nbsp;where
&lt;br&gt;&amp;nbsp;&amp;gt; specifically are these checksums documented? &amp;nbsp;how are these
&lt;br&gt;&amp;nbsp;&amp;gt; functions supposed to be used?
&lt;br&gt;ip checksum in rfc 791
&lt;br&gt;udp checksum in rfc 768
&lt;br&gt;icmp in rfc 792
&lt;br&gt;tcp in rfc 793
&lt;br&gt;all say close to the same thing:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; The checksum field is the 16 bit one's complement of the one's
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; complement sum of all 16 bit words in the header. &amp;nbsp;For purposes of
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; computing the checksum, the value of the checksum field is zero.
&lt;br&gt;They cover different amounts of data, typically headers, see rfc's.
&lt;br&gt;My recollection, which the code seems to confirm, is that they
&lt;br&gt;overwrite the buffer with the correct checksum, which is normally
&lt;br&gt;what you want to do before sending a packet (but, of course, after 
&lt;br&gt;any other changes to data you want to send).
&lt;br&gt;If the checksum is wrong on an incoming packet the OS normally
&lt;br&gt;discards it.
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26583939&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26583939.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26583155</id>
	<title>Re: Doing everything with bytes instead of chars</title>
	<published>2009-11-30T14:25:14Z</published>
	<updated>2009-11-30T14:25:14Z</updated>
	<author>
		<name>Sam Steingold</name>
	</author>
	<content type="html">Fred Cohen wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; ...also, some of your old code could use more comments.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'm not big fan of comments - especially for something that short. If &amp;nbsp;
&lt;br&gt;&amp;gt; you look at the relevant RFCs, there's very little to it. All it &amp;nbsp;
&lt;br&gt;&amp;gt; really does is pull in the bytes from the interface, push out bytes to &amp;nbsp;
&lt;br&gt;&amp;gt; the interface, and perform checksums of various sorts per the &amp;nbsp;
&lt;br&gt;&amp;gt; definitions in the protocols. The rest of my code is in lisp (and not &amp;nbsp;
&lt;br&gt;&amp;gt; that well written)... But if you have questions or places you would &amp;nbsp;
&lt;br&gt;&amp;gt; like a comment, I'd be fine with writing them...
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;1. configdev : what it does, how it is supposed to be used.
&lt;br&gt;&lt;br&gt;2. checksum functions: what is their contract? (e.g., min/max buffer size? do 
&lt;br&gt;they modify their argument? how?)
&lt;br&gt;where specifically are these checksums documented?
&lt;br&gt;how are these functions supposed to be used?
&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Join us December 9, 2009 for the Red Hat Virtual Experience,
&lt;br&gt;a free event focused on virtualization and cloud computing. 
&lt;br&gt;Attend in-depth sessions from your desk. Your couch. Anywhere.
&lt;br&gt;&lt;a href=&quot;http://p.sf.net/sfu/redhat-sfdev2dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/redhat-sfdev2dev&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26583155&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26583155.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26573610</id>
	<title>clisp-cvs Digest, Vol 43, Issue 19</title>
	<published>2009-11-30T04:03:35Z</published>
	<updated>2009-11-30T04:03:35Z</updated>
	<author>
		<name>clisp-cvs-request</name>
	</author>
	<content type="html">Send clisp-cvs mailing list submissions to
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26573610&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;To subscribe or unsubscribe via the World Wide Web, visit
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-cvs&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-cvs&lt;/a&gt;&lt;br&gt;or, via email, send a message with subject or body 'help' to
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26573610&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs-request@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;You can reach the person managing the list at
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26573610&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs-owner@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;When replying, please edit your Subject line so it is more specific
&lt;br&gt;than &amp;quot;Re: Contents of clisp-cvs digest...&amp;quot;
&lt;br&gt;&lt;br&gt;&lt;br&gt;CLISP CVS commits for today
&lt;br&gt;&lt;br&gt;Today's Topics:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;1. clisp/src/m4 clisp.m4,1.19,1.20 (Sam Steingold)
&lt;br&gt;&amp;nbsp; &amp;nbsp;2. clisp/src ChangeLog,1.7213,1.7214 (Sam Steingold)
&lt;br&gt;&lt;br&gt;&lt;br&gt;----------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;Message: 1
&lt;br&gt;Date: Mon, 30 Nov 2009 04:30:29 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26573610&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/src/m4 clisp.m4,1.19,1.20
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26573610&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26573610&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NExu9-0006Nc-Ua@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/src/m4
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv24481/src/m4
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clisp.m4 
&lt;br&gt;Log Message:
&lt;br&gt;(CL_CLISP): use &amp;quot;.&amp;quot; instead of &amp;quot;source&amp;quot; (bash-specific)
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: clisp.m4
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/src/m4/clisp.m4,v
&lt;br&gt;retrieving revision 1.19
&lt;br&gt;retrieving revision 1.20
&lt;br&gt;diff -u -d -r1.19 -r1.20
&lt;br&gt;--- clisp.m4	1 Oct 2009 15:46:49 -0000	1.19
&lt;br&gt;+++ clisp.m4	30 Nov 2009 04:30:27 -0000	1.20
&lt;br&gt;@@ -69,7 +69,7 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;CLISP=$cl_cv_clisp; AC_SUBST(CLISP)dnl
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;CLISP_LINKKIT=&amp;quot;${cl_cv_clisp_libdir}linkkit&amp;quot;; AC_SUBST(CLISP_LINKKIT)dnl
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;sed 's/^/CLISP_/' ${cl_cv_clisp_linkset}/makevars &amp;gt; conftestvars
&lt;br&gt;- &amp;nbsp; &amp;nbsp;source conftestvars
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;. ./conftestvars
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;rm -f conftestvars
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;AC_SUBST(CLISP_FILES)dnl
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;AC_SUBST(CLISP_LIBS)dnl
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;Message: 2
&lt;br&gt;Date: Mon, 30 Nov 2009 04:30:29 +0000
&lt;br&gt;From: Sam Steingold &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26573610&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subject: clisp/src ChangeLog,1.7213,1.7214
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26573610&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;Message-ID: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26573610&amp;i=8&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;E1NExu9-0006Na-VW@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update of /cvsroot/clisp/clisp/src
&lt;br&gt;In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv24481/src
&lt;br&gt;&lt;br&gt;Modified Files:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ChangeLog 
&lt;br&gt;Log Message:
&lt;br&gt;(CL_CLISP): use &amp;quot;.&amp;quot; instead of &amp;quot;source&amp;quot; (bash-specific)
&lt;br&gt;&lt;br&gt;&lt;br&gt;Index: ChangeLog
&lt;br&gt;===================================================================
&lt;br&gt;RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
&lt;br&gt;retrieving revision 1.7213
&lt;br&gt;retrieving revision 1.7214
&lt;br&gt;diff -u -d -r1.7213 -r1.7214
&lt;br&gt;--- ChangeLog	26 Nov 2009 04:58:21 -0000	1.7213
&lt;br&gt;+++ ChangeLog	30 Nov 2009 04:30:27 -0000	1.7214
&lt;br&gt;@@ -1,3 +1,7 @@
&lt;br&gt;+2009-11-29 &amp;nbsp;Sam Steingold &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26573610&amp;i=9&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	* m4/clisp.m4 (CL_CLISP): use &amp;quot;.&amp;quot; instead of &amp;quot;source&amp;quot; (bash-specific)
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-11-25 &amp;nbsp;Sam Steingold &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26573610&amp;i=10&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sds@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	* pathname.d (RENAME-FILE): fix the error_too_many_args invocation
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
&lt;br&gt;trial. Simplify your report design, integration and deployment - and focus on 
&lt;br&gt;what you do best, core application coding. Discover what's new with
&lt;br&gt;Crystal Reports now. &amp;nbsp;&lt;a href=&quot;http://p.sf.net/sfu/bobj-july&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/bobj-july&lt;/a&gt;&lt;br&gt;&lt;br&gt;------------------------------
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-cvs mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26573610&amp;i=11&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-cvs@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-cvs&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-cvs&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;End of clisp-cvs Digest, Vol 43, Issue 19
&lt;br&gt;*****************************************
&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
&lt;br&gt;trial. Simplify your report design, integration and deployment - and focus on 
&lt;br&gt;what you do best, core application coding. Discover what's new with
&lt;br&gt;Crystal Reports now. &amp;nbsp;&lt;a href=&quot;http://p.sf.net/sfu/bobj-july&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/bobj-july&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26573610&amp;i=12&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-devel&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-devel-f3310.html&quot; embed=&quot;fixTarget[3310]&quot; target=&quot;_top&quot; &gt;clisp-devel&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/clisp-cvs-Digest%2C-Vol-43%2C-Issue-19-tp26573610p26573610.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26555775</id>
	<title>Re: Doing everything at larger scale in lisp</title>
	<published>2009-11-28T10:41:44Z</published>
	<updated>2009-11-28T10:41:44Z</updated>
	<author>
		<name>Pascal J. Bourguignon</name>
	</author>
	<content type="html">&lt;br&gt;On Nov 28, 2009, at 3:34 PM, Fred Cohen wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Nov 28, 2009, at 4:09 AM, Pascal J. Bourguignon wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; ...
&lt;br&gt;&amp;gt;&amp;gt; Search about unicode combining characters for example.
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Combining_character&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Combining_character&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; A single character may need several unicode code points to be
&lt;br&gt;&amp;gt;&amp;gt; represented. &amp;nbsp;So already, you cannot use a scalar to represent &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; unicode
&lt;br&gt;&amp;gt;&amp;gt; characters in general. &amp;nbsp;Then if you want to store the code points &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; in a
&lt;br&gt;&amp;gt;&amp;gt; vector, that means that the index of the vector doesn't necessarily
&lt;br&gt;&amp;gt;&amp;gt; match the index in the string, so string indexing may not be O(1).
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Of course, the problem is even more complex when you try to fit the
&lt;br&gt;&amp;gt;&amp;gt; unicode model into the lisp model of characters and strings.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Right - but this has nothing to do with the complexity of characters &amp;nbsp;
&lt;br&gt;&amp;gt; in lisp. There are a virtually unlimited number of different ways to &amp;nbsp;
&lt;br&gt;&amp;gt; encode information.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; [...] I just want the things contained within the strings to be
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; bytes (values 0-255) and not altered by any processing except the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; specific calls to alter them (no hidden automatic changes please).
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; You need to implement your own type to do that, don't use lisp
&lt;br&gt;&amp;gt;&amp;gt; character and string, they're more sophisticated. &amp;nbsp;As mentionned, you
&lt;br&gt;&amp;gt;&amp;gt; can still have &amp;quot;strings&amp;quot; in source files compiled to your own type of
&lt;br&gt;&amp;gt;&amp;gt; strings, with reader macros.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; That's what I was asking about - where can I read about the &amp;nbsp;
&lt;br&gt;&amp;gt; sophistication of strings in lisp?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ...
&lt;/div&gt;&lt;br&gt;In the source code of the implementations!
&lt;br&gt;&lt;br&gt;Or if you don't wnat to dig there, just compare CHAR_MAX (in C) vs. &amp;nbsp;
&lt;br&gt;CHAR-CODE-LIMIT (in CL) and infer the consequences.
&lt;br&gt;&lt;br&gt;Compare:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; int &amp;nbsp;i=42;
&lt;br&gt;&amp;nbsp; &amp;nbsp; char c=i;
&lt;br&gt;&lt;br&gt;vs.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; (let ((i 42)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(c (make-array 1 :element-type 'character :initial-element #\a)))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(setf (aref c 0) i))
&lt;br&gt;&lt;br&gt;and think about what it involves.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Hint: to begin with, character in CL will take 32 bits while char in C &amp;nbsp;
&lt;br&gt;takes 8 bits, therefore any string manipulation will already four time &amp;nbsp;
&lt;br&gt;slower than in C.
&lt;br&gt;&lt;br&gt;Of course when doing I/O it also means converting the internal unicode &amp;nbsp;
&lt;br&gt;codepoints to the external encoding. &amp;nbsp;In C, if you input utf-8 bytes, &amp;nbsp;
&lt;br&gt;you keep them like this (and of course you don't try to take the nth &amp;nbsp;
&lt;br&gt;character of a string, since that'd be O(n)). &amp;nbsp;In Lisp, there will be &amp;nbsp;
&lt;br&gt;decoding and encoding on each I/O.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; All the RAM will not be enough for many of the things I ultimately &amp;nbsp;
&lt;br&gt;&amp;gt; need to do. When you work with multi-terabyte disks, and you are &amp;nbsp;
&lt;br&gt;&amp;gt; trying to do analysis linking things across the entire disk to other &amp;nbsp;
&lt;br&gt;&amp;gt; such things, you need multiple terabytes of memory - which I &amp;nbsp;
&lt;br&gt;&amp;gt; obviously need to do with file systems. I just want a way to not &amp;nbsp;
&lt;br&gt;&amp;gt; have to write everything for file systems, RAM, databases, etc. just &amp;nbsp;
&lt;br&gt;&amp;gt; to get better performance at smaller sizes. Since everybody &amp;nbsp;
&lt;br&gt;&amp;gt; presumably will run into these limits on their programs at some &amp;nbsp;
&lt;br&gt;&amp;gt; point, I was thinking that a virtual RAM that extends to disk &amp;nbsp;
&lt;br&gt;&amp;gt; storage (and ultimately multiple disks across infrastructure) built &amp;nbsp;
&lt;br&gt;&amp;gt; into lisp would be easier (for me) that doing it myself... and for &amp;nbsp;
&lt;br&gt;&amp;gt; everyone who ultimately will have to do it themselves as their &amp;nbsp;
&lt;br&gt;&amp;gt; problems grow in size.
&lt;/div&gt;&lt;br&gt;Yes, you will probably be disk bound anyway, so clisp will be as good &amp;nbsp;
&lt;br&gt;as another implementation.
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;__Pascal Bourguignon__
&lt;br&gt;&lt;a href=&quot;http://www.informatimago.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.informatimago.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
&lt;br&gt;trial. Simplify your report design, integration and deployment - and focus on 
&lt;br&gt;what you do best, core application coding. Discover what's new with
&lt;br&gt;Crystal Reports now. &amp;nbsp;&lt;a href=&quot;http://p.sf.net/sfu/bobj-july&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/bobj-july&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26555775&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26555775.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26553669</id>
	<title>Doing everything at larger scale in lisp</title>
	<published>2009-11-28T06:34:46Z</published>
	<updated>2009-11-28T06:34:46Z</updated>
	<author>
		<name>Fred Cohen-3</name>
	</author>
	<content type="html">On Nov 28, 2009, at 4:09 AM, Pascal J. Bourguignon wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; ...
&lt;br&gt;&amp;gt; Search about unicode combining characters for example.
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Combining_character&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Combining_character&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; A single character may need several unicode code points to be
&lt;br&gt;&amp;gt; represented. &amp;nbsp;So already, you cannot use a scalar to represent unicode
&lt;br&gt;&amp;gt; characters in general. &amp;nbsp;Then if you want to store the code points in a
&lt;br&gt;&amp;gt; vector, that means that the index of the vector doesn't necessarily
&lt;br&gt;&amp;gt; match the index in the string, so string indexing may not be O(1).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Of course, the problem is even more complex when you try to fit the
&lt;br&gt;&amp;gt; unicode model into the lisp model of characters and strings.
&lt;/div&gt;&lt;br&gt;Right - but this has nothing to do with the complexity of characters &amp;nbsp;
&lt;br&gt;in lisp. There are a virtually unlimited number of different ways to &amp;nbsp;
&lt;br&gt;encode information.
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; [...] I just want the things contained within the strings to be
&lt;br&gt;&amp;gt;&amp;gt; bytes (values 0-255) and not altered by any processing except the
&lt;br&gt;&amp;gt;&amp;gt; specific calls to alter them (no hidden automatic changes please).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You need to implement your own type to do that, don't use lisp
&lt;br&gt;&amp;gt; character and string, they're more sophisticated. &amp;nbsp;As mentionned, you
&lt;br&gt;&amp;gt; can still have &amp;quot;strings&amp;quot; in source files compiled to your own type of
&lt;br&gt;&amp;gt; strings, with reader macros.
&lt;br&gt;&lt;br&gt;That's what I was asking about - where can I read about the &amp;nbsp;
&lt;br&gt;sophistication of strings in lisp?
&lt;br&gt;&lt;br&gt;...
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Are you aware that there are several implementation of Common Lisp,
&lt;br&gt;&amp;gt; and that clisp is just one implementation of lisp, written in C (hence
&lt;br&gt;&amp;gt; the name, c lisp)?
&lt;br&gt;&lt;br&gt;I am - but I want one that has all of the features of portability, an &amp;nbsp;
&lt;br&gt;outstanding team of people behind it, with a long history, open &amp;nbsp;
&lt;br&gt;source, the ability to interface to C if need be, willingness to talk &amp;nbsp;
&lt;br&gt;to (email with) people like me, in most standard linux distributions, &amp;nbsp;
&lt;br&gt;etc.
&lt;br&gt;&lt;br&gt;&amp;gt; The point here is that, on 32-bit platforms, clisp is rather more
&lt;br&gt;&amp;gt; limited in memory than most other implementations. &amp;nbsp;Check array-total-
&lt;br&gt;&amp;gt; size-limit for example. &amp;nbsp;(On 64-bit platforms, there's enough
&lt;br&gt;&amp;gt; addressing space to use all the available RAM).
&lt;br&gt;&lt;br&gt;All the RAM will not be enough for many of the things I ultimately &amp;nbsp;
&lt;br&gt;need to do. When you work with multi-terabyte disks, and you are &amp;nbsp;
&lt;br&gt;trying to do analysis linking things across the entire disk to other &amp;nbsp;
&lt;br&gt;such things, you need multiple terabytes of memory - which I obviously &amp;nbsp;
&lt;br&gt;need to do with file systems. I just want a way to not have to write &amp;nbsp;
&lt;br&gt;everything for file systems, RAM, databases, etc. just to get better &amp;nbsp;
&lt;br&gt;performance at smaller sizes. Since everybody presumably will run into &amp;nbsp;
&lt;br&gt;these limits on their programs at some point, I was thinking that a &amp;nbsp;
&lt;br&gt;virtual RAM that extends to disk storage (and ultimately multiple &amp;nbsp;
&lt;br&gt;disks across infrastructure) built into lisp would be easier (for me) &amp;nbsp;
&lt;br&gt;that doing it myself... and for everyone who ultimately will have to &amp;nbsp;
&lt;br&gt;do it themselves as their problems grow in size.
&lt;br&gt;&lt;br&gt;&amp;gt; If you need to go to the limit of your addressing space, then sbcl or
&lt;br&gt;&amp;gt; ecl might be better choices than clisp.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Also, since you seem to have needs for performance, while this is more
&lt;br&gt;&amp;gt; difficult to evaluate, it is possible that ecl or sbcl who compile to
&lt;br&gt;&amp;gt; native code (ecl going thru gcc), could produce faster code than clisp
&lt;br&gt;&amp;gt; (on the other hand, clisp mustn't be discarted a-priori, since it has
&lt;br&gt;&amp;gt; now a JIT compiler, and even with a VM, performance can be good for
&lt;br&gt;&amp;gt; some things.
&lt;br&gt;&lt;br&gt;Right - the JIT compiler is extremely helpful since I don't know in &amp;nbsp;
&lt;br&gt;advance what my program may have to do. I also do a substantial number &amp;nbsp;
&lt;br&gt;of things with eval by building up expressions as I go. That's one of &amp;nbsp;
&lt;br&gt;the reasons I prefer an interpretive language - but I still want the &amp;nbsp;
&lt;br&gt;performance of compiled code - which is why clisp fits so well for so &amp;nbsp;
&lt;br&gt;many things.
&lt;br&gt;&lt;br&gt;FC
&lt;br&gt;- This communication is confidential to the parties it is intended to &amp;nbsp;
&lt;br&gt;serve -
&lt;br&gt;Fred Cohen &amp; Associates &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tel/fax: 925-454-0171
&lt;br&gt;&lt;a href=&quot;http://all.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://all.net/&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;572 Leona Drive &amp;nbsp; &amp;nbsp;Livermore, CA 94550
&lt;br&gt;Join &lt;a href=&quot;http://tech.groups.yahoo.com/group/FCA-announce/join&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tech.groups.yahoo.com/group/FCA-announce/join&lt;/a&gt;&amp;nbsp;for our &amp;nbsp;
&lt;br&gt;mailing list
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------------------------------------------------
&lt;br&gt;Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
&lt;br&gt;trial. Simplify your report design, integration and deployment - and focus on 
&lt;br&gt;what you do best, core application coding. Discover what's new with
&lt;br&gt;Crystal Reports now. &amp;nbsp;&lt;a href=&quot;http://p.sf.net/sfu/bobj-july&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://p.sf.net/sfu/bobj-july&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;clisp-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553669&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;clisp-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/clisp-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/clisp-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/clisp-list-f3311.html&quot; embed=&quot;fixTarget[3311]&quot; target=&quot;_top&quot; &gt;clisp-list&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/writing-binary-files-tp26498038p26553669.html" />
</entry>

</feed>
