/* Deduce the initial state of our state machine. If a routable
* address is configured for the interface, *state should be set to
- * STATE_SLEEPING., otherwide STATE_START */
+ * STATE_SLEEPING, otherwise STATE_START */
int iface_get_initial_state(State *state);
#elif defined(HAVE_SETREGID)
r = setregid(gr->gr_gid, gr->gr_gid);
#else
-#error "No API to drop priviliges"
+#error "No API to drop privileges"
#endif
if (r < 0) {
#elif defined(HAVE_SETREUID)
r = setreuid(pw->pw_uid, pw->pw_uid);
#else
-#error "No API to drop priviliges"
+#error "No API to drop privileges"
#endif
if (r < 0) {
union {
AvahiIPv6Address ipv6; /**< Address when IPv6 */
AvahiIPv4Address ipv4; /**< Address when IPv4 */
- uint8_t data[1]; /**< Type independant data field */
+ uint8_t data[1]; /**< Type-independent data field */
} data;
} AvahiAddress;
#ifdef __cplusplus
/** If using C++ this macro enables C mode, otherwise does nothing */
#define AVAHI_C_DECL_BEGIN extern "C" {
-/** If using C++ this macros switches back to C++ mode, otherwise does nothing */
+/** If using C++ this macro switches back to C++ mode, otherwise does nothing */
#define AVAHI_C_DECL_END }
#else
/** If using C++ this macro enables C mode, otherwise does nothing */
#define AVAHI_C_DECL_BEGIN
-/** If using C++ this macros switches back to C++ mode, otherwise does nothing */
+/** If using C++ this macro switches back to C++ mode, otherwise does nothing */
#define AVAHI_C_DECL_END
#endif
*
* \li <b>avahi-core</b>: an API for embedding a complete mDNS/DNS-SD stack
* into your software. This is intended for developers of embedded
- * ampliances only. We dissuade from using this API in normal desktop
+ * appliances only. We dissuade from using this API in normal desktop
* applications since it is not a good idea to run multiple mDNS
* stacks simultaneously on the same host.
* \li <b>the D-Bus API</b>: an extensive D-Bus interface for browsing and
* registering mDNS/DNS-SD services using avahi-daemon. We recommend
- * to use this API for software written in any language but
- * C. (i.e. Python)
+ * using this API for software written in any language other than
+ * C (e.g. Python).
* \li <b>avahi-client</b>: a simplifying C wrapper around the D-Bus API. We
- * recommend to use this API in C or C++ progams. The D-Bus internals
+ * recommend using this API in C or C++ progams. The D-Bus internals
* are hidden completely.
*
* All three APIs are very similar, however avahi-core is the most powerful.
*
* \section event_loop Event Loop Abstraction
*
- * Avahi uses a simple event loop abstraction laye. A table AvahiPoll
+ * Avahi uses a simple event loop abstraction layer. A table AvahiPoll
* which contains function pointers for user defined timeout and I/O
* condition event source implementations needs to be passed to
* avahi_client_new(). An adapter for this abstraction layer is
* be established.
* - Remove your services when the server enters
* AVAHI_SERVER_COLLISION or AVAHI_SERVER_REGISTERING state. Your
- * services may no be reachable anymore since the local host name is
+ * services may not be reachable anymore since the local host name is
* no longer established or is currently in the process of being
* established.
* - When registering services, use the following algorithm:
* AVAHI_PUBLISH_UPDATE when changing the service name! Renaming a
* DNS-SD service is identical to deleting and creating a new one, and
* that's exactly what you should do in that case. First call
- * avahi_entry_group_reset() to remove it and than readd it normally.
+ * avahi_entry_group_reset() to remove it and then read it normally.
*
* \section good_browse How to Browse for Services
*
* AvahiClient object in that case and reconnect to the server anew -
* again with passing AVAHI_CLIENT_NO_FAIL to avahi_client_new().
*
- * We encourage to implement this in all software where service
+ * We encourage implementing this in all software where service
* discovery is not an integral part of application. e.g. use it in
* all kinds of background daemons, but not in software like iChat
* compatible IM software.
typedef enum {
AVAHI_BROWSER_NEW, /**< The object is new on the network */
AVAHI_BROWSER_REMOVE, /**< The object has been removed from the network */
- AVAHI_BROWSER_CACHE_EXHAUSTED, /**< One-time event, to notify the user that all entries from the caches have been send */
+ AVAHI_BROWSER_CACHE_EXHAUSTED, /**< One-time event, to notify the user that all entries from the caches have been sent */
AVAHI_BROWSER_ALL_FOR_NOW, /**< One-time event, to notify the user that more records will probably not show up in the near future, i.e. all cache entries have been read and all static servers been queried */
AVAHI_BROWSER_FAILURE /**< Browsing failed due to some reason which can be retrieved using avahi_server_errno()/avahi_client_errno() */
} AvahiBrowserEvent;
AVAHI_ERR_NOT_PERMITTED = -50, /**< Operation not permitted */
AVAHI_ERR_INVALID_ARGUMENT = -51, /**< Invalid argument */
AVAHI_ERR_IS_EMPTY = -52, /**< Is empty */
- AVAHI_ERR_NO_CHANGE = -53, /**< The requested operation is invalid because redundant */
+ AVAHI_ERR_NO_CHANGE = -53, /**< The requested operation is invalid because it is redundant */
/****
**** IF YOU ADD A NEW ERROR CODE HERE, PLEASE DON'T FORGET TO ADD
/** Convert the string list object to a single character string,
* seperated by spaces and enclosed in "". avahi_free() the result! This
- * function doesn't work well with string that contain NUL bytes. */
+ * function doesn't work well with strings that contain NUL bytes. */
char* avahi_string_list_to_string(AvahiStringList *l);
/** \cond fulldocs */
* AvahiSimplePoll, but will not start the helper thread. \since 0.6.4 */
AvahiThreadedPoll *avahi_threaded_poll_new(void);
-/** Free an event loop object. Ths will stop the associated evet loop
+/** Free an event loop object. This will stop the associated event loop
* thread (if it is running). \since 0.6.4 */
void avahi_threaded_poll_free(AvahiThreadedPoll *p);
/* We use the same jitter for 10 seconds. That way our
* time events elapse in bursts which has the advantage that
- * packet data can be aggegrated better */
+ * packet data can be aggregated better */
avahi_timeval_add(tv, (AvahiUsec) (jitter*1000.0*r/(RAND_MAX+1.0)));
}
typedef void (*AvahiTimeoutCallback)(AvahiTimeout *t, void *userdata);
/** Defines an abstracted event polling API. This may be used to
- connect Avahi to other main loops. This is losely based on Unix
+ connect Avahi to other main loops. This is loosely based on Unix
poll(2). A consumer will call watch_new() for all file descriptors it
wants to listen for events on. In addition he can call timeout_new()
to define time based events .*/
AvahiTimeout* (*timeout_new)(const AvahiPoll *api, const struct timeval *tv, AvahiTimeoutCallback callback, void *userdata);
/** 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 */
+ * NULL, the timeout is disabled. It is safe to call this function from an AvahiTimeoutCallback */
void (*timeout_update)(AvahiTimeout *, const struct timeval *tv);
/** Free a timeout. It is safe to call this function from an AvahiTimeoutCallback */
static cap_value_t cap_values[] = { CAP_SYS_CHROOT, CAP_SETUID, CAP_SETGID };
/* Let's reduce our caps to the minimum set and tell Linux to keep
- * them accross setuid(). This is called before we droppped
- * priviliges. */
+ * them across setuid(). This is called before we drop
+ * privileges. */
caps = cap_init();
assert(caps);
}
cap_free(caps);
- /* Retain capabilities accros setuid() */
+ /* Retain capabilities across setuid() */
if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) < 0) {
avahi_log_error("prctl(PR_SET_KEEPCAPS) failed: %s", strerror(errno));
ret = -1;
static cap_value_t cap_values[] = { CAP_SYS_CHROOT };
/* Reduce our caps to the bare minimum and tell Linux not to keep
- * them across setuid(). This is called after we dropped
- * privilige. */
+ * them across setuid(). This is called after we drop
+ * privileges. */
/* No longer retain caps across setuid() */
if (prctl(PR_SET_KEEPCAPS, 0, 0, 0, 0) < 0) {
if (server->n_clients >= CLIENTS_MAX)
return NULL;
- /* If not existant yet, create a new entry */
+ /* If not existent yet, create a new entry */
client = avahi_new(Client, 1);
client->id = server->current_id++;
client->name = avahi_strdup(name);
#elif defined(HAVE_SETREGID)
r = setregid(gr->gr_gid, gr->gr_gid);
#else
-#error "No API to drop priviliges"
+#error "No API to drop privileges"
#endif
if (r < 0) {
#elif defined(HAVE_SETREUID)
r = setreuid(pw->pw_uid, pw->pw_uid);
#else
-#error "No API to drop priviliges"
+#error "No API to drop privileges"
#endif
if (r < 0) {
strncpy(sa.sun_path, AVAHI_SOCKET, sizeof(sa.sun_path)-1);
/* We simply remove existing UNIX sockets under this name. The
- Avahi daemons makes sure that it runs only once on a host,
+ Avahi daemon makes sure that it runs only once on a host,
therefore sockets that already exist are stale and may be
removed without any ill effects */