[Vm-dev] [DEV] Systemd socket activation patch for the VM

David T. Lewis lewis at mail.msen.com
Fri Jul 11 01:21:22 UTC 2014


On Thu, Jul 10, 2014 at 03:31:37PM +0200, Bert Freudenberg wrote:
>  
> 
> On 10.07.2014, at 01:54, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> 
> > Hi Max,
> > 
> >     I've integrated, but there's a conflict with the Cog sources because there's already support for RAW sockets in the Qwaq/Terf VM.  That means socket type 2 is already taken.  So I've integrated like this:
> > 
> > #define TCPSocketType       0
> > #define UDPSocketType       1
> > #ifdef HAVE_SD_DAEMON
> > # define ProvidedTCPSocketType  2
> > # define RAWSocketType      3
> > #else
> > # define RAWSocketType      2
> > #endif
> > 
> > But I would prefer to integrate this:
> > 
> > #define TCPSocketType       0
> > #define UDPSocketType       1
> > # define RAWSocketType      2
> > #define ProvidedTCPSocketType  3
> > 
> > Is it too late for you to change the Smalltalk code so that ProvidedTCPSocketType is 3?
> 
> Speaking of which, would it make sense to reserve more socket types?
> 
> According to http://www.freedesktop.org/software/systemd/man/systemd.socket.html there are TCP stream (SOCK_STREAM), UDP datagram (SOCK_DGRAM), and sequential packet (SOCK_SEQPACKET) sockets.
> 
> - Bert -
> 

There is quite a range of protocol families and socket types, so I'm not sure
it is worth worrying about it too much right now. But I suppose we could adopt
some sort of convention like this:


#define TCPSocketType                      0    /* SOCK_STREAM on AF_INET or AF_INET6 */
#define UDPSocketTyp                       1    /* SOCK_DGRAM on AF_INET or AF_INET6 */
#define RAWSocketType                      2    /* SOCK_RAW on AF_INET or AF_INET6 */
#define SeqPacketSocketType                3    /* SOCK_SEQPACKET on AF_INET or AF_INET6 */
#define ReliableDGramSocketType            4    /* SOCK_RDM on AF_INET or AF_INET6 */

#define ReuseExistingSocket                256

#define ProvidedTCPSocketType              TCPSocketType + ReuseExistingSocket
#define ProvidedUDPSocketType              UDPSocketType + ReuseExistingSocket
#define ProvidedRAWSocketType              RAWSocketType + ReuseExistingSocket
#define ProvidedSeqPacketSocketType        SeqPacketSocketType + ReuseExistingSocket
#define ProvidedReliableDGramSocketType    ReliableDGramSocketType + ReuseExistingSocket

... etc ...

Dave



More information about the Vm-dev mailing list