[Prev][Next][Index][Thread]

Re: socket in linux



"Chang, Mingtai" wrote:
> 
> There is no such animal as SOCK_PACKET. There does exist a type of socket
> called SOCK_SEQPACKET. A socket of type SOCK_SEQPACKET would format the data
> stream into fix-lengthed "records" so that one can retrieve data on a record
> by record basis, instead of guessing the number of bytes to get.
> Compaq/Digital's DECnet supports that.

Sure there is both SOCK_PACKET and SOCK_RAW under Linux.  But don't expect
much documentation about these things.  SOCK_PACKET is used by packet sniffers
to receive all packets arriving/sent through an interface.  AFAIK there is no
way of sending data through a SOCK_PACKET socket.

SOCK_RAW is meant for something totally different: it allows to _send_ raw
packets, which is absolutely required for user level implementation of
protocols (or for injecting bogus packets that crash some remote machine).
There are numerous ways of sending hand-crafted packets from OSKIT (one is
just using the low level drivers directly).  The OSKIT authors probably
can suggest the best places to hack once you tell them roughly what you're
trying to achieve.

Note that I don't know much about the BSD networking code, so maybe this is
a piece of cake once the terminology is out of the way.

> > ----------
> > From:         Leigh Stoller[SMTP:stoller@fast.cs.utah.edu]
> > Sent:         Tuesday, September 21, 1999 10:26 AM
> > To:   yaoyyuan@263.net
> > Cc:   oskit-users@cs.utah.edu
> > Subject:      Re: socket in linux
> >
> > > From: yaoyyuan@263.net
> > > Subject: socket in linux
> > >
> > > I have a question in oskit.
> > > I want to use SOCK_PACKET which defined in linix/socket.h .It is used in
> > > the socket function only in Linux. But in oskit the oskit/net/socket.h
> > is
> > > from BSD and no such definition.It has only SOCK_STREAM ,SOCK_RAW ,etc
> > > definition .  So how can I use it?
> >
> > I think the short answer is that you cannot. The OSKIT uses the Linux
> > device drivers, but FreeBSD networking, which does not implement that.
> >
> > As an aside, what is SOCK_PACKET? Kinda looks like SOCK_RAW to me, but I'm
> > not sure what the differences are.

-- 
Klaus Espenlaub                      Email:  espenlaub@informatik.uni-ulm.de
Universitaet Ulm                     Phone:  +49 731 50-24178
Abteilung Rechnerstrukturen          Fax:    +49 731 50-24182
D-89069 Ulm                          Office: Building O27, Room 316

Follow-Ups: References: