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

📄 scrapi.h

📁 radius协议源码÷The Radius Stack will connect to a Radius Server. This stack implementation is built upo
💻 H
字号:
#ifndef	scrapi_h#define	scrapi_h/* * @(#) $Id: scrapi.h,v 1.1.1.1 2000/05/08 22:51:24 wenqing Exp $ *//****************************************************************************		SCRAPI: A Simplied RSVP API                USC Information Sciences Institute                Marina del Rey, California		Original Version:  Bob Lindell, March 1998.  Copyright (c) 1998 by the University of Southern California  All rights reserved.  Permission to use, copy, modify, and distribute this software and its  documentation in source and binary forms for any purpose and without  fee is hereby granted, provided that both the above copyright notice  and this permission notice appear in all copies, and that any  documentation, advertising materials, and other materials related to  such distribution and use acknowledge that the software was developed  in part by the University of Southern California, Information  Sciences Institute.  The name of the University may not be used to  endorse or promote products derived from this software without  specific prior written permission.  THE UNIVERSITY OF SOUTHERN CALIFORNIA makes no representations about  the suitability of this software for any purpose.  THIS SOFTWARE IS  PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,  INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  Other copyrights might apply to parts of this software and are so  noted when applicable.********************************************************************/#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <stdio.h>#if	defined(AF_INET6) && defined(IPPROTO_IPV6)#define	HAS_IPV6#endif	/* defined(AF_INET6) && defined(IPPROTO_IPV6) */#ifndef	NO_IPV6#ifdef	HAS_IPV6#define	USE_IPV6#endif	/* HAS_IPV6 */#endif	/* NO_IPV6 */#ifdef	USE_IPV6#define	SOCKADDR	sockaddr_in6#else	/* USE_IPV6 */#define	SOCKADDR	sockaddr_in#endif	/* USE_IPV6 *//* *	Error Codes */#define	SCRAPI_ERRNO_NONE		0	/* No error */#define	SCRAPI_ERRNO_SYSCALL		1	/* Syscall error, see errno */#define	SCRAPI_ERRNO_MEMORY		2	/* Memory allocation error */#define	SCRAPI_ERRNO_PARAM		3	/* Invalid parameters */#define	SCRAPI_ERRNO_INTERNAL		4	/* Internal SCRAPI error */#define	SCRAPI_ERRNO_DSTADDR		5	/* Bad destination address */#define	SCRAPI_ERRNO_DSTPORT		6	/* Bad destination port */#define	SCRAPI_ERRNO_PROTO		7	/* Bad protocol number */#define	SCRAPI_ERRNO_SRCADDR		8	/* Bad source address */#define	SCRAPI_ERRNO_SRCPORT		9	/* Bad source port */#define	SCRAPI_ERRNO_TIMEOUT		10	/* Request timed out */#define	SCRAPI_ERRNO_NORSVP		11	/* No RSVP support */#define	SCRAPI_ERRNO_SESSION		12	/* Too many sessions *//* *	Data type definitions */enum scrapi_style {	scrapi_style_shared,	scrapi_style_distinct};typedef enum scrapi_style scrapi_style;enum scrapi_service {	scrapi_service_cl,	scrapi_service_gs};typedef enum scrapi_service scrapi_service;enum scrapi_status {	scrapi_status_red,	scrapi_status_yellow,	scrapi_status_green};typedef enum scrapi_status scrapi_status;#include <rapi_lib.h>/* *	Function prototypes */extern int scrapi_sender(const struct sockaddr *destination,int protocol,	const struct sockaddr *source,double bw,int ttl,unsigned long msecs);extern int scrapi_receiver(const struct sockaddr *destination,int protocol,	const struct sockaddr *source,int reserve,scrapi_service service,	scrapi_style style,unsigned long msecs);extern scrapi_status scrapi_get_status(const struct sockaddr *destination,	int protocol,const struct sockaddr *source);extern int scrapi_close(const struct sockaddr *destination,int protocol,	const struct sockaddr *source);extern void scrapi_poll_list(fd_set *set);extern int scrapi_dispatch();extern int scrapi_errno(const struct sockaddr *destination,int protocol,	const struct sockaddr *source);extern void scrapi_perror(const struct sockaddr *destination,int protocol,	const struct sockaddr *source,const char *str);extern const char *scrapi_errlist(int errno);extern void scrapi_stderr(FILE *);extern void scrapi_debug(FILE *);extern int scrapi_sockaddr_multicast(const struct sockaddr *s);extern int scrapi_sockaddr_parse(struct sockaddr *s,const char *addr,	unsigned short port);extern const char * scrapi_sockaddr_print(const struct sockaddr *s);extern unsigned short scrapi_sockaddr_get_port(const struct sockaddr *s);extern int scrapi_sockaddr_set_port(struct sockaddr *s,unsigned short port);extern int scrapi_sockaddr_get_addr(const struct sockaddr *s,char *addr);extern int scrapi_sockaddr_set_addr(struct sockaddr *s,char *addr);extern int scrapi_sockaddr_any(struct sockaddr *s,int family);extern int scrapi_sockaddr_length(const struct sockaddr *s);#endif	/* scrapi_h */

⌨️ 快捷键说明

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