From owner-freebsd-hackers@FreeBSD.ORG Mon May 26 09:05:47 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A8C2537B401 for ; Mon, 26 May 2003 09:05:47 -0700 (PDT) Received: from mclean.mail.mindspring.net (mclean.mail.mindspring.net [207.69.200.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A3D843F75 for ; Mon, 26 May 2003 09:05:47 -0700 (PDT) (envelope-from jtoung@mindspring.com) Received: from h-68-164-29-16.snvacaid.covad.net ([68.164.29.16] helo=there) by mclean.mail.mindspring.net with esmtp (Exim 3.33 #1) id 19KKTo-0005XT-00; Mon, 26 May 2003 12:05:44 -0400 Content-Type: text/plain; charset="iso-8859-1" From: Jerry Toung To: ashish@symonds.net, Date: Mon, 26 May 2003 09:06:03 -0700 User-Agent: KMail/1.4.3 References: <1116.203.192.199.30.1053958864.squirrel@secure.symonds.net> In-Reply-To: <1116.203.192.199.30.1053958864.squirrel@secure.symonds.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200305260906.04023.jtoung@mindspring.com> Subject: Re: changing the ToS in IP Header X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2003 16:05:48 -0000 Ashish, you can set the TOS bit when you create the socket in your program. int fd, tos; fd =3D socket(PF_INET, SOCK_DGRAM, 0) tos=3D3; setsockopt(fd,IPPROTO_IP,3, &tos, sizeof(tos)) On Monday 26 May 2003 07:21 am, Ashish Kulkarni wrote: > Hello, > > > Is there any way in which I can manipulate the Type of Service (TOS) by= te > in the IPv4 header? I need to set the TOS bits on all outgoing packets = from > my box to the ISP to a particular pattern (0x02), as otherwise the ISP = does > not forward packets. I have been able to do this in Linux using the > iptables mangle table: > > > http://www.tldp.org/LDP/nag2/x-087-2-firewall.tos.manipulation.html > > > but am unable to find a similiar packet-mangling feature in the firewal= ls > running on FreeBSD...there are rules for matching on TOS pattern, but n= ot > on TOS manipulation. Does anyone know of any tool which can do this? > > > As an alternative solution, is there any way to set the default TOS via= a > sysctl interface (similiar to that of TTL, namely net.inet.ip.ttl)? I'= m > planning to use this on my home box, so I have no problems in trying to > patch and rebuild the kernel if I can get some feedback and/or tips on = how > to do so :-) > > > Thanks, > Ashish. > > > ps: can you please CC any replies to me? thanks... > > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.o= rg"