diff options
Diffstat (limited to 'avahi-core')
-rw-r--r-- | avahi-core/browse.c | 4 | ||||
-rw-r--r-- | avahi-core/cache.c | 4 | ||||
-rw-r--r-- | avahi-core/core.h | 4 | ||||
-rw-r--r-- | avahi-core/dns.c | 2 | ||||
-rw-r--r-- | avahi-core/dns.h | 2 | ||||
-rw-r--r-- | avahi-core/iface-linux.c | 4 | ||||
-rw-r--r-- | avahi-core/iface-pfroute.c | 4 | ||||
-rw-r--r-- | avahi-core/iface.h | 4 | ||||
-rw-r--r-- | avahi-core/internal.h | 2 | ||||
-rw-r--r-- | avahi-core/probe-sched.c | 4 | ||||
-rw-r--r-- | avahi-core/response-sched.c | 4 | ||||
-rw-r--r-- | avahi-core/server.c | 22 | ||||
-rw-r--r-- | avahi-core/wide-area.c | 8 |
13 files changed, 34 insertions, 34 deletions
diff --git a/avahi-core/browse.c b/avahi-core/browse.c index e7e01d1..5fd3a01 100644 --- a/avahi-core/browse.c +++ b/avahi-core/browse.c @@ -36,7 +36,7 @@ #include "log.h" #include "querier.h" -#define AVAHI_MAX_LOOKUPS_PER_BROWSER 15 +#define AVAHI_LOOKUPS_PER_BROWSER_MAX 15 struct AvahiSRBLookup { AvahiSRecordBrowser *record_browser; @@ -92,7 +92,7 @@ static AvahiSRBLookup* lookup_new( assert(AVAHI_IF_VALID(interface)); assert(AVAHI_PROTO_VALID(protocol)); - if (b->n_lookups >= AVAHI_MAX_LOOKUPS_PER_BROWSER) + if (b->n_lookups >= AVAHI_LOOKUPS_PER_BROWSER_MAX) /* We don't like cyclic CNAMEs */ return NULL; diff --git a/avahi-core/cache.c b/avahi-core/cache.c index ef7293d..bfbbf85 100644 --- a/avahi-core/cache.c +++ b/avahi-core/cache.c @@ -32,7 +32,7 @@ #include "cache.h" #include "log.h" -#define AVAHI_MAX_CACHE_ENTRIES 500 +#define AVAHI_CACHE_ENTRIES_MAX 500 static void remove_entry(AvahiCache *c, AvahiCacheEntry *e) { AvahiCacheEntry *t; @@ -331,7 +331,7 @@ void avahi_cache_update(AvahiCache *c, AvahiRecord *r, int cache_flush, const Av /* avahi_log_debug("cache: couldn't find matching cache entry for %s", txt); */ - if (c->n_entries >= AVAHI_MAX_CACHE_ENTRIES) + if (c->n_entries >= AVAHI_CACHE_ENTRIES_MAX) return; if (!(e = avahi_new(AvahiCacheEntry, 1))) { diff --git a/avahi-core/core.h b/avahi-core/core.h index 4223bf7..6875218 100644 --- a/avahi-core/core.h +++ b/avahi-core/core.h @@ -48,7 +48,7 @@ AVAHI_C_DECL_BEGIN #endif /** Maximum number of defined DNS servers for wide area DNS */ -#define AVAHI_MAX_WIDE_AREA_SERVERS 4 +#define AVAHI_WIDE_AREA_SERVERS_MAX 4 /** Prototype for callback functions which are called whenever the state of an AvahiServer object changes */ typedef void (*AvahiServerCallback) (AvahiServer *s, AvahiServerState state, void* userdata); @@ -69,7 +69,7 @@ typedef struct AvahiServerConfig { int reflect_ipv; /**< if enable_reflector is 1, enable/disable reflecting between IPv4 and IPv6 */ int add_service_cookie; /**< Add magic service cookie to all locally generated records implicitly */ int enable_wide_area; /**< Enable wide area support */ - AvahiAddress wide_area_servers[AVAHI_MAX_WIDE_AREA_SERVERS]; /** Unicast DNS server to use for wide area lookup */ + AvahiAddress wide_area_servers[AVAHI_WIDE_AREA_SERVERS_MAX]; /** Unicast DNS server to use for wide area lookup */ unsigned n_wide_area_servers; /**< Number of servers in wide_area_servers[] */ int disallow_other_stacks; /**< Make sure that only one mDNS responder is run at the same time on the local machine. If this is enable Avahi will not set SO_REUSADDR on its sockets, effectively preventing other stacks from running on the local machine */ } AvahiServerConfig; diff --git a/avahi-core/dns.c b/avahi-core/dns.c index a9ccda5..8c8b42b 100644 --- a/avahi-core/dns.c +++ b/avahi-core/dns.c @@ -41,7 +41,7 @@ AvahiDnsPacket* avahi_dns_packet_new(unsigned mtu) { size_t max_size; if (mtu <= 0) - max_size = AVAHI_DNS_PACKET_MAX_SIZE; + max_size = AVAHI_DNS_PACKET_SIZE_MAX; else if (mtu >= AVAHI_DNS_PACKET_EXTRA_SIZE) max_size = mtu - AVAHI_DNS_PACKET_EXTRA_SIZE; else diff --git a/avahi-core/dns.h b/avahi-core/dns.h index 743ad4e..61ec189 100644 --- a/avahi-core/dns.h +++ b/avahi-core/dns.h @@ -25,7 +25,7 @@ #include "rr.h" #include "hashmap.h" -#define AVAHI_DNS_PACKET_MAX_SIZE 9000 +#define AVAHI_DNS_PACKET_SIZE_MAX 9000 #define AVAHI_DNS_PACKET_HEADER_SIZE 12 #define AVAHI_DNS_PACKET_EXTRA_SIZE 48 diff --git a/avahi-core/iface-linux.c b/avahi-core/iface-linux.c index 4fc4add..985fe3f 100644 --- a/avahi-core/iface-linux.c +++ b/avahi-core/iface-linux.c @@ -124,8 +124,8 @@ static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdat /* Fill in hardware (MAC) address */ hw->mac_address_size = RTA_PAYLOAD(a); - if (hw->mac_address_size > AVAHI_MAX_MAC_ADDRESS) - hw->mac_address_size = AVAHI_MAX_MAC_ADDRESS; + if (hw->mac_address_size > AVAHI_MAC_ADDRESS_MAX) + hw->mac_address_size = AVAHI_MAC_ADDRESS_MAX; memcpy(hw->mac_address, RTA_DATA(a), hw->mac_address_size); break; diff --git a/avahi-core/iface-pfroute.c b/avahi-core/iface-pfroute.c index f2401e9..4822d59 100644 --- a/avahi-core/iface-pfroute.c +++ b/avahi-core/iface-pfroute.c @@ -87,8 +87,8 @@ static void rtm_info(struct rt_msghdr *rtm, AvahiInterfaceMonitor *m) hw->mtu = ifm->ifm_data.ifi_mtu; hw->mac_address_size = sdl->sdl_alen; - if (hw->mac_address_size > AVAHI_MAX_MAC_ADDRESS) - hw->mac_address_size = AVAHI_MAX_MAC_ADDRESS; + if (hw->mac_address_size > AVAHI_MAC_ADDRESS_MAX) + hw->mac_address_size = AVAHI_MAC_ADDRESS_MAX; memcpy(hw->mac_address, sdl->sdl_data + sdl->sdl_nlen, hw->mac_address_size); diff --git a/avahi-core/iface.h b/avahi-core/iface.h index e45ab10..1671753 100644 --- a/avahi-core/iface.h +++ b/avahi-core/iface.h @@ -48,7 +48,7 @@ typedef struct AvahiHwInterface AvahiHwInterface; #error "No network configuration notification system available" #endif -#define AVAHI_MAX_MAC_ADDRESS 32 +#define AVAHI_MAC_ADDRESS_MAX 32 struct AvahiInterfaceMonitor { AvahiServer *server; @@ -72,7 +72,7 @@ struct AvahiHwInterface { unsigned mtu; - uint8_t mac_address[AVAHI_MAX_MAC_ADDRESS]; + uint8_t mac_address[AVAHI_MAC_ADDRESS_MAX]; size_t mac_address_size; AvahiSEntryGroup *entry_group; diff --git a/avahi-core/internal.h b/avahi-core/internal.h index 8f18219..813eacd 100644 --- a/avahi-core/internal.h +++ b/avahi-core/internal.h @@ -41,7 +41,7 @@ typedef struct AvahiEntry AvahiEntry; #include "multicast-lookup.h" #include "dns-srv-rr.h" -#define AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS 100 +#define AVAHI_LEGACY_UNICAST_REFLECT_SLOTS_MAX 100 #define AVAHI_FLAGS_VALID(flags, max) (!((flags) & ~(max))) diff --git a/avahi-core/probe-sched.c b/avahi-core/probe-sched.c index 8a4d8b0..71359b5 100644 --- a/avahi-core/probe-sched.c +++ b/avahi-core/probe-sched.c @@ -247,8 +247,8 @@ static void elapse_callback(AvahiTimeEvent *e, void* data) { avahi_record_get_estimate_size(pj->record) + AVAHI_DNS_PACKET_HEADER_SIZE; - if (size > AVAHI_DNS_PACKET_MAX_SIZE) - size = AVAHI_DNS_PACKET_MAX_SIZE; + if (size > AVAHI_DNS_PACKET_SIZE_MAX) + size = AVAHI_DNS_PACKET_SIZE_MAX; if (!(p = avahi_dns_packet_new_query(size))) return; /* OOM */ diff --git a/avahi-core/response-sched.c b/avahi-core/response-sched.c index 6bc48ca..65a32af 100644 --- a/avahi-core/response-sched.c +++ b/avahi-core/response-sched.c @@ -244,8 +244,8 @@ static void send_response_packet(AvahiResponseScheduler *s, AvahiResponseJob *rj /* OK, the packet was too small, so create one that fits */ size = avahi_record_get_estimate_size(rj->record) + AVAHI_DNS_PACKET_HEADER_SIZE; - if (size > AVAHI_DNS_PACKET_MAX_SIZE) - size = AVAHI_DNS_PACKET_MAX_SIZE; + if (size > AVAHI_DNS_PACKET_SIZE_MAX) + size = AVAHI_DNS_PACKET_SIZE_MAX; if (!(p = avahi_dns_packet_new_response(size, 1))) return; /* OOM */ diff --git a/avahi-core/server.c b/avahi-core/server.c index fe5b45f..3edd96e 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -409,8 +409,8 @@ void avahi_server_generate_response(AvahiServer *s, AvahiInterface *i, AvahiDnsP avahi_dns_packet_free(reply); size = avahi_record_get_estimate_size(r) + AVAHI_DNS_PACKET_HEADER_SIZE; - if (size > AVAHI_DNS_PACKET_MAX_SIZE) - size = AVAHI_DNS_PACKET_MAX_SIZE; + if (size > AVAHI_DNS_PACKET_SIZE_MAX) + size = AVAHI_DNS_PACKET_SIZE_MAX; if (!(reply = avahi_dns_packet_new_reply(p, size, 0, 1))) break; /* OOM */ @@ -652,10 +652,10 @@ static AvahiLegacyUnicastReflectSlot* allocate_slot(AvahiServer *s) { assert(s); if (!s->legacy_unicast_reflect_slots) - s->legacy_unicast_reflect_slots = avahi_new0(AvahiLegacyUnicastReflectSlot*, AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS); + s->legacy_unicast_reflect_slots = avahi_new0(AvahiLegacyUnicastReflectSlot*, AVAHI_LEGACY_UNICAST_REFLECT_SLOTS_MAX); - for (n = 0; n < AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS; n++, s->legacy_unicast_reflect_id++) { - idx = s->legacy_unicast_reflect_id % AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS; + for (n = 0; n < AVAHI_LEGACY_UNICAST_REFLECT_SLOTS_MAX; n++, s->legacy_unicast_reflect_id++) { + idx = s->legacy_unicast_reflect_id % AVAHI_LEGACY_UNICAST_REFLECT_SLOTS_MAX; if (!s->legacy_unicast_reflect_slots[idx]) break; @@ -680,7 +680,7 @@ static void deallocate_slot(AvahiServer *s, AvahiLegacyUnicastReflectSlot *slot) assert(s); assert(slot); - idx = slot->id % AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS; + idx = slot->id % AVAHI_LEGACY_UNICAST_REFLECT_SLOTS_MAX; assert(s->legacy_unicast_reflect_slots[idx] == slot); @@ -697,7 +697,7 @@ static void free_slots(AvahiServer *s) { if (!s->legacy_unicast_reflect_slots) return; - for (idx = 0; idx < AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS; idx ++) + for (idx = 0; idx < AVAHI_LEGACY_UNICAST_REFLECT_SLOTS_MAX; idx ++) if (s->legacy_unicast_reflect_slots[idx]) deallocate_slot(s, s->legacy_unicast_reflect_slots[idx]); @@ -713,7 +713,7 @@ static AvahiLegacyUnicastReflectSlot* find_slot(AvahiServer *s, uint16_t id) { if (!s->legacy_unicast_reflect_slots) return NULL; - idx = id % AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS; + idx = id % AVAHI_LEGACY_UNICAST_REFLECT_SLOTS_MAX; if (!s->legacy_unicast_reflect_slots[idx] || s->legacy_unicast_reflect_slots[idx]->id != id) return NULL; @@ -862,7 +862,7 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const struct sock return; } -/* avahi_log_debug("new packet recieved on interface '%s.%i'.", i->hardware->name, i->protocol); */ +/* avahi_log_debug("new packet received on interface '%s.%i'.", i->hardware->name, i->protocol); */ port = avahi_port_from_sockaddr(sa); avahi_address_from_sockaddr(sa, &a); @@ -923,7 +923,7 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const struct sock if (!is_mdns_mcast_address(dest) && !avahi_interface_address_on_link(i, &a)) { - avahi_log_warn("Recivied non-local response on interface '%s.%i'.", i->hardware->name, i->protocol); + avahi_log_warn("Received non-local response on interface '%s.%i'.", i->hardware->name, i->protocol); return; } @@ -955,7 +955,7 @@ static void dispatch_legacy_unicast_packet(AvahiServer *s, AvahiDnsPacket *p, co return; } -/* avahi_log_debug("new legacy unicast packet recieved on interface '%s.%i'.", i->hardware->name, i->protocol); */ +/* avahi_log_debug("new legacy unicast packet received on interface '%s.%i'.", i->hardware->name, i->protocol); */ avahi_address_from_sockaddr(sa, &a); diff --git a/avahi-core/wide-area.c b/avahi-core/wide-area.c index 83337a5..9dd1e73 100644 --- a/avahi-core/wide-area.c +++ b/avahi-core/wide-area.c @@ -39,7 +39,7 @@ #include "hashmap.h" #include "wide-area.h" -#define MAX_CACHE_ENTRIES 500 +#define CACHE_ENTRIES_MAX 500 typedef struct AvahiWideAreaCacheEntry AvahiWideAreaCacheEntry; @@ -97,7 +97,7 @@ struct AvahiWideAreaLookupEngine { int cleanup_dead; - AvahiAddress dns_servers[AVAHI_MAX_WIDE_AREA_SERVERS]; + AvahiAddress dns_servers[AVAHI_WIDE_AREA_SERVERS_MAX]; unsigned n_dns_servers; unsigned current_dns_server; }; @@ -416,7 +416,7 @@ static void add_to_cache(AvahiWideAreaLookupEngine *e, AvahiRecord *r) { is_new = 1; /* Enforce cache size */ - if (e->cache_n_entries >= MAX_CACHE_ENTRIES) + if (e->cache_n_entries >= CACHE_ENTRIES_MAX) /* Eventually we should improve the caching algorithm here */ goto finish; @@ -662,7 +662,7 @@ void avahi_wide_area_set_servers(AvahiWideAreaLookupEngine *e, const AvahiAddres assert(e); if (a) { - for (e->n_dns_servers = 0; n > 0 && e->n_dns_servers < AVAHI_MAX_WIDE_AREA_SERVERS; a++, n--) + for (e->n_dns_servers = 0; n > 0 && e->n_dns_servers < AVAHI_WIDE_AREA_SERVERS_MAX; a++, n--) if ((a->proto == AVAHI_PROTO_INET && e->fd_ipv4 >= 0) || (a->proto == AVAHI_PROTO_INET6 && e->fd_ipv6 >= 0)) e->dns_servers[e->n_dns_servers++] = *a; } else { |