diff options
author | Trent Lloyd <lathiat@bur.st> | 2005-10-17 20:07:43 +0000 |
---|---|---|
committer | Trent Lloyd <lathiat@bur.st> | 2005-10-17 20:07:43 +0000 |
commit | 3adbda2cd5be48b7c630325f0f92e315d7eb2cfb (patch) | |
tree | fa98de69267ed3e7f1a3e915b2632afebe8ddb38 /avahi-client/client-test.c | |
parent | c1c236e751d126f3aeffe3ccf5da889dbf853b2f (diff) |
* Add custom user-specific configure flags to bootstrap.sh
* Add new constant AVAHI_ADDRESS_STR_MAX for use with
avahi_address_snprint arr
ays
* Update all our code to use AVAHI_ADDRESS_STR_MAX
* Add avahi_client_add_address to avahi-client
* Add avahi_client_add_address test to avahi-client
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@800 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-client/client-test.c')
-rw-r--r-- | avahi-client/client-test.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/avahi-client/client-test.c b/avahi-client/client-test.c index 14b9e84..076fb3b 100644 --- a/avahi-client/client-test.c +++ b/avahi-client/client-test.c @@ -45,6 +45,11 @@ static void avahi_entry_group_callback (AvahiEntryGroup *g, AvahiEntryGroupState printf ("ENTRY-GROUP: Callback on %p, state -> %d, data -> %s\n", (void*) g, state, (char*)userdata); } +static void avahi_entry_group2_callback (AvahiEntryGroup *g, AvahiEntryGroupState state, void *userdata) { + printf ("ENTRY-GROUP2: Callback on %p, state -> %d, data -> %s\n", (void*) g, state, (char*)userdata); +} + + static void avahi_domain_browser_callback( AvahiDomainBrowser *b, AvahiIfIndex interface, @@ -209,11 +214,12 @@ static void terminate(AvahiTimeout *timeout, void *userdata) { int main (int argc, char *argv[]) { AvahiClient *avahi; - AvahiEntryGroup *group; + AvahiEntryGroup *group, *group2; AvahiDomainBrowser *domain; AvahiServiceBrowser *sb; AvahiServiceTypeBrowser *st; AvahiHostNameResolver *hnr; + AvahiAddress *aar; const char *ret; int error; uint32_t cookie; @@ -280,6 +286,22 @@ int main (int argc, char *argv[]) { else printf ("Successfully created hostname resolver object\n"); + aar = avahi_address_parse ("224.0.0.251", AF_UNSPEC, aar); + if (aar == NULL) { + printf ("failed to create address object\n"); + } else { + group2 = avahi_entry_group_new (avahi, avahi_entry_group2_callback, "omghai222"); + if ((error = avahi_entry_group_add_address (group2, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "test-mdns.local.", aar)) < 0) + { + printf ("*** failed to add address to entry group: %s\n", avahi_strerror (ret)); + avahi_entry_group_free (group2); + } else { + printf ("*** success, added address\n"); + avahi_entry_group_commit (group2); + } + + } + avahi_elapse_time(&tv, 8000, 0); poll_api->timeout_new(poll_api, &tv, test_entry_group_reset, group); |