<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Thu, 23 Jul 2009 08:54:45 +0100
From   : philb@... (Phil Blundell)
Subject: RFC: BBC Ethernet API

On Thu, 2009-07-23 at 01:50 +0100, Jonathan Graham Harston wrote:
> I present here a proposal for an OSWORD Ethernet access call. 

I guess this is more of an Internet - or, as you say, BSD sockets - API
rather than an Ethernet one as such.  You certainly could use it to
generate Ethernet frames by defining a suitable PF_ETHERNET/PF_RAW kind
of thing, but this is a much wider interface than you would need if that
was all you wanted to do.

> On entry: A%=192, X%=control block, Y%=X%DIV256
>           X%?0  = OSWORD send block length
>           X%?1  = OSWORD receive block length
>           X%?2  = command - same as RISC OS SWI Socket_ command number
>           X%?3  = 0
>           X%!4  = socket
>           X%!8  = address
>           X%!12 = length
>           X%!16 = flags
>           X%!20 = address
>           X%!24 = address length

That looks fairly reasonable to me.  You could perhaps make some of
those fields a bit narrower -- for example, it probably isn't necessary
to allow for 2^32 open sockets; both the socket number (and the domain
parameter to Socket_Creat) would most likely fit in 8 bits.

I also wonder whether it's necessary to have all four variants of the
read and write operations (i.e. Read/Recv/Recvfrom/Recvmsg, likewise for
Write). 

What is Socket_Stat useful for?  I'm not that familiar with the RISC OS
API but, in a Unix world, I can't immediately think of any particular
value in calling fstat() on a socket.

p.
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>