Date: Wed, 09 Dec 1998 13:40:18 +0100 From: Nguyen Tuan Hung <tmphung@lt.eth.ericsson.se> To: freebsd-questions@FreeBSD.ORG Subject: [Fwd: Configuring FreeBSD kernel.] Message-ID: <366E6FB2.47882AEF@lt.eth.ericsson.se>
next in thread | raw e-mail | index | archive | help
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 <tmphung@lt.eth.ericsson.se> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?366E6FB2.47882AEF>