From owner-freebsd-questions Wed Dec 9 04:40:34 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA11057 for freebsd-questions-outgoing; Wed, 9 Dec 1998 04:40:34 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from penguin.wise.edt.ericsson.se (penguin-ext.wise.edt.ericsson.se [194.237.142.5]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA11051 for ; Wed, 9 Dec 1998 04:40:29 -0800 (PST) (envelope-from tmphung@lt.eth.ericsson.se) Received: from duna (duna.eth.ericsson.se [164.48.158.2]) by penguin.wise.edt.ericsson.se (8.9.0/8.9.0/WIREfire-1.2) with SMTP id NAA10104 for ; Wed, 9 Dec 1998 13:40:22 +0100 (MET) Received: from lt.eth.ericsson.se by duna (SMI-8.6/SMI-SVR4) id NAA01161; Wed, 9 Dec 1998 13:44:00 +0100 Received: from pythagoras.danubius by lt.eth.ericsson.se (8.8.8+Sun/SMI-SVR4) id NAA06299; Wed, 9 Dec 1998 13:40:18 +0100 (MET) Received: from lt.eth.ericsson.se (localhost [127.0.0.1]) by pythagoras.danubius (8.8.8+Sun/8.8.8) with ESMTP id NAA11378 for ; Wed, 9 Dec 1998 13:40:18 +0100 (MET) Message-ID: <366E6FB2.47882AEF@lt.eth.ericsson.se> Date: Wed, 09 Dec 1998 13:40:18 +0100 From: Nguyen Tuan Hung X-Mailer: Mozilla 4.07 [en] (X11; I; SunOS 5.6 sun4u) MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG Subject: [Fwd: Configuring FreeBSD kernel.] Content-Type: multipart/mixed; boundary="------------6F73FBC0AF663E4CCC9349EC" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------6F73FBC0AF663E4CCC9349EC Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi! I'm reading the /sys/netinet/ip_input.c file the ip_init() menthod, you wrote " /*****************************************************/ /* * IP initialition. Fill in IP protocol switch table *If all protocols not implemented go to raw IP protocol handler */ /******************************************************/ 1. This means, if I remove tcp_init(), and udp_init() from (struct protosw) inetsw[] array (instead NULL), the kernel will pass tcp (or udp) packet to my open raw socket? 2. What happen with icmp, and iqmp protocols. They work correctly. 3. If I exchange only tcp_init to NULL, where will the kernel pass incoming udp packet to my raw socket, or kernel handle it. --------------6F73FBC0AF663E4CCC9349EC Content-Type: message/rfc822 Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <366E40E8.EDDD3B69@lt.eth.ericsson.se> Date: Wed, 09 Dec 1998 10:20:40 +0100 From: Nguyen Tuan Hung X-Mailer: Mozilla 4.07 [en] (X11; I; SunOS 5.6 sun4u) MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG Subject: Configuring FreeBSD kernel. Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi! I'm reading the /sys/netinet/ip_input.c file the ip_init() menthod, you wrote " /*****************************************************/ /* * IP initialition. Fill in IP protocol switch table *If all protocols not implemented go to raw IP protocol handler */ /******************************************************/ What does mean this? How do I do it. What need I do in kernel, I don't want use kernel's TCP protocol instead my written NEW_TCP protocol. Example I like to write deamon program that open SOCK_RAW socket, and know receive incoming TCP packet (whithout Berkeley packet filter) The source code: /* server.c */ int fd; fd = socket (AF_INET, SOCK_RAW,IPPROTO_TCP); . . . while(1) { recvfrom(fd,buf, len,0, NULL,NULL); fprintf(stderr, "coming dat a%s \n",buf); } close(fd); /*end server.c */ /* client.c */ int fd fd = socket(AF_INET, SOCK_STREAM, 0); . . . . send(fd,buf, len); close(fd); /*end client.c */ --------------6F73FBC0AF663E4CCC9349EC-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message