iPXE
|
Data transfer interfaces. More...
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <ipxe/iobuf.h>
#include <ipxe/xfer.h>
#include <ipxe/open.h>
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
int | xfer_vredirect (struct interface *intf, int type, va_list args) |
Send redirection event. More... | |
size_t | xfer_window (struct interface *intf) |
Check flow control window. More... | |
void | xfer_window_changed (struct interface *intf) |
Report change of flow control window. More... | |
struct io_buffer * | xfer_alloc_iob (struct interface *intf, size_t len) |
Allocate I/O buffer. More... | |
int | xfer_deliver (struct interface *intf, struct io_buffer *iobuf, struct xfer_metadata *meta) |
Deliver datagram. More... | |
int | xfer_redirect (struct interface *intf, int type,...) |
Send redirection event. More... | |
int | xfer_deliver_iob (struct interface *intf, struct io_buffer *iobuf) |
Deliver datagram as I/O buffer without metadata. More... | |
int | xfer_deliver_raw_meta (struct interface *intf, const void *data, size_t len, struct xfer_metadata *meta) |
Deliver datagram as raw data. More... | |
int | xfer_deliver_raw (struct interface *intf, const void *data, size_t len) |
Deliver datagram as raw data without metadata. More... | |
int | xfer_vprintf (struct interface *intf, const char *format, va_list args) |
Deliver formatted string. More... | |
int | xfer_printf (struct interface *intf, const char *format,...) |
Deliver formatted string. More... | |
int | xfer_seek (struct interface *intf, off_t offset) |
Seek to position. More... | |
int | xfer_check_order (struct xfer_metadata *meta, size_t *pos, size_t len) |
Check that data is delivered strictly in order. More... | |
Variables | |
static struct xfer_metadata | dummy_metadata |
Dummy transfer metadata. More... | |
Data transfer interfaces.
Definition in file xfer.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
Send redirection event.
intf | Data transfer interface |
type | New location type |
args | Remaining arguments depend upon location type |
rc | Return status code |
Definition at line 62 of file xfer.c.
References DBGC, dest, interface::intf, intf_close(), INTF_COL, intf_get_dest_op_no_passthru, INTF_INTF_DBG, INTF_INTF_FMT, intf_object(), intf_plug(), intf_put(), intf_temp_init(), intf_unplug(), op, rc, strerror(), tmp, type, xfer_vredirect(), xfer_vredirect_TYPE, xfer_vreopen(), and xfer_window_changed().
Referenced by xfer_redirect(), and xfer_vredirect().
Check flow control window.
intf | Data transfer interface |
len | Length of window |
Definition at line 116 of file xfer.c.
References dest, interface::intf, intf_get_dest_op, intf_object(), intf_put(), len, op, xfer_window(), and xfer_window_TYPE.
Referenced by efi_local_step(), fc_port_window_changed(), fcpcmd_send_wrdata(), http_step(), hw_step(), ipair_window_changed(), iscsi_tx_step(), nfs_mount_step(), nfs_pm_step(), nfs_step(), pinger_window_changed(), pxenv_tftp_open(), sanpath_step(), scsidev_step(), scsidev_window(), syslogs_window_changed(), tcp_xmit_sack(), tftp_send_packet(), tftp_send_rrq(), tls_cipherstream_window(), tls_plainstream_window(), tls_tx_step(), xcm_step(), and xfer_window().
void xfer_window_changed | ( | struct interface * | intf | ) |
Report change of flow control window.
intf | Data transfer interface |
Note that this method is used to indicate only unsolicited changes in the flow control window. In particular, this method must not be called as part of the response to xfer_deliver(), since that could easily lead to an infinite loop. Callers of xfer_deliver() should assume that the flow control window will have changed without generating an xfer_window_changed() message.
Definition at line 146 of file xfer.c.
References interface::intf, intf_poke(), and xfer_window_changed().
Referenced by aoedev_config_done(), fcoe_expired(), fcoe_reset(), fcpdev_examine(), http_step(), ib_cmrc_changed(), iscsi_rx_login_response(), scsidev_ready(), srp_login_rsp(), tcp_rx(), tls_new_finished(), tls_tx_step(), xfer_vredirect(), and xfer_window_changed().
Allocate I/O buffer.
intf | Data transfer interface |
len | I/O buffer payload length |
iobuf | I/O buffer |
Definition at line 158 of file xfer.c.
References alloc_iob(), DBGC, dest, interface::intf, INTF_COL, intf_get_dest_op, INTF_INTF_DBG, INTF_INTF_FMT, intf_object(), intf_put(), len, op, xfer_alloc_iob(), and xfer_alloc_iob_TYPE.
Referenced by dhcp_tx(), dhcpv6_tx(), efi_local_step(), efi_pxe_udp_write(), fc_xchg_alloc_iob(), fcpcmd_send_cmnd(), fcpcmd_send_wrdata(), ipair_tx(), iscsi_tx_data_out(), iscsi_tx_login_request(), pinger_expired(), pxenv_udp_write(), slam_tx_nack(), srp_cmd(), srp_login(), tftp_send_ack(), tftp_send_error(), tftp_send_rrq(), tls_send_plaintext(), xfer_alloc_iob(), xfer_deliver_raw_meta(), and xfer_seek().
int xfer_deliver | ( | struct interface * | intf, |
struct io_buffer * | iobuf, | ||
struct xfer_metadata * | meta | ||
) |
Deliver datagram.
intf | Data transfer interface |
iobuf | Datagram I/O buffer |
meta | Data transfer metadata |
rc | Return status code |
Definition at line 194 of file xfer.c.
References DBGC, dest, EPIPE, free_iob(), interface::intf, INTF_COL, intf_get_dest_op, INTF_INTF_DBG, INTF_INTF_FMT, intf_object(), intf_put(), iob_len(), meta(), op, rc, strerror(), xfer_deliver(), and xfer_deliver_TYPE.
Referenced by dhcp_tx(), efi_pxe_udp_write(), fc_xchg_rx(), fcpcmd_send_cmnd(), fcpcmd_send_wrdata(), http_conn_socket_deliver(), http_content_deliver(), peerblk_deliver(), peermux_block_deliver(), ping_rx(), pinger_expired(), pxenv_udp_write(), slam_mc_socket_deliver(), tftp_rx_data(), tftp_send_ack(), tftp_send_error(), udp_rx(), xfer_buffer(), xfer_deliver(), xfer_deliver_iob(), xfer_deliver_raw_meta(), and xfer_seek().
int xfer_redirect | ( | struct interface * | intf, |
int | type, | ||
... | |||
) |
Send redirection event.
intf | Data transfer interface |
type | New location type |
... | Remaining arguments depend upon location type |
rc | Return status code |
Definition at line 238 of file xfer.c.
References interface::intf, rc, type, va_end, va_start, and xfer_vredirect().
Referenced by http_redirect(), and named_resolv_done().
Deliver datagram as I/O buffer without metadata.
intf | Data transfer interface |
iobuf | Datagram I/O buffer |
rc | Return status code |
Definition at line 255 of file xfer.c.
References dummy_metadata, interface::intf, and xfer_deliver().
Referenced by dhcpv6_tx(), efi_local_step(), fc_xchg_tx(), fcoe_rx(), http_rx_chunk_data(), http_rx_transfer_identity(), http_tx_request(), ib_cmrc_complete_recv(), imux_rx_tcp(), ipair_tx(), iscsi_tx_data_out(), iscsi_tx_login_request(), nfs_deliver(), oncrpc_call(), slam_tx_nack(), srp_cmd(), srp_login(), tcp_rx_data(), tftp_send_rrq(), tls_new_data(), and tls_send_plaintext().
int xfer_deliver_raw_meta | ( | struct interface * | intf, |
const void * | data, | ||
size_t | len, | ||
struct xfer_metadata * | meta | ||
) |
Deliver datagram as raw data.
intf | Data transfer interface |
data | Data |
len | Length of data |
meta | Data transfer metadata |
rc | Return status code |
Definition at line 268 of file xfer.c.
References data, ENOMEM, iob_put, len, memcpy(), meta(), xfer_alloc_iob(), and xfer_deliver().
Referenced by dns_send_packet(), fc_els_tx(), fc_ns_query_step(), peerdisc_socket_tx(), and xfer_deliver_raw().
Deliver datagram as raw data without metadata.
intf | Data transfer interface |
data | Data |
len | Length of data |
rc | Return status code |
Definition at line 288 of file xfer.c.
References data, dummy_metadata, len, and xfer_deliver_raw_meta().
Referenced by fcoe_fip_rx_els_response(), hw_step(), ib_cmrc_changed(), iscsi_tx_bhs(), ntp_request(), slam_finished(), xcm_step(), xfer_vprintf(), xsmp_tx_session(), and xsmp_tx_xve().
Deliver formatted string.
intf | Data transfer interface |
format | Format string |
args | Arguments corresponding to the format string |
rc | Return status code |
Definition at line 300 of file xfer.c.
References format, free, len, rc, va_copy, va_end, vasprintf(), and xfer_deliver_raw().
Referenced by xfer_printf().
int xfer_printf | ( | struct interface * | intf, |
const char * | format, | ||
... | |||
) |
Deliver formatted string.
intf | Data transfer interface |
format | Format string |
... | Arguments corresponding to the format string |
rc | Return status code |
Definition at line 334 of file xfer.c.
References format, rc, va_end, va_start, and xfer_vprintf().
Referenced by ftp_next_state(), and syslog_send().
Seek to position.
intf | Data transfer interface |
offset | Offset to new position |
rc | Return status code |
Definition at line 351 of file xfer.c.
References DBGC, ENOMEM, INTF_COL, INTF_DBG, INTF_FMT, meta(), offset, xfer_alloc_iob(), xfer_deliver(), and XFER_FL_ABS_OFFSET.
Referenced by efi_local_step(), ftp_reply(), http_rx_chunk_len(), http_rx_headers(), nfs_deliver(), peermux_info_close(), slam_pull_header(), and tftp_presize().
int xfer_check_order | ( | struct xfer_metadata * | meta, |
size_t * | pos, | ||
size_t | len | ||
) |
Check that data is delivered strictly in order.
meta | Data transfer metadata |
pos | Current position |
len | Length of data |
rc | Return status code |
Definition at line 377 of file xfer.c.
References EPROTO, len, meta(), and XFER_FL_ABS_OFFSET.
Referenced by peerblk_raw_rx().
|
static |
Dummy transfer metadata.
This gets passed to xfer_interface::deliver() and equivalents when no metadata is available.
Definition at line 46 of file xfer.c.
Referenced by xfer_deliver_iob(), and xfer_deliver_raw().