42 int main (
int argc,
char **argv)
50 if (status != ISC_R_SUCCESS) {
51 fprintf(stderr,
"Can't initialize context: %s\n",
52 isc_result_totext(status));
58 if (argc > 1 && !strcmp (argv [1],
"listen")) {
60 fprintf (stderr,
"Usage: test listen port\n");
64 if (status != ISC_R_SUCCESS) {
65 fprintf (stderr,
"omapi_generic_new: %s\n",
66 isc_result_totext (status));
70 (
unsigned)atoi (argv [2]), 1);
71 if (status != ISC_R_SUCCESS) {
72 fprintf (stderr,
"omapi_listen: %s\n",
73 isc_result_totext (status));
77 }
else if (argc > 1 && !strcmp (argv [1],
"connect")) {
79 fprintf (stderr,
"Usage: test listen address port\n");
83 if (status != ISC_R_SUCCESS) {
84 fprintf (stderr,
"omapi_generic_new: %s\n",
85 isc_result_totext (status));
90 (
unsigned)atoi (argv [3]), 0);
91 fprintf (stderr,
"connect: %s\n", isc_result_totext (status));
92 if (status != ISC_R_SUCCESS)
95 fprintf (stderr,
"completion: %s\n",
96 isc_result_totext (status));
97 if (status != ISC_R_SUCCESS)
101 fprintf (stderr,
"Usage: test [listen | connect] ...\n");
isc_result_t omapi_protocol_listen(omapi_object_t *, unsigned, int)
int main(int argc, char **argv)
isc_result_t omapi_dispatch(struct timeval *)
#define DHCP_CONTEXT_PRE_DB
#define DHCP_CONTEXT_POST_DB
isc_result_t dhcp_context_create(int flags, struct in_addr *local4, struct in6_addr *local6)
isc_result_t omapi_generic_new(omapi_object_t **, const char *, int)
isc_result_t omapi_protocol_connect(omapi_object_t *, const char *, unsigned, omapi_object_t *)
isc_result_t omapi_wait_for_completion(omapi_object_t *, struct timeval *)
isc_result_t omapi_init(void)