iPXE
|
Data transfer interface opening. More...
Go to the source code of this file.
Data Structures | |
struct | uri_opener |
A URI opener. More... | |
struct | socket_opener |
A socket opener. More... | |
Macros | |
#define | URI_OPENERS __table ( struct uri_opener, "uri_openers" ) |
URI opener table. More... | |
#define | __uri_opener __table_entry ( URI_OPENERS, 01 ) |
Register a URI opener. More... | |
#define | SOCKET_OPENERS __table ( struct socket_opener, "socket_openers" ) |
Socket opener table. More... | |
#define | __socket_opener __table_entry ( SOCKET_OPENERS, 01 ) |
Register a socket opener. More... | |
Enumerations | |
enum | { LOCATION_URI = 1, LOCATION_URI_STRING, LOCATION_SOCKET } |
Location types. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
struct uri_opener * | xfer_uri_opener (const char *scheme) |
Find opener for URI scheme. More... | |
int | xfer_open_uri (struct interface *intf, struct uri *uri) |
Open URI. More... | |
int | xfer_open_uri_string (struct interface *intf, const char *uri_string) |
Open URI string. More... | |
int | xfer_open_named_socket (struct interface *intf, int semantics, struct sockaddr *peer, const char *name, struct sockaddr *local) |
Open named socket. More... | |
int | xfer_open_socket (struct interface *intf, int semantics, struct sockaddr *peer, struct sockaddr *local) |
Open socket. More... | |
int | xfer_vopen (struct interface *intf, int type, va_list args) |
Open location. More... | |
int | xfer_open (struct interface *intf, int type,...) |
Open location. More... | |
int | xfer_vreopen (struct interface *intf, int type, va_list args) |
Reopen location. More... | |
Data transfer interface opening.
Definition in file open.h.
#define URI_OPENERS __table ( struct uri_opener, "uri_openers" ) |
struct uri_opener mtftp_uri_opener __uri_opener __table_entry ( URI_OPENERS, 01 ) |
#define SOCKET_OPENERS __table ( struct socket_opener, "socket_openers" ) |
#define __socket_opener __table_entry ( SOCKET_OPENERS, 01 ) |
anonymous enum |
Location types.
Definition at line 20 of file open.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
struct uri_opener* xfer_uri_opener | ( | const char * | scheme | ) |
Find opener for URI scheme.
scheme | URI scheme |
opener | Opener, or NULL |
Definition at line 47 of file open.c.
References for_each_table_entry, NULL, uri_opener::scheme, strcasecmp(), and URI_OPENERS.
Referenced by netboot(), and xfer_open_uri().
Open URI.
intf | Data transfer interface |
uri | URI |
rc | Return status code |
The URI will be regarded as being relative to the current working URI (see churi()).
Definition at line 67 of file open.c.
References cwuri, DBGC, ENOMEM, ENOTSUP, INTF_COL, INTF_DBG, INTF_FMT, uri_opener::open, rc, resolve_uri(), uri::scheme, strerror(), uri_put(), and xfer_uri_opener().
Referenced by create_downloader(), efi_pxe_tftp_open(), pxe_tftp_open(), sanpath_open(), xfer_open_uri_string(), and xfer_vopen().
int xfer_open_uri_string | ( | struct interface * | intf, |
const char * | uri_string | ||
) |
Open URI string.
intf | Data transfer interface |
uri_string | URI string (e.g. "http://ipxe.org/kernel") |
rc | Return status code |
The URI will be regarded as being relative to the current working URI (see churi()).
Definition at line 115 of file open.c.
References DBGC, ENOMEM, INTF_COL, INTF_DBG, INTF_FMT, parse_uri(), rc, uri_put(), and xfer_open_uri().
Referenced by open(), validator_start_download(), validator_start_ocsp(), and xfer_vopen().
int xfer_open_named_socket | ( | struct interface * | xfer, |
int | semantics, | ||
struct sockaddr * | peer, | ||
const char * | name, | ||
struct sockaddr * | local | ||
) |
Open named socket.
semantics | Communication semantics (e.g. SOCK_STREAM) |
peer | Peer socket address to complete |
name | Name to resolve |
local | Local socket address, or NULL |
rc | Return status code |
Definition at line 402 of file resolv.c.
References DBGC, ENOMEM, named_socket::have_local, intf_init(), intf_plug_plug(), named_socket::local, memcpy(), name, named_resolv_desc, named_xfer_desc, NULL, peer, rc, ref_init, ref_put, named_socket::refcnt, named_socket::resolv, resolv(), named_socket::semantics, named_socket::xfer, and zalloc().
Referenced by apply_syslogs_settings(), create_pinger(), ftp_open(), http_connect(), iscsi_open_connection(), nfs_connect(), slam_open(), start_ntp(), tcp_open_uri(), tftp_reopen(), and udp_open_uri().
int xfer_open_socket | ( | struct interface * | intf, |
int | semantics, | ||
struct sockaddr * | peer, | ||
struct sockaddr * | local | ||
) |
Open socket.
intf | Data transfer interface |
semantics | Communication semantics (e.g. SOCK_STREAM) |
peer | Peer socket address |
local | Local socket address, or NULL |
rc | Return status code |
Definition at line 142 of file open.c.
References DBGC, ENOTSUP, for_each_table_entry, INTF_COL, INTF_DBG, INTF_FMT, socket_opener::open, peer, socket_opener::semantics, socket_family_name(), SOCKET_OPENERS, and socket_semantics_name().
Referenced by apply_syslog_settings(), dns_resolv(), ftp_reply(), peerdisc_socket_open(), slam_open(), start_dhcp(), start_dhcpv6(), start_pxebs(), tftp_reopen_mc(), and xfer_vopen().
Open location.
intf | Data transfer interface |
type | Location type |
args | Remaining arguments depend upon location type |
rc | Return status code |
Definition at line 170 of file open.c.
References DBGC, ENOTSUP, INTF_COL, INTF_DBG, INTF_FMT, LOCATION_SOCKET, LOCATION_URI, LOCATION_URI_STRING, peer, type, va_arg, xfer_open_socket(), xfer_open_uri(), and xfer_open_uri_string().
Referenced by xfer_open(), and xfer_vreopen().
int xfer_open | ( | struct interface * | intf, |
int | type, | ||
... | |||
) |
Open location.
intf | Data transfer interface |
type | Location type |
... | Remaining arguments depend upon location type |
rc | Return status code |
Definition at line 202 of file open.c.
References rc, type, va_end, va_start, and xfer_vopen().
Referenced by efi_download_start().
Reopen location.
intf | Data transfer interface |
type | Location type |
args | Remaining arguments depend upon location type |
rc | Return status code |
This will close the existing connection and open a new connection using xfer_vopen(). It is intended to be used as a .vredirect method handler.
Definition at line 224 of file open.c.
References intf_restart(), type, and xfer_vopen().
Referenced by downloader_vredirect(), iscsi_vredirect(), and xfer_vredirect().