view dstep/coreservices/osservices/OpenTransportProtocol.d @ 11:07194b026fa4

Added bindings to a couple of frameworks, new license + some other things
author Jacob Carlborg <doob@me.com>
date Sat, 01 Aug 2009 15:03:28 +0200
parents
children
line wrap: on
line source

/**
 * Copyright: Copyright (c) 2009 Jacob Carlborg.
 * Authors: Jacob Carlborg
 * Version: Initial created: Jul 22, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.coreservices.osservices.OpenTransportProtocol;

//import dstep.AvailabilityMacros;
import dstep.coreservices.carboncore.CodeFragments;
import dstep.coreservices.carboncore.ConditionalMacros;
import dstep.coreservices.carboncore.Files;
import dstep.coreservices.osservices.OpenTransport;
//import dstep.stddef;

alias int OTTimerTask;

extern (C)
{
	alias ubyte function (void*, OTLink*) OTHashSearchProcPtr;
	alias ubyte function (OTLink*) OTGateProcPtr;
	alias uint function (OTLink*) OTHashProcPtr;
}

enum
{
	I_NREAD = ((MIOC_STREAMIO << 8) | 1),
	I_PUSH = ((MIOC_STREAMIO << 8) | 2),
	I_POP = ((MIOC_STREAMIO << 8) | 3),
	I_LOOK = ((MIOC_STREAMIO << 8) | 4),
	I_FLUSH = ((MIOC_STREAMIO << 8) | 5),
	I_SRDOPT = ((MIOC_STREAMIO << 8) | 6),
	I_GRDOPT = ((MIOC_STREAMIO << 8) | 7),
	I_STR = ((MIOC_STREAMIO << 8) | 8),
	I_SETSIG = ((MIOC_STREAMIO << 8) | 9),
	I_GETSIG = ((MIOC_STREAMIO << 8) | 10),
	I_FIND = ((MIOC_STREAMIO << 8) | 11),
	I_LINK = ((MIOC_STREAMIO << 8) | 12),
	I_UNLINK = ((MIOC_STREAMIO << 8) | 13),
	I_PEEK = ((MIOC_STREAMIO << 8) | 15),
	I_FDINSERT = ((MIOC_STREAMIO << 8) | 16),
	I_SENDFD = ((MIOC_STREAMIO << 8) | 17),
	I_RECVFD = ((MIOC_STREAMIO << 8) | 18),
	I_FLUSHBAND = ((MIOC_STREAMIO << 8) | 19),
	I_SWROPT = ((MIOC_STREAMIO << 8) | 20),
	I_GWROPT = ((MIOC_STREAMIO << 8) | 21),
	I_LIST = ((MIOC_STREAMIO << 8) | 22),
	I_ATMARK = ((MIOC_STREAMIO << 8) | 23),
	I_CKBAND = ((MIOC_STREAMIO << 8) | 24),
	I_GETBAND = ((MIOC_STREAMIO << 8) | 25),
	I_CANPUT = ((MIOC_STREAMIO << 8) | 26),
	I_SETCLTIME = ((MIOC_STREAMIO << 8) | 27),
	I_GETCLTIME = ((MIOC_STREAMIO << 8) | 28),
	I_PLINK = ((MIOC_STREAMIO << 8) | 29),
	I_PUNLINK = ((MIOC_STREAMIO << 8) | 30),
	I_GETMSG = ((MIOC_STREAMIO << 8) | 40),
	I_PUTMSG = ((MIOC_STREAMIO << 8) | 41),
	I_POLL = ((MIOC_STREAMIO << 8) | 42),
	I_SETDELAY = ((MIOC_STREAMIO << 8) | 43),
	I_GETDELAY = ((MIOC_STREAMIO << 8) | 44),
	I_RUN_QUEUES = ((MIOC_STREAMIO << 8) | 45),
	I_GETPMSG = ((MIOC_STREAMIO << 8) | 46),
	I_PUTPMSG = ((MIOC_STREAMIO << 8) | 47),
	I_AUTOPUSH = ((MIOC_STREAMIO << 8) | 48),
	I_PIPE = ((MIOC_STREAMIO << 8) | 49),
	I_HEAP_REPORT = ((MIOC_STREAMIO << 8) | 50),
	I_FIFO = ((MIOC_STREAMIO << 8) | 51)
}

enum
{
	RS_HIPRI = 0x01
}

enum
{
	MSG_HIPRI = 0x01,
	MSG_BAND = 0x02,
	MSG_ANY = 0x04
}

enum
{
	MORECTL = 0x01,
	MOREDATA = 0x02
}

enum
{
	FMNAMESZ = 31
}

enum : uint
{
	INFTIM = 0xFFFFFFFF
}

enum
{
	FLUSHR = 0x01,
	FLUSHW = 0x02,
	FLUSHRW = (FLUSHW | FLUSHR)
}

enum
{
	FLUSHBAND = 0x40
}

enum
{
	ANYMARK = 0x01,
	LASTMARK = 0x02
}

enum
{
	S_INPUT = 0x01,
	S_HIPRI = 0x02,
	S_OUTPUT = 0x04,
	S_MSG = 0x08,
	S_RDNORM = 0x10,
	S_RDBAND = 0x20,
	S_WRNORM = 0x40,
	S_WRBAND = 0x80,
	S_ERROR = 0x0100,
	S_HANGUP = 0x0200,
	S_BANDURG = 0x0400
}

enum
{
	RNORM = 0x01,
	RMSGD = 0x02,
	RMSGN = 0x04,
	RFILL = 0x08
}

enum
{
	RPROTNORM = 0x10,
	RPROTDIS = 0x20,
	RPROTDAT = 0x40
}

enum
{
	SNDZERO = 0x01
}

enum
{
	MUXID_ALL = -1
}

enum
{
	SL_FATAL = 0x01,
	SL_NOTIFY = 0x02,
	SL_ERROR = 0x04,
	SL_TRACE = 0x08,
	SL_CONSOLE = 0x00,
	SL_WARN = 0x20,
	SL_NOTE = 0x40
}

enum
{
	I_TRCLOG = ((MIOC_STRLOG << 8) | 1),
	I_ERRLOG = ((MIOC_STRLOG << 8) | 2)
}

enum
{
	LOGMSGSZ = 128
}

struct bandinfo
{
	ubyte bi_pri;
	byte pad1;
	int bi_flag;
}


struct strfdinsert
{
	strbuf ctlbuf;
	strbuf databuf;
	int flags;
	int fildes;
	int offset;
}


struct str_mlist
{
	char* l_name;
}


struct str_list
{
	int sl_nmods;
	str_mlist* sl_modlist;
}


struct strpeek
{
	strbuf ctlbuf;
	strbuf databuf;
	int flags;
}


struct strpmsg
{
	strbuf ctlbuf;
	strbuf databuf;
	int band;
	int flags;
}


struct strrecvfd
{
	int fd;
	ushort uid;
	ushort gid;
	char* fill;
}


struct strioctl
{
	int ic_cmd;
	int ic_timout;
	int ic_len;
	char* ic_dp;
}


struct log_ctl
{
	short mid;
	short sid;
	byte level;
	byte pad1;
	short flags;
	int ltime;
	int ttime;
	int seq_no;
}


struct trace_ids
{
	short ti_mid;
	short ti_sid;
	byte ti_level;
}


struct OTPortCloseStruct
{
	uint fPortRef;
	ProviderRef fTheProvider;
	int fDenyReason;
}


struct OTClientList
{
	uint fNumClients;
	char* fBuffer;
}


struct OTHashList
{
	OTHashProcPtr fHashProc;
	uint fHashTableSize;
	OTLink** fHashBuckets;
}


struct OTGate
{
	OTLIFO fLIFO;
	OTList fList;
	OTGateProcPtr fProc;
	int fNumQueued;
	int fInside;
}