iPXE
|
SUN ONC RPC protocol. More...
#include <stdint.h>
#include <string.h>
#include <ipxe/iobuf.h>
#include <ipxe/refcnt.h>
#include <ipxe/oncrpc.h>
Go to the source code of this file.
Macros | |
#define | oncrpc_iob_add_string(buf, str) |
Add a string to the end of an I/O buffer. More... | |
#define | oncrpc_iob_get_int(buf) |
Get a 32 bits integer from the beginning of an I/O buffer. More... | |
#define | oncrpc_iob_get_int64(buf) |
Get a 64 bits integer from the beginning of an I/O buffer. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
size_t | oncrpc_iob_add_fields (struct io_buffer *io_buf, const struct oncrpc_field fields[]) |
size_t | oncrpc_iob_add_array (struct io_buffer *io_buf, size_t length, const void *data) |
Add an array of bytes to the end of an I/O buffer. More... | |
size_t | oncrpc_iob_add_intarray (struct io_buffer *io_buf, size_t length, const uint32_t *array) |
Add an int array to the end of an I/O buffer. More... | |
size_t | oncrpc_iob_add_cred (struct io_buffer *io_buf, const struct oncrpc_cred *cred) |
Add credential information to the end of an I/O buffer. More... | |
size_t | oncrpc_iob_get_cred (struct io_buffer *io_buf, struct oncrpc_cred *cred) |
Get credential information from the beginning of an I/O buffer. More... | |
static size_t | oncrpc_iob_add_int (struct io_buffer *io_buf, uint32_t val) |
Add a 32 bits integer to the end of an I/O buffer. More... | |
static size_t | oncrpc_iob_add_int64 (struct io_buffer *io_buf, uint64_t val) |
Add a 64 bits integer to the end of an I/O buffer. More... | |
SUN ONC RPC protocol.
Definition in file oncrpc_iob.h.
#define oncrpc_iob_add_string | ( | buf, | |
str | |||
) |
Add a string to the end of an I/O buffer.
io_buf | I/O buffer |
val | String |
size | Size of the data written |
Definition at line 25 of file oncrpc_iob.h.
#define oncrpc_iob_get_int | ( | buf | ) |
Get a 32 bits integer from the beginning of an I/O buffer.
buf | I/O buffer |
int | Integer |
Definition at line 38 of file oncrpc_iob.h.
#define oncrpc_iob_get_int64 | ( | buf | ) |
Get a 64 bits integer from the beginning of an I/O buffer.
buf | I/O buffer |
int | Integer |
Definition at line 52 of file oncrpc_iob.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
size_t oncrpc_iob_add_fields | ( | struct io_buffer * | io_buf, |
const struct oncrpc_field | fields[] | ||
) |
Definition at line 44 of file oncrpc_iob.c.
References oncrpc_field_value::array, oncrpc_field_value::cred, oncrpc_field_value::int32, oncrpc_field_value::int64, oncrpc_field_value::intarray, oncrpc_field_value::length, oncrpc_array, oncrpc_cred, oncrpc_int32, oncrpc_int64, oncrpc_intarray, oncrpc_iob_add_array(), oncrpc_iob_add_cred(), oncrpc_iob_add_int(), oncrpc_iob_add_int64(), oncrpc_iob_add_intarray(), oncrpc_iob_add_string, oncrpc_none, oncrpc_str, oncrpc_field_value::ptr, oncrpc_field_value::str, oncrpc_field::type, and oncrpc_field::value.
Referenced by oncrpc_call(), and oncrpc_iob_add_cred().
Add an array of bytes to the end of an I/O buffer.
io_buf | I/O buffer |
val | String |
size | Size of the data written |
In the ONC RPC protocol, every data is four byte paded, we add padding when necessary by using oncrpc_align()
Definition at line 103 of file oncrpc_iob.c.
References data, iob_put, length, memcpy(), memset(), oncrpc_align, and oncrpc_iob_add_int().
Referenced by oncrpc_iob_add_fields().
Add an int array to the end of an I/O buffer.
io_buf | I/O buffer |
length | Length od the array |
val | Int array |
size | Size of the data written |
Definition at line 122 of file oncrpc_iob.c.
References array, length, and oncrpc_iob_add_int().
Referenced by oncrpc_iob_add_fields().
size_t oncrpc_iob_add_cred | ( | struct io_buffer * | io_buf, |
const struct oncrpc_cred * | cred | ||
) |
Add credential information to the end of an I/O buffer.
io_buf | I/O buffer |
cred | Credential information |
size | Size of the data written |
Definition at line 141 of file oncrpc_iob.c.
References oncrpc_cred_sys::aux_gid, oncrpc_cred_sys::aux_gid_len, container_of, oncrpc_cred::flavor, oncrpc_cred_sys::gid, oncrpc_cred_sys::hostname, oncrpc_cred::length, ONCRPC_AUTH_NONE, ONCRPC_AUTH_SYS, ONCRPC_FIELD, ONCRPC_FIELD_END, oncrpc_iob_add_fields(), ONCRPC_SUBFIELD, oncrpc_cred_sys::stamp, and oncrpc_cred_sys::uid.
Referenced by oncrpc_iob_add_fields().
size_t oncrpc_iob_get_cred | ( | struct io_buffer * | io_buf, |
struct oncrpc_cred * | cred | ||
) |
Get credential information from the beginning of an I/O buffer.
io_buf | I/O buffer |
cred | Struct where the information will be saved |
size | Size of the data read |
Definition at line 189 of file oncrpc_iob.c.
References io_buffer::data, oncrpc_cred::flavor, iob_pull, oncrpc_cred::length, NULL, and oncrpc_iob_get_int.
Add a 32 bits integer to the end of an I/O buffer.
io_buf | I/O buffer |
val | Integer |
size | Size of the data written |
Definition at line 83 of file oncrpc_iob.h.
References htonl, iob_put, and val.
Referenced by nfs_iob_add_fh(), oncrpc_iob_add_array(), oncrpc_iob_add_fields(), and oncrpc_iob_add_intarray().
Add a 64 bits integer to the end of an I/O buffer.
io_buf | I/O buffer |
val | Integer |
size | Size of the data written |
Definition at line 96 of file oncrpc_iob.h.
References htonll, iob_put, and val.
Referenced by oncrpc_iob_add_fields().