#ifndef rapi_simple_h #define rapi_simple_h /* * @(#) $Id: scrapi.h,v 1.2 1998/09/09 23:49:39 lindell 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 #include #include #include #include #include #include #include #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 */ 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 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 int scrapi_getfd(const struct sockaddr *destination,int protocol); extern int scrapi_close(const struct sockaddr *destination,int protocol); extern int scrapi_dispatch(); extern scrapi_status scrapi_get_status(const struct sockaddr *destination, int protocol,const struct sockaddr *source); extern int scrapi_errno; extern const char *scrapi_errlist(int errno); extern void scrapi_perror(const char *); 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(const struct sockaddr *s, unsigned short port); extern int scrapi_sockaddr_any(struct sockaddr *s,int family); #endif /* rapi_simple_h */