55 void *
data,
size_t len,
int *found ) {
58 strlen ( parent_name ) + 1 +
69 "info-get guestinfo.ipxe.%s%s%s%s%s",
70 parent_name, ( parent_name[0] ?
"." :
"" ),
setting->
name,
77 goto err_get_info_len;
86 type = ( predefined ? predefined->
type : &setting_type_string );
93 DBGC (
settings,
"GuestInfo %p could not allocate %d bytes\n",
103 if ( check_len < 0 ) {
108 DBGC (
settings,
"GuestInfo %p length mismatch (expected %d, " 119 DBGC (
settings,
"GuestInfo %p could not parse \"%s\" as %s: " 187 DBG (
"GuestInfo could not open channel: %s\n",
194 "vmware" ) ) != 0 ) {
195 DBG (
"GuestInfo could not register settings: %s\n",
225 "vmware" ) ) != 0 ) {
226 DBGC (
settings,
"GuestInfo %p could not register for %s: %s\n",
239 .priv_len =
sizeof (
struct settings ),
static int guestinfo_fetch(struct settings *settings, struct setting *setting, void *data, size_t len)
Fetch value of GuestInfo setting.
struct arbelprm_rc_send_wqe rc
struct init_fn guestinfo_init_fn __init_fn(INIT_NORMAL)
GuestInfo settings initialiser.
int guestrpc_open(void)
Open GuestRPC channel.
struct settings * parent
Parent settings block.
uint32_t type
Operating system type.
#define ENOENT
No such file or directory.
A network upper-layer driver.
static struct settings * netdev_settings(struct net_device *netdev)
Get per-netdevice configuration settings block.
static void settings_init(struct settings *settings, struct settings_operations *op, struct refcnt *refcnt, const struct settings_scope *default_scope)
Initialise a settings block.
static int guestinfo_channel
GuestInfo GuestRPC channel.
#define ENOMEM
Not enough space.
#define INIT_NORMAL
Normal initialisation.
An initialisation function.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
uint8_t info_len
Reject information length.
VMware GuestRPC mechanism.
static struct net_device * netdev
const struct setting_type * type
Setting type.
FILE_LICENCE(GPL2_OR_LATER)
int guestrpc_command(int channel, const char *command, char *reply, size_t reply_len)
Issue GuestRPC command.
static int guestinfo_fetch_type(struct settings *settings, struct setting *setting, const struct setting_type *type, void *data, size_t len, int *found)
Fetch value of typed GuestInfo setting.
char * strerror(int errno)
Retrieve string representation of error number.
struct refcnt refcnt
Reference counter.
static void(* free)(struct refcnt *refcnt))
void * zalloc(size_t size)
Allocate cleared memory.
static int guestinfo_net_probe(struct net_device *netdev, void *priv)
Create per-netdevice GuestInfo settings.
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
struct net_driver guestinfo_net_driver __net_driver
GuestInfo per-netdevice driver.
size_t strlen(const char *src)
Get length of string.
Settings block operations.
struct list_head siblings
Sibling settings blocks.
Network device management.
static struct settings guestinfo_settings
GuestInfo settings.
char name[NETDEV_NAME_LEN]
Name of this network device.
static void guestinfo_init(void)
Initialise GuestInfo settings.
static struct tlan_private * priv
static struct settings_operations guestinfo_settings_operations
GuestInfo settings operations.
int(* fetch)(struct settings *settings, struct setting *setting, void *data, size_t len)
Fetch value of setting.
#define EIO
Input/output error.
uint8_t data[48]
Additional event data.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
struct list_head children
Child settings blocks.
int register_settings(struct settings *settings, struct settings *parent, const char *name)
Register settings block.
#define SETTING_TYPES
Configuration setting type table.
struct setting * find_setting(const char *name)
Find predefined setting.
#define DBG(...)
Print a debugging message.
#define LIST_HEAD_INIT(list)
Initialise a static list head.
int setting_parse(const struct setting_type *type, const char *value, void *buf, size_t len)
Parse formatted string to setting value.
#define NULL
NULL pointer (VOID *)
struct refcnt * refcnt
Reference counter.