From owner-freebsd-net@FreeBSD.ORG Thu Oct 22 18:32:20 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28B70106568B for ; Thu, 22 Oct 2009 18:32:20 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outT.internet-mail-service.net (rly30.mx.aerioconnect.net [216.240.35.254]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC028FC1D for ; Thu, 22 Oct 2009 18:32:20 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 0BAB0CD467; Thu, 22 Oct 2009 11:32:20 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id 76B672D602C; Thu, 22 Oct 2009 11:32:19 -0700 (PDT) Message-ID: <4AE0A533.1010802@elischer.org> Date: Thu, 22 Oct 2009 11:32:19 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Arun Anirudhan References: <4AE09C03.6050201@elischer.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: rip_input X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 18:32:20 -0000 Arun Anirudhan wrote: > When I make > void rip_input_hook(struct mbuf *m, int off) > to > void rip_input_hook(struct mbuf *m) its showing error! the correct current definition is in sys/protosw.h 66 /* USE THESE FOR YOUR PROTOTYPES ! */ 67 typedef void pr_input_t (struct mbuf *, int); <------------- ^^^^^^^^^^^ you should use the typedef too. 68 typedef int pr_input6_t (struct mbuf **, int*, int); /* XXX FIX THIS */ 69 typedef int pr_output_t (struct mbuf *, struct socket *); 70 typedef void pr_ctlinput_t (int, struct sockaddr *, void *); 71 typedef int pr_ctloutput_t (struct socket *, struct sockopt *); 72 typedef void pr_init_t (void); 73 typedef void pr_destroy_t (void); 74 typedef void pr_fasttimo_t (void); 75 typedef void pr_slowtimo_t (void); 76 typedef void pr_drain_t (void); 77 78 struct protosw { 79 short pr_type; /* socket type used for */ 80 struct domain *pr_domain; /* domain protocol a member of */ 81 short pr_protocol; /* protocol number */ 82 short pr_flags; /* see below */ 83 /* protocol-protocol hooks */ 84 pr_input_t *pr_input; /* input to protocol (from below) */ 85 pr_output_t *pr_output; /* output to protocol (from above) */ 86 pr_ctlinput_t *pr_ctlinput; /* control input (from below) */ 87 pr_ctloutput_t *pr_ctloutput; /* control output (from above) */ 88 /* utility hooks */ 89 pr_init_t *pr_init; 90 pr_destroy_t *pr_destroy; 91 pr_fasttimo_t *pr_fasttimo; /* fast timeout (200ms) */ 92 pr_slowtimo_t *pr_slowtimo; /* slow timeout (500ms) */ 93 pr_drain_t *pr_drain; /* flush any excess space possible */ 94 95 struct pr_usrreqs *pr_usrreqs; /* user-protocol hook */ 96 };