2
0
mirror of https://github.com/xcat2/xNBA.git synced 2026-03-26 00:03:28 +00:00
Files
xNBA/src/include/ipxe/open.h
Michael Brown 8406115834 [build] Rename gPXE to iPXE
Access to the gpxe.org and etherboot.org domains and associated
resources has been revoked by the registrant of the domain.  Work
around this problem by renaming project from gPXE to iPXE, and
updating URLs to match.

Also update README, LOG and COPYRIGHTS to remove obsolete information.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-04-19 23:43:39 +01:00

106 lines
2.5 KiB
C

#ifndef _IPXE_OPEN_H
#define _IPXE_OPEN_H
/** @file
*
* Data transfer interface opening
*
*/
FILE_LICENCE ( GPL2_OR_LATER );
#include <stdarg.h>
#include <ipxe/tables.h>
#include <ipxe/socket.h>
struct xfer_interface;
struct uri;
/** Location types */
enum {
/** Location is a URI
*
* Parameter list for open() is:
*
* struct uri *uri;
*/
LOCATION_URI = 1,
/** Location is a URI string
*
* Parameter list for open() is:
*
* const char *uri_string;
*/
LOCATION_URI_STRING,
/** Location is a socket
*
* Parameter list for open() is:
*
* int semantics;
* struct sockaddr *peer;
* struct sockaddr *local;
*/
LOCATION_SOCKET,
};
/** A URI opener */
struct uri_opener {
/** URI protocol name
*
* This is the "scheme" portion of the URI, e.g. "http" or
* "file".
*/
const char *scheme;
/** Open URI
*
* @v xfer Data transfer interface
* @v uri URI
* @ret rc Return status code
*/
int ( * open ) ( struct xfer_interface *xfer, struct uri *uri );
};
/** URI opener table */
#define URI_OPENERS __table ( struct uri_opener, "uri_openers" )
/** Register a URI opener */
#define __uri_opener __table_entry ( URI_OPENERS, 01 )
/** A socket opener */
struct socket_opener {
/** Communication semantics (e.g. SOCK_STREAM) */
int semantics;
/** Address family (e.g. AF_INET) */
int family;
/** Open socket
*
* @v xfer Data transfer interface
* @v peer Peer socket address
* @v local Local socket address, or NULL
* @ret rc Return status code
*/
int ( * open ) ( struct xfer_interface *xfer, struct sockaddr *peer,
struct sockaddr *local );
};
/** Socket opener table */
#define SOCKET_OPENERS __table ( struct socket_opener, "socket_openers" )
/** Register a socket opener */
#define __socket_opener __table_entry ( SOCKET_OPENERS, 01 )
extern int xfer_open_uri ( struct xfer_interface *xfer, struct uri *uri );
extern int xfer_open_uri_string ( struct xfer_interface *xfer,
const char *uri_string );
extern int xfer_open_named_socket ( struct xfer_interface *xfer,
int semantics, struct sockaddr *peer,
const char *name, struct sockaddr *local );
extern int xfer_open_socket ( struct xfer_interface *xfer, int semantics,
struct sockaddr *peer, struct sockaddr *local );
extern int xfer_vopen ( struct xfer_interface *xfer, int type, va_list args );
extern int xfer_open ( struct xfer_interface *xfer, int type, ... );
extern int xfer_vreopen ( struct xfer_interface *xfer, int type,
va_list args );
#endif /* _IPXE_OPEN_H */