⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stropts.h

📁 VRTX 商用嵌入式实时操作系统
💻 H
字号:
/***************************************************************************
*
*               Copyright (c) 1993 READY SYSTEMS CORPORATION.
*
*       All rights reserved. READY SYSTEMS' source code is an unpublished
*       work and the use of a copyright notice does not imply otherwise.
*       This source code contains confidential, trade secret material of
*       READY SYSTEMS. Any attempt or participation in deciphering, decoding,
*       reverse engineering or in any way altering the source code is
*       strictly prohibited, unless the prior written consent of
*       READY SYSTEMS is obtained.
*
*
*       Module Name:            stropts.h
*
*       Identification:         @(#) 1.4 stropts.h
*
*       Date:                   1/6/94  16:30:05
*
****************************************************************************
*/

/*
 RCS header identifier - $Id: stropts.h,v 1.4 1993/10/05 18:09:16 robert Exp $
*/
/*
 * Copyrighted as an unpublished work.
 * (c) Copyright 1992-1993 Lachman Technology, Incorporated
 * All rights reserved.
 * 
 * RESTRICTED RIGHTS
 * 
 * These programs are supplied under a license.  They may be used,
 * disclosed, and/or copied only as permitted under such license
 * agreement.  Any copy must contain the above copyright notice and
 * this restricted rights notice.  Use, copying, and/or disclosure
 * of the programs is strictly prohibited unless otherwise provided
 * in the license agreement.
 */

#ifndef __STROPTS_H
#define __STROPTS_H

#ifdef __cplusplus
extern "C" {
#endif

#include "kernel/swktypes.h"
#include "kernel/swkdefs.h"
#include "sys/conf.h"

/*******************************************************************************
 * streamio(7) ioctl commands (block of values: 0x0100 to 0x01ff)
 */
#define I_PUSH		0x0101
#define I_POP		0x0102
#define I_LOOK		0x0103
#define I_FLUSH		0x0104
#define I_FLUSHBAND	0x0105
#define I_SETSIG	0x0106
#define I_GETSIG	0x0107
#define I_FIND		0x0108
#define I_PEEK		0x0109
#define I_SRDOPT	0x010a
#define I_GRDOPT	0x010b
#define I_NREAD		0x010c
#define I_FDINSERT	0x010d
#define I_STR		0x010e
#define I_SWROPT	0x010f
#define I_GWROPT	0x0110
#define I_SENDFD	0x0111
#define I_RECVFD	0x0112
#define I_LIST		0x0113
#define I_ATMARK	0x0114
#define I_CKBAND	0x0115
#define I_GETBAND	0x0116
#define I_CANPUT	0x0117
#define I_SETCLTIME	0x0118
#define I_GETCLTIME	0x0119
#define I_LINK		0x011a
#define I_UNLINK	0x011b
#define I_PLINK		0x011c
#define I_PUNLINK	0x011d

#define I_FDTODRVQ	0x011e

/* IOCTLs for SNX queue and message stats. */

#define I_DUMPQSTAT	0x011f
#define I_DUMPALLQ	0x0120
#define I_DUMPQ		0x0121
#define I_DUMPSTREAM	0x0122

/* IOCTLs for SNX route and sockets state info */

#define I_GRTTBLSZ	0x0123
#define I_GRTTBL	0x0124
#define I_GSOCKTBLSZ	0x0125
#define I_GSOCKTBL	0x0126

/*******************************************************************************
 * I_ATMARK arguments (SPG 5-18 and SPG F - streamio(7) - pg10)
 */
#define ANYMARK		1
#define LASTMARK	2

/*******************************************************************************
 * I_FLUSH arguments (SPG F - streamio(7) - pg2)
 */
#define FLUSHR		0x01
#define FLUSHW		0x02
#define FLUSHRW		(FLUSHR | FLUSHW)
#define FLUSHBAND	0x04

struct bandinfo {
	unsigned char	bi_pri;
	int		bi_flag;
};

typedef struct bandinfo bandinfo_t;


/*******************************************************************************
 * I_SETSIG arguments (SPG F - streamio(7) - pg3 )
 */
#define S_INPUT		0x0001
#define S_RDNORM	0x0002
#define S_RDBAND	0x0004
#define S_HIPRI		0x0008
#define S_OUTPUT	0x0010
#define S_WRNORM	0x0020
#define S_WRBAND	0x0040
#define S_MSG		0x0080
#define S_ERROR		0x0100
#define S_HANGUP	0x0200
#define S_BANDURG	0x0400

#define S_VALID		0x07FF

/*******************************************************************************
 * I_SRDOPT arguments (SPG F - streamio(7) - pg5 )
 */
#define RNORM		0x00		/* byte-stream mode, the default */
#define RMSGD		0x01		/* message-discard mode */
#define RMSGN		0x02		/* message-nondiscard mode */
#define RRDOPTALL	0x0f		/* mask for above */

#define RPROTNORM	0x00		/* fail read on ctrl msg, the default */
#define RPROTDAT	0x10		/* read ctrl msg as data */
#define RPROTDIS	0x20		/* discard ctrl msg on read */
#define RRDPOPTALL	0xf0		/* mask for above */

/*******************************************************************************
 * I_SWROPT arguments (SPG F - streamio(7) - pg8 )
 */
#define SNDZERO		0x01		/* send zero-length msg on write 0 */

/*******************************************************************************
 * getmsg(2)/getpmsg(2) and putmsg(2)/putpmsg(2) flags
 */
#define RS_HIPRI	0x01
#define MSG_HIPRI	0x02
#define MSG_BAND	0x04
#define MSG_ANY		0x08


/*******************************************************************************
 * getmsg(2) / getpmsg(2) return values
 */
#define MORECTL		0x01
#define MOREDATA	0x02


/*******************************************************************************
 * misc.
 */
#define INFTIM		(-1)		/* infinite timeout */
#define MUXID_ALL	(-1)		/* dismantle all persistent links */

/******************************************************************************
 * Structures for SNX API functions: get_sockstate_info() & get_routing_tbl().
 */

struct SNX_sock_state {
        unsigned int proto;
        unsigned long recvq;
        unsigned long sendq;
        unsigned int laddr;
        unsigned short lport;
        unsigned int faddr;
        unsigned short fport;
        short state;
};

struct SNX_route_state {
#define IFNAMESZ        16
        int dest;
        int gateway;
        unsigned int flags;
        unsigned int refs;
        unsigned int use;
        char ifr_name[IFNAMESZ];
};

/*******************************************************************************
 *
 */
struct strioctl {
	int		ic_cmd;		/* downstream request */
	int		ic_timout;	/* timeout acknowledgement - ACK/NAK */
	int		ic_len;		/* length of data argument */
	char		*ic_dp;	/* pointer to data argument */
};


struct strbuf {
	int		maxlen;		/* maximum buffer length */
	int		len;		/* length of data */
	char	*buf;		/* pointer to buffer */
};


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


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


struct strrecvfd {
	int		fd;
	uid_t		uid;
	gid_t		gid;
	char		fill[8];
};


struct str_mlist {
	char		l_name[FMNAMESZ+1];
};


struct str_list {
	int		sl_nmods;
	struct str_mlist *sl_modlist;
};

#ifdef __cplusplus
}
#endif

#endif	/* __STROPTS_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -