88 default_type = &setting_type_ipv4;
94 default_type = &setting_type_ipv6;
153 char *setting_name_copy;
165 setting_name_copy = ( (
void * ) (
nslookup + 1 ) );
static void nslookup_close(struct nslookup *nslookup, int rc)
Terminate name resolution.
An object interface operation.
struct arbelprm_rc_send_wqe rc
void intf_close(struct interface *intf, int rc)
Close an object interface.
void intf_shutdown(struct interface *intf, int rc)
Shut down an object interface.
#define AF_INET6
IPv6 Internet addresses.
int printf(const char *fmt,...)
Write a formatted string to the console.
int monojob_wait(const char *string, unsigned long timeout)
Wait for single foreground job to complete.
void resolv_done(struct interface *intf, struct sockaddr *sa)
Name resolved.
#define ref_init(refcnt, free)
Initialise a reference counter.
Standalone name resolution.
static struct interface_descriptor nslookup_resolver_desc
Name resolution resolver interface descriptor.
struct refcnt refcnt
Reference count for this object.
sa_family_t sa_family
Socket address family.
struct interface job
Job control interface.
void intf_plug_plug(struct interface *a, struct interface *b)
Plug two object interfaces together.
int store_setting(struct settings *settings, const struct setting *setting, const void *data, size_t len)
Store value of setting.
char * setting_name
Setting name.
#define ENOTSUP
Operation not supported.
static int resolv_setting(struct interface *job, const char *name, const char *setting_name)
Initiate standalone name resolution.
#define ENOMEM
Not enough space.
static struct interface_operation nslookup_job_operations[]
Name resolution job control interface operations.
FILE_LICENCE(GPL2_OR_LATER)
struct interface resolver
Data transfer interface.
Transport-network layer interface.
char * strcpy(char *dest, const char *src)
Copy string.
const struct setting_type * type
Setting type.
struct settings * autovivify_child_settings(struct settings *parent, const char *name)
Find or create child settings block.
static struct interface_operation nslookup_resolver_operations[]
Name resolution resolver interface operations.
Generalized socket address structure.
An object interface descriptor.
char * strerror(int errno)
Retrieve string representation of error number.
void * zalloc(size_t size)
Allocate cleared memory.
#define INTF_OP(op_type, object_type, op_func)
Define an object interface operation.
static struct interface_descriptor nslookup_job_desc
Name resolution job control interface descriptor.
size_t strlen(const char *src)
Get length of string.
int nslookup(const char *name, const char *setting_name)
Perform (blocking) standalone name resolution.
struct in_addr sin_addr
IPv4 address.
static void nslookup_resolv_done(struct nslookup *nslookup, struct sockaddr *sa)
Handle resolved name.
uint8_t data[48]
Additional event data.
int resolv(struct interface *resolv, const char *name, struct sockaddr *sa)
Start name resolution.
#define INTF_DESC_PASSTHRU(object_type, intf, operations, passthru)
Define an object interface descriptor with pass-through interface.
static void intf_init(struct interface *intf, struct interface_descriptor *desc, struct refcnt *refcnt)
Initialise an object interface.
int setting_name(struct settings *settings, const struct setting *setting, char *buf, size_t len)
Return full setting name.
#define NULL
NULL pointer (VOID *)
#define AF_INET
IPv4 Internet addresses.
int parse_setting_name(char *name, get_child_settings_t get_child, struct settings **settings, struct setting *setting)
Parse setting name.
struct in6_addr sin6_addr
IPv6 address.
A name resolution request.
#define ref_put(refcnt)
Drop reference to object.
void * memset(void *dest, int character, size_t len) __nonnull