iPXE
|
SUN ONC RPC protocol. More...
Go to the source code of this file.
Data Structures | |
struct | oncrpc_cred |
struct | oncrpc_cred_sys |
struct | oncrpc_reply |
struct | oncrpc_session |
union | oncrpc_field_value |
struct | oncrpc_field |
Macros | |
#define | ONCRPC_VERS 2 |
ONC RCP Version. More... | |
#define | ONCRPC_AUTH_NONE 0 |
ONC RPC Null Authentication. More... | |
#define | ONCRPC_AUTH_SYS 1 |
ONC RPC System Authentication (also called UNIX Authentication) More... | |
#define | ONCRPC_HEADER_SIZE ( 11 * sizeof ( uint32_t ) ) |
Size of an ONC RPC header. More... | |
#define | ONCRPC_FIELD(type, value) { oncrpc_ ## type, { .type = value } } |
#define | ONCRPC_SUBFIELD(type, args...) { oncrpc_ ## type, { .type = { args } } } |
#define | ONCRPC_FIELD_END { oncrpc_none, { } } |
#define | oncrpc_align(size) ( ( (size) + 3 ) & ~3 ) |
Enusure that size is a multiple of four. More... | |
#define | oncrpc_strlen(str) |
Calculate the length of a string, including padding bytes. More... | |
Enumerations | |
enum | oncrpc_field_type { oncrpc_none = 0, oncrpc_int32, oncrpc_int64, oncrpc_str, oncrpc_array, oncrpc_intarray, oncrpc_cred } |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
int | oncrpc_init_cred_sys (struct oncrpc_cred_sys *auth_sys) |
Initialize an ONC RPC AUTH SYS credential structure. More... | |
void | oncrpc_init_session (struct oncrpc_session *session, struct oncrpc_cred *credential, struct oncrpc_cred *verifier, uint32_t prog_name, uint32_t prog_vers) |
Prepare an ONC RPC session structure to be used by the ONC RPC layer. More... | |
int | oncrpc_call (struct interface *intf, struct oncrpc_session *session, uint32_t proc_name, const struct oncrpc_field fields[]) |
size_t | oncrpc_compute_size (const struct oncrpc_field fields[]) |
int | oncrpc_get_reply (struct oncrpc_session *session, struct oncrpc_reply *reply, struct io_buffer *io_buf) |
Variables | |
struct oncrpc_cred | oncrpc_auth_none |
AUTH NONE authentication flavor. More... | |
SUN ONC RPC protocol.
Definition in file oncrpc.h.
#define ONCRPC_AUTH_SYS 1 |
#define ONCRPC_HEADER_SIZE ( 11 * sizeof ( uint32_t ) ) |
#define ONCRPC_FIELD_END { oncrpc_none, { } } |
#define oncrpc_strlen | ( | str | ) |
Calculate the length of a string, including padding bytes.
str | String |
size | Length of the padded string |
enum oncrpc_field_type |
Enumerator | |
---|---|
oncrpc_none | |
oncrpc_int32 | |
oncrpc_int64 | |
oncrpc_str | |
oncrpc_array | |
oncrpc_intarray | |
oncrpc_cred |
Definition at line 80 of file oncrpc.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
int oncrpc_init_cred_sys | ( | struct oncrpc_cred_sys * | auth_sys | ) |
Initialize an ONC RPC AUTH SYS credential structure.
auth_sys | The structure to initialize |
The hostname field is filled with the value of the hostname setting, if the hostname setting is empty, PRODUCT_SHORT_NAME (usually "iPXE") is used instead.
Definition at line 84 of file oncrpc.c.
References oncrpc_cred_sys::aux_gid_len, oncrpc_cred_sys::credential, EINVAL, ENOMEM, fetch_string_setting_copy(), fetch_uintz_setting(), oncrpc_cred::flavor, oncrpc_cred_sys::gid, oncrpc_cred_sys::hostname, oncrpc_cred::length, NULL, ONCRPC_AUTH_SYS, oncrpc_strlen, product_short_name, oncrpc_cred_sys::stamp, strdup(), and oncrpc_cred_sys::uid.
Referenced by nfs_open().
void oncrpc_init_session | ( | struct oncrpc_session * | session, |
struct oncrpc_cred * | credential, | ||
struct oncrpc_cred * | verifier, | ||
uint32_t | prog_name, | ||
uint32_t | prog_vers | ||
) |
Prepare an ONC RPC session structure to be used by the ONC RPC layer.
session | ONC RPC session |
credential | Credential structure pointer |
verifier | Verifier structure pointer |
prog_name | ONC RPC program number |
prog_vers | ONC RPC program version number |
Definition at line 115 of file oncrpc.c.
References oncrpc_session::credential, oncrpc_session::prog_name, oncrpc_session::prog_vers, rand(), oncrpc_session::rpc_id, and oncrpc_session::verifier.
Referenced by mount_init_session(), nfs_init_session(), and portmap_init_session().
int oncrpc_call | ( | struct interface * | intf, |
struct oncrpc_session * | session, | ||
uint32_t | proc_name, | ||
const struct oncrpc_field | fields[] | ||
) |
Definition at line 129 of file oncrpc.c.
References alloc_iob(), oncrpc_session::credential, EINVAL, ENOBUFS, header, iob_disown, ONCRPC_CALL, oncrpc_compute_size(), ONCRPC_FIELD, ONCRPC_FIELD_END, oncrpc_iob_add_fields(), ONCRPC_VERS, oncrpc_session::prog_name, oncrpc_session::prog_vers, oncrpc_session::rpc_id, SET_LAST_FRAME, oncrpc_session::verifier, and xfer_deliver_iob().
Referenced by mount_mnt(), mount_umnt(), nfs_lookup(), nfs_read(), nfs_readlink(), and portmap_getport().
size_t oncrpc_compute_size | ( | const struct oncrpc_field | fields[] | ) |
Definition at line 166 of file oncrpc.c.
References oncrpc_field_value::cred, oncrpc_cred::length, oncrpc_align, oncrpc_array, oncrpc_cred, oncrpc_int32, oncrpc_int64, oncrpc_intarray, oncrpc_none, oncrpc_str, oncrpc_strlen, size, type, oncrpc_field::type, value, and oncrpc_field::value.
Referenced by oncrpc_call().
int oncrpc_get_reply | ( | struct oncrpc_session * | session, |
struct oncrpc_reply * | reply, | ||
struct io_buffer * | io_buf | ||
) |
struct oncrpc_cred oncrpc_auth_none |
AUTH NONE authentication flavor.
Definition at line 56 of file oncrpc.c.
Referenced by mount_init_session(), nfs_init_session(), oncrpc_get_reply(), and portmap_init_session().