*BSD News Article 23609


Return to BSD News archive

Xref: sserve comp.unix.programmer:12992 comp.unix.bsd:12902 comp.protocols.tcp-ip:25954
Path: sserve!newshost.anu.edu.au!munnari.oz.au!constellation!osuunx.ucc.okstate.edu!moe.ksu.ksu.edu!crcnis1.unl.edu!wupost!howland.reston.ans.net!europa.eng.gtefsd.com!darwin.sura.net!iris.tjhsst.edu!thor.tjhsst.edu!not-for-mail
From: cmetz@thor.tjhsst.edu (Craig Metz)
Newsgroups: comp.unix.programmer,comp.unix.bsd,comp.protocols.tcp-ip
Subject: Raw IP sockets: How does one set TOS?
Date: 10 Nov 1993 11:22:40 -0500
Organization: The Thomas Jefferson High School for Science and Technology
Lines: 13
Distribution: world
Message-ID: <2br4gg$oaa@thor.tjhsst.edu>
NNTP-Posting-Host: thor.tjhsst.edu

	I am trying to write some code that requires raw IP access using the
BSD sockets interface. However, I'm having a bit of trouble setting the Type
Of Service field in the IP header on the socket. The offending line is:

setsockopt(ip_socket, IPPROTO_IP, IP_TOS, (char *)(&protocol_num), 
	sizeof(protocol_num));

	This returns EPERM running as the superuser. Could someone suggest a
fix for this or what I'm doing wrong?

								Thanks,

								-Craig