![]() |
![]() |
![]() |
libuhttpmock Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#include <libuhttpmock/uhm-resolver.h> UhmResolver; UhmResolverClass; UhmResolver * uhm_resolver_new (void
); void uhm_resolver_reset (UhmResolver *self
); gboolean uhm_resolver_add_A (UhmResolver *self
,const gchar *hostname
,const gchar *addr
); gboolean uhm_resolver_add_SRV (UhmResolver *self
,const gchar *service
,const gchar *protocol
,const gchar *domain
,const gchar *addr
,guint16 port
);
A mock DNS resolver which resolves according to specified host-name–IP-address pairs, and raises an error for all non-specified host name requests. This allows network connections for expected services to be redirected to a different server, such as a local mock server on a loopback interface.
typedef struct _UhmResolver UhmResolver;
All the fields in the UhmResolver structure are private and should never be accessed directly.
Since 0.1.0
typedef struct { } UhmResolverClass;
All the fields in the UhmResolverClass structure are private and should never be accessed directly.
Since 0.1.0
UhmResolver * uhm_resolver_new (void
);
Creates a new UhmResolver with default property values.
Returns : |
a new UhmResolver; unref with g_object_unref() . [transfer full]
|
void uhm_resolver_reset (UhmResolver *self
);
Resets the state of the UhmResolver, deleting all records added with uhm_resolver_add_A()
and uhm_resolver_add_SRV()
.
|
a UhmResolver |
gboolean uhm_resolver_add_A (UhmResolver *self
,const gchar *hostname
,const gchar *addr
);
Adds a resolution mapping from the host name hostname
to the IP address addr
.
|
a UhmResolver |
|
the hostname to match |
|
the IP address to resolve to |
Returns : |
TRUE on success; FALSE otherwise |
Since 0.1.0
gboolean uhm_resolver_add_SRV (UhmResolver *self
,const gchar *service
,const gchar *protocol
,const gchar *domain
,const gchar *addr
,guint16 port
);
Adds a resolution mapping the given service
(on protocol
and domain
) to the IP address addr
and given port
.
|
a UhmResolver |
|
the service name to match |
|
the protocol name to match |
|
the domain name to match |
|
the IP address to resolve to |
|
the port to resolve to |
Returns : |
TRUE on success; FALSE otherwise |
Since 0.1.0