openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
e2avahi.cpp File Reference
#include "e2avahi.h"
#include "ebase.h"
#include <avahi-common/error.h>
#include <avahi-client/client.h>
#include <avahi-client/publish.h>
#include <avahi-client/lookup.h>
#include <avahi-common/malloc.h>
#include <avahi-common/timeval.h>
#include <list>
#include <algorithm>

Classes

struct  AvahiTimeout
 
struct  AvahiWatch
 
struct  AvahiServiceEntry
 
struct  AvahiBrowserEntry
 

Typedefs

typedef std::list< AvahiServiceEntryAvahiServiceEntryList
 
typedef std::list< AvahiBrowserEntryAvahiBrowserEntryList
 

Functions

bool operator== (const AvahiServiceEntry &lhs, const AvahiServiceEntry &rhs)
 
bool operator!= (const AvahiServiceEntry &lhs, const AvahiServiceEntry &rhs)
 
bool operator== (const AvahiBrowserEntry &lhs, const AvahiBrowserEntry &rhs)
 
bool operator!= (const AvahiBrowserEntry &lhs, const AvahiBrowserEntry &rhs)
 
static void avahi_group_callback (AvahiEntryGroup *group, AvahiEntryGroupState state, void *d)
 
static void avahi_service_try_register (AvahiServiceEntry *entry)
 
static void avahi_resolver_callback (AvahiServiceResolver *resolver, AvahiIfIndex iface, AvahiProtocol proto, AvahiResolverEvent event, const char *name, const char *type, const char *domain, const char *host_name, const AvahiAddress *address, uint16_t port, AvahiStringList *txt, AvahiLookupResultFlags flags, void *d)
 
static void avahi_browser_callback (AvahiServiceBrowser *browser, AvahiIfIndex iface, AvahiProtocol proto, AvahiBrowserEvent event, const char *name, const char *type, const char *domain, AvahiLookupResultFlags flags, void *d)
 
static void avahi_browser_try_register (AvahiBrowserEntry *entry)
 
static void avahi_client_try_register_all ()
 
static void avahi_client_reset_all ()
 
static void avahi_client_callback (AvahiClient *client, AvahiClientState state, void *d)
 
static AvahiWatchavahi_watch_new (const AvahiPoll *api, int fd, AvahiWatchEvent event, AvahiWatchCallback callback, void *userdata)
 
static void avahi_watch_update (AvahiWatch *w, AvahiWatchEvent event)
 
AvahiWatchEvent avahi_watch_get_events (AvahiWatch *w)
 
void avahi_watch_free (AvahiWatch *w)
 
static void avahi_set_timer (AvahiTimeout *t, const struct timeval *tv)
 
AvahiTimeoutavahi_timeout_new (const AvahiPoll *api, const struct timeval *tv, AvahiTimeoutCallback callback, void *userdata)
 
void avahi_timeout_update (AvahiTimeout *t, const struct timeval *tv)
 
void avahi_timeout_free (AvahiTimeout *t)
 
void e2avahi_init (eMainloop *reactor)
 
void e2avahi_close ()
 
void e2avahi_announce (const char *service_name, const char *service_type, unsigned short port_num)
 
void e2avahi_resolve (const char *service_type, E2AvahiResolveCallback callback, void *userdata)
 
void e2avahi_resolve_cancel (const char *service_type, E2AvahiResolveCallback callback, void *userdata)
 

Variables

static AvahiClient * avahi_client = NULL
 
static AvahiPoll avahi_poll_api
 
static AvahiServiceEntryList avahi_services
 
static AvahiBrowserEntryList avahi_browsers
 

Typedef Documentation

◆ AvahiBrowserEntryList

◆ AvahiServiceEntryList

Function Documentation

◆ avahi_browser_callback()

static void avahi_browser_callback ( AvahiServiceBrowser *  browser,
AvahiIfIndex  iface,
AvahiProtocol  proto,
AvahiBrowserEvent  event,
const char *  name,
const char *  type,
const char *  domain,
AvahiLookupResultFlags  flags,
void *  d 
)
static

◆ avahi_browser_try_register()

static void avahi_browser_try_register ( AvahiBrowserEntry entry)
static

◆ avahi_client_callback()

static void avahi_client_callback ( AvahiClient *  client,
AvahiClientState  state,
void *  d 
)
static

◆ avahi_client_reset_all()

static void avahi_client_reset_all ( )
static

◆ avahi_client_try_register_all()

static void avahi_client_try_register_all ( )
static

◆ avahi_group_callback()

static void avahi_group_callback ( AvahiEntryGroup *  group,
AvahiEntryGroupState  state,
void *  d 
)
static

◆ avahi_resolver_callback()

static void avahi_resolver_callback ( AvahiServiceResolver *  resolver,
AvahiIfIndex  iface,
AvahiProtocol  proto,
AvahiResolverEvent  event,
const char *  name,
const char *  type,
const char *  domain,
const char *  host_name,
const AvahiAddress *  address,
uint16_t  port,
AvahiStringList *  txt,
AvahiLookupResultFlags  flags,
void *  d 
)
static

◆ avahi_service_try_register()

static void avahi_service_try_register ( AvahiServiceEntry entry)
static

◆ avahi_set_timer()

static void avahi_set_timer ( AvahiTimeout t,
const struct timeval *  tv 
)
static

◆ avahi_timeout_free()

void avahi_timeout_free ( AvahiTimeout t)

Free a timeout. It is safe to call this function from an AvahiTimeoutCallback

◆ avahi_timeout_new()

AvahiTimeout* avahi_timeout_new ( const AvahiPoll *  api,
const struct timeval *  tv,
AvahiTimeoutCallback  callback,
void *  userdata 
)

Set a wakeup time for the polling loop. The API will call the callback function when the absolute time *tv is reached. If tv is NULL, the timeout is disabled. After the timeout expired the callback function will be called and the timeout is disabled. You can reenable it by calling timeout_update()

◆ avahi_timeout_update()

void avahi_timeout_update ( AvahiTimeout t,
const struct timeval *  tv 
)

Update the absolute expiration time for a timeout, If tv is NULL, the timeout is disabled. It is safe to call this function from an AvahiTimeoutCallback

◆ avahi_watch_free()

void avahi_watch_free ( AvahiWatch w)

Free a watch. It is safe to call this function from an AvahiWatchCallback

◆ avahi_watch_get_events()

AvahiWatchEvent avahi_watch_get_events ( AvahiWatch w)

Return the events that happened. It is safe to call this function from an AvahiWatchCallback

◆ avahi_watch_new()

static AvahiWatch* avahi_watch_new ( const AvahiPoll *  api,
int  fd,
AvahiWatchEvent  event,
AvahiWatchCallback  callback,
void *  userdata 
)
static

Create a new watch for the specified file descriptor and for the specified events. The API will call the callback function whenever any of the events happens.

◆ avahi_watch_update()

static void avahi_watch_update ( AvahiWatch w,
AvahiWatchEvent  event 
)
static

Update the events to wait for. It is safe to call this function from an AvahiWatchCallback

◆ e2avahi_announce()

void e2avahi_announce ( const char *  service_name,
const char *  service_type,
unsigned short  port_num 
)

◆ e2avahi_close()

void e2avahi_close ( )

◆ e2avahi_init()

void e2avahi_init ( eMainloop reactor)

◆ e2avahi_resolve()

void e2avahi_resolve ( const char *  service_type,
E2AvahiResolveCallback  callback,
void *  userdata 
)

◆ e2avahi_resolve_cancel()

void e2avahi_resolve_cancel ( const char *  service_type,
E2AvahiResolveCallback  callback,
void *  userdata 
)

◆ operator!=() [1/2]

bool operator!= ( const AvahiBrowserEntry lhs,
const AvahiBrowserEntry rhs 
)
inline

◆ operator!=() [2/2]

bool operator!= ( const AvahiServiceEntry lhs,
const AvahiServiceEntry rhs 
)
inline

◆ operator==() [1/2]

bool operator== ( const AvahiBrowserEntry lhs,
const AvahiBrowserEntry rhs 
)
inline

◆ operator==() [2/2]

bool operator== ( const AvahiServiceEntry lhs,
const AvahiServiceEntry rhs 
)
inline

Variable Documentation

◆ avahi_browsers

AvahiBrowserEntryList avahi_browsers
static

◆ avahi_client

AvahiClient* avahi_client = NULL
static

◆ avahi_poll_api

AvahiPoll avahi_poll_api
static

◆ avahi_services

AvahiServiceEntryList avahi_services
static