mdns.h File Reference

#include "nip_init.h"
#include "nip_types.h"
#include "os_core.h"
#include "mem.h"
#include "net/net_if.h"
#include "app/dns.h"

Include dependency graph for mdns.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  nip_mdns_name
struct  nip_mdns_rdata_a
struct  nip_mdns_rdata_srv
struct  nip_mdns_rdata_ptr
struct  nip_mdns_rdata_oth
union  nip_mdns_rdata_t
struct  nip_mdns_query
struct  nip_mdns_namestring
struct  nip_mdns_record
struct  nip_mdns_cache
struct  nip_mdns_cache_subscription
struct  nip_mdns_check

Defines

#define NIP_MDNS_ADDR0   224
#define NIP_MDNS_ADDR1   0
#define NIP_MDNS_ADDR2   0
#define NIP_MDNS_ADDR3   251
#define NIP_MDNS_MAX_QUERIES   5
 maximum number of open MDNS queries.
#define NIP_MDNS_DISCARD_ON_OUT_OF_MEMORY   1
 If this is set to 1 we won't wait for memory to become free, but discard any incoming packet if we don't have enough memory available to serve it.
#define NIP_MDNS_MAX_NAMESTRINGS   20
 maximum number of cached DNS name strings.
#define NIP_MDNS_MAX_CACHE_SIZE   20
 maximum number of entries in MDNS cache
#define NIP_MDNS_DEFEND_HOSTNAME   1
 Should mdns-hostname be unique in the network?
#define NIP_MDNS_MAX_NAME_DEPTH   6
 The currently used system maximizes the size of MDNS names to 6 dotted parts which is the maximum size needed for IPv4 in-addr.arpa pointers.
#define NIP_MDNS_CREATE_IN_ADDR_ARPA_PTR   1
#define NIP_MDNS_COUNTER_SIZE   1
 Byte-Size of temporary query and answer counters for transmission.
#define NIP_MDNS_NO_QUERY_TIMER   255
 Query timer with this value is disabled until set to a different value.
#define NIP_MDNS_PROBE_COUNT   3
 Maximum number of probes to send until assuming no conflict.
#define NIP_MDNS_ANNOUNCE_COUNT   3
 Maximum number of announcements to send until assuming no conflict.
#define NIP_MDNS_DEFAULT_TTL_A   12
 default TTL for records with a host name \ in rname or rdata, 2min
#define NIP_MDNS_DEFAULT_TTL   4500
 default TTL for not-A-records, 75min
#define NIP_MDNS_QUERY_ID_MASK   0x3F
#define NIP_MDNS_NO_QUERY   0x3F
#define NIP_MDNS_QUERY_DELETE   0x80
#define NIP_MDNS_QUERY_ACTIVE   0x00
#define NIP_MDNS_NFY_NONE   0x00
#define NIP_MDNS_NFY_LOCAL   0x80
#define NIP_MDNS_NFY_REMOTE   0x40
#define NIP_MDNS_NFY_ALL   (NIP_MDNS_NFY_LOCAL|NIP_MDNS_NFY_REMOTE)
#define NIP_MDNS_NFY_NONE   0x00
#define NIP_MDNS_NO_NAMESTRING   0
#define NIP_MDNS_NO_CACHE_ID   0
#define NIP_MDNS_MAX_NAMESTRING_USG   (NIP_MDNS_MAX_CACHE_SIZE/2 + NIP_MDNS_MAX_QUERIES)
 Size of usage counter assumes that average usage of a namestring will not exceed two occurances per cache entry and one per query.
#define NIP_MDNS_RDATA_SRV_SIZE   (3*sizeof(uint16_t)+sizeof(struct nip_mdns_data_a))
 PTR data entry only holds instance name as app, proto and domain are implicit.
#define NIP_MDNS_RDATA_PTR_SIZE   sizeof(nip_mdns_namestring_id_t)
 PTR data entry only holds instance name as app, proto and domain are implicit.
#define NIP_MDNS_CSTAT_AUTH_BIT   0x01
 All Cache entries with the NIP_MDNS_CSTAT_AUTHORATIVE_BIT status bit set are considered authorative and will be used to reply to remote queries and will be defended upon conflicts.
#define NIP_MDNS_CSTAT_AUTH_MASK   0x0F
#define NIP_MDNS_CSTAT_LEARNED_BIT   0x80
 All Cache entries with the NIP_MDNS_CSTAT_LEARNED_BIT status bit set are considered learned and bound to one or more local queries.
#define NIP_MDNS_CSTAT_LEARNED_MASK   0xF0
#define NIP_MDNS_QTYPE_TX_BIT   0x80
#define NIP_MDNS_QTYPE_LOCAL_BIT   0x01
#define NIP_MDNS_QTYPE_REMOTE_BIT   0x02
#define NIP_MDNS_STRINGOFF   (sizeof(nip_mdns_namestring_id_t)+sizeof(nip_mdns_namestring_usg_t))
#define NIP_MDNS_BASE_RECORD_SIZE   (sizeof(struct nip_mdns_record)-sizeof(nip_mdns_rdata_t))
#define NIP_MDNS_OTH_RECORD_SIZE   (NIP_MDNS_BASE_RECORD_SIZE+sizeof(struct nip_mdns_rdata_oth))
#define NIP_MDNS_A_RECORD_SIZE   (NIP_MDNS_BASE_RECORD_SIZE+sizeof(struct nip_mdns_rdata_a ))
#define NIP_MDNS_SRV_RECORD_SIZE   (NIP_MDNS_BASE_RECORD_SIZE+sizeof(struct nip_mdns_rdata_srv))
#define NIP_MDNS_PTR_RECORD_SIZE   (NIP_MDNS_BASE_RECORD_SIZE+sizeof(struct nip_mdns_rdata_ptr))
#define NIP_MDNS_BASE_CACHE_SIZE   (sizeof(struct nip_mdns_cache)-sizeof(struct nip_mdns_record))
#define NIP_MDNS_QA_COUNTERS_OFFSET   4
 counter offset in dns header
#define NIP_MDNS_QA_COUNTERS_NUMBER   4
 number of query/answer counters
Macros for Management of DNS names
#define NIP_MDNS_REG_STRING(name_ptr)   nip_mdns_register_name( NULL, 0, name_ptr, 1 )
 Register name string.
#define NIP_MDNS_REG_NAME(idarr, idcnt, name_ptr)   nip_mdns_register_name( idarr, idcnt, name_ptr, 1 )
 Register dns-encoded name.
#define NIP_MDNS_NAME_USE(idarr, idcnt)   nip_mdns_register_name( idarr, idcnt, NULL, 1 )
 Increment name usage.
#define NIP_MDNS_UNREG_NAME(idarr, idcnt)   nip_mdns_register_name( idarr, idcnt, NULL, -1 )
 Unregister name occurence.
#define NIP_MDNS_CHECK_NAME(name_ptr)   nip_mdns_register_name( NULL, 0, name_ptr, 0 )
 Does name exist in list?
#define NIP_MDNS_WRITE_NAME(idarr, idcnt, buf_ptr)   nip_mdns_register_name( idarr, idcnt, buf_ptr, 0 )
 Write mdns-encoded name to buffer.
Macros for Management of DNS Queries
#define NIP_MDNS_PROBE(name)   nip_mdns_query( NIP_MDNS_QTYPE_PROBE, name, NIP_MDNS_TYPE_ANY )
 Send PROBE request for record.
#define NIP_MDNS_ANNOUNCE(name)   nip_mdns_query( NIP_MDNS_QTYPE_ANNOUNCE, name, NIP_MDNS_TYPE_ANY )
 Send Announcements for record.
#define NIP_MDNS_SUBSCRIBE_REMOTE(c_id, q_id)   nip_mdns_notify( NIP_MDNS_NFYTASK_SUBSCRIBE, c_id, q_id, NIP_MDNS_NFY_REMOTE )
#define NIP_MDNS_UNSUBSCRIBE_QUERY(q_id)   nip_mdns_notify( NIP_MDNS_NFYTASK_UNSUBSCRIBE, NIP_MDNS_NO_CACHE_ID, q_id, NIP_MDNS_NFY_ALL )
#define NIP_MDNS_QUERY_NOTIFIED(c_id, q_id)   nip_mdns_notify( NIP_MDNS_NFYTASK_NOTIFIED, c_id, q_id, NIP_MDNS_NFY_REMOTE )
 Cache subscriptions for (Remote) Queries will be removed upon notification.
Macros for Management of DNS Cache
#define NIP_MDNS_REGISTER(cache_id_ptr, record_ptr)   nip_mdns_cache_task( NIP_MDNS_TASK_REGISTER, cache_id_ptr, record_ptr )
#define NIP_MDNS_UNREGISTER(cache_id_ptr)   nip_mdns_cache_task( NIP_MDNS_TASK_UNREGISTER, cache_id_ptr, NULL )
#define NIP_MDNS_REGUNIQUE(cache_id_ptr, record_ptr)   nip_mdns_cache_task( NIP_MDNS_TASK_REGUNIQUE, cache_id_ptr, record_ptr )
#define NIP_MDNS_RESET_CACHE()   nip_mdns_cache_task( NIP_MDNS_TASK_RESET, NULL, NULL )
#define NIP_MDNS_GET_RECORD(cache_id_ptr, record_ptr)   nip_mdns_cache_task( NIP_MDNS_TASK_GET_LEARNED, cache_id_ptr, record_ptr )
#define NIP_MDNS_GET_LEARNED_CSTAT(item_ptr)   ((item_ptr)->stat & NIP_MDNS_CSTAT_LEARNED_MASK)
#define NIP_MDNS_GET_AUTH_CSTAT(item_ptr)   ((item_ptr)->stat & NIP_MDNS_CSTAT_AUTH_MASK)
#define NIP_MDNS_SET_LEARNED_CSTAT(item_ptr, newstat)   (item_ptr)->stat = ((item_ptr)->stat & ~NIP_MDNS_CSTAT_LEARNED_MASK) | newstat
#define NIP_MDNS_SET_AUTH_CSTAT(item_ptr, newstat)   (item_ptr)->stat = ((item_ptr)->stat & ~NIP_MDNS_CSTAT_LEARNED_MASK) | newstat

Typedefs

typedef uint8_t nip_mdns_query_id_t
typedef uint8_t nip_mdns_query_cnt_t
typedef uint8_t nip_mdns_namestring_id_t
typedef uint8_t nip_mdns_namestring_cnt_t
typedef uint8_t nip_mdns_namestring_len_t
 Per standard, the size of the name string length is limited to 6 Bit.
typedef uint8_t nip_mdns_cache_id_t
typedef uint8_t nip_mdns_cache_cnt_t
typedef uint8_t nip_mdns_namestring_usg_t
typedef uint8_t nip_mdns_record_size_t
typedef uint8_t nip_mdns_qa_counter_t

Enumerations

enum  nip_mdns_type_t {
  NIP_MDNS_TYPE_A = 1, NIP_MDNS_TYPE_NS = 2, NIP_MDNS_TYPE_CNAME = 5, NIP_MDNS_TYPE_SOA = 6,
  NIP_MDNS_TYPE_PTR = 12, NIP_MDNS_TYPE_MX = 15, NIP_MDNS_TYPE_TXT = 16, NIP_MDNS_TYPE_AAAA = 28,
  NIP_MDNS_TYPE_SRV = 33, NIP_MDNS_TYPE_ANY = 255
}
enum  nip_mdns_status_t {
  NIP_MDNS_STAT_DOWN = 0, NIP_MDNS_STAT_INIT, NIP_MDNS_STAT_UP, NIP_MDNS_STAT_CACHE_CHECK,
  NIP_MDNS_STAT_QUERY_CHECK, NIP_MDNS_STAT_RESET, NIP_MDNS_STAT_BYE
}
enum  nip_mdns_cache_status_t {
  NIP_MDNS_CSTAT_PROBING = 0x02, NIP_MDNS_CSTAT_PROBECONFLICT = 0x04, NIP_MDNS_CSTAT_AUTHORATIVE = 0x01, NIP_MDNS_CSTAT_UNIQUE_AUTH = 0x09,
  NIP_MDNS_CSTAT_ANNOUNCING = 0x03, NIP_MDNS_CSTAT_CONFLICT = 0x05, NIP_MDNS_CSTAT_DELETE = 0x00, NIP_MDNS_CSTAT_LEARNED = 0x80,
  NIP_MDNS_CSTAT_REFRESH = 0x90, NIP_MDNS_CSTAT_OUTDATED1 = 0xA0, NIP_MDNS_CSTAT_OUTDATED2 = 0xB0
}
enum  nip_mdns_task_t {
  NIP_MDNS_TASK_UNREGISTER = 0x00, NIP_MDNS_TASK_REGISTER = 0x01, NIP_MDNS_TASK_REGUNIQUE = 0x11, NIP_MDNS_TASK_LEARN = 0x20,
  NIP_MDNS_TASK_SEARCH = 0x30, NIP_MDNS_TASK_GET = 0x80, NIP_MDNS_TASK_GET_LEARNED = 0x90, NIP_MDNS_TASK_RESET = 0x40
}
enum  nip_mdns_nfy_task_t { NIP_MDNS_NFYTASK_NOTIFY = 0x01, NIP_MDNS_NFYTASK_SUBSCRIBE = 0x11, NIP_MDNS_NFYTASK_UNSUBSCRIBE = 0x10, NIP_MDNS_NFYTASK_NOTIFIED = 0x20 }
enum  nip_mdns_name_task_t { NIP_MDNS_NTASK_FIND, NIP_MDNS_NTASK_WRITE }
enum  nip_mdns_query_type_t {
  NIP_MDNS_QTYPE_LOCAL = 0x81, NIP_MDNS_QTYPE_REMOTE = 0x02, NIP_MDNS_QTYPE_REMLOC = 0x83, NIP_MDNS_QTYPE_PROBE = 0x82,
  NIP_MDNS_QTYPE_ANNOUNCE = 0x12
}
 Query types. More...
enum  nip_mdns_packet_type_t {
  NIP_MDNS_PTYPE_NONE = 0x00, NIP_MDNS_PTYPE_QUERY = 0x01, NIP_MDNS_PTYPE_RESPONSE = 0x02, NIP_MDNS_PTYPE_PROBE = 0x11,
  NIP_MDNS_PTYPE_ANSWCONTINUED = 0x21, NIP_MDNS_PTYPE_PROBERESPONSE = 0x12
}
 The lower two Bits of Packet type describe wether a Query or a Response packet will be sent. More...
enum  nip_mdns_qa_offset_t { NIP_MDNS_QDCOUNT_OFFSET = 0, NIP_MDNS_ANCOUNT_OFFSET = 1, NIP_MDNS_NSCOUNT_OFFSET = 2, NIP_MDNS_ARCOUNT_OFFSET = 3 }
 Section types in DNS packet. More...
enum  nip_mdns_packet_task_t { NIP_MDNS_PTASK_INC_COUNTER, NIP_MDNS_PTASK_SECTION_PTR, NIP_MDNS_PTASK_SET_TC, NIP_MDNS_PTASK_NEXT_ITEM }

Functions

nip_error_t nip_mdns_init (void)
 initialize mdns memory
void nip_mdns_interface_up (nip_net_if_id_t if_id)
 Register host name and refresh cache.
void nip_mdns_interface_down (void)
nip_mdns_query_id_t nip_mdns_query (nip_mdns_query_type_t qtype, struct nip_mdns_name *name, nip_mdns_type_t type)
 Execute MDNS lookup query.
nip_mdns_cache_id_t nip_mdns_fetch_results (nip_mdns_query_id_t r_id)
 Fetch next result for lookup query.
nip_error_t nip_mdns_close (nip_mdns_query_id_t r_id)
 Close query.
nip_mdns_namestring_id_t nip_mdns_register_name (nip_mdns_namestring_id_t *id, uint8_t cnt, nip_mem_ptr_t *name_ptr, nip_mdns_namestring_usg_t usg)
 Registers new MDNS namestring or retrieves already registered entry for that name.
struct nip_mdns_cachenip_mdns_cache_ptr (nip_mdns_cache_id_t id)
 Get pointer to specific cache entry.
nip_error_t nip_mdns_cache_task (nip_mdns_task_t task, nip_mdns_cache_id_t *id, struct nip_mdns_record *record)
 Perform mDNS cache operation.
void nip_mdns_disp_check (void)
 Dispatcher function to be called upon receiving mDNS events.

Variables

nip_mdns_query_id_t nip_mdns_hostname_queries


Define Documentation

#define NIP_MDNS_A_RECORD_SIZE   (NIP_MDNS_BASE_RECORD_SIZE+sizeof(struct nip_mdns_rdata_a ))

Definition at line 428 of file mdns.h.

Referenced by nip_mdns_record_size().

#define NIP_MDNS_ADDR0   224

Definition at line 41 of file mdns.h.

Referenced by nip_mdns_init(), and nip_mdns_transmit().

#define NIP_MDNS_ADDR1   0

Definition at line 42 of file mdns.h.

Referenced by nip_mdns_init(), and nip_mdns_transmit().

#define NIP_MDNS_ADDR2   0

Definition at line 43 of file mdns.h.

Referenced by nip_mdns_init(), and nip_mdns_transmit().

#define NIP_MDNS_ADDR3   251

Definition at line 44 of file mdns.h.

Referenced by nip_mdns_init(), and nip_mdns_transmit().

#define NIP_MDNS_ANNOUNCE ( name   )     nip_mdns_query( NIP_MDNS_QTYPE_ANNOUNCE, name, NIP_MDNS_TYPE_ANY )

Send Announcements for record.

Definition at line 570 of file mdns.h.

#define NIP_MDNS_ANNOUNCE_COUNT   3

Maximum number of announcements to send until assuming no conflict.

Definition at line 113 of file mdns.h.

#define NIP_MDNS_BASE_CACHE_SIZE   (sizeof(struct nip_mdns_cache)-sizeof(struct nip_mdns_record))

Definition at line 447 of file mdns.h.

Referenced by nip_mdns_cache_ptr(), nip_mdns_cache_task(), and nip_mdns_disp_check_cache().

#define NIP_MDNS_BASE_RECORD_SIZE   (sizeof(struct nip_mdns_record)-sizeof(nip_mdns_rdata_t))

Definition at line 426 of file mdns.h.

#define NIP_MDNS_CHECK_NAME ( name_ptr   )     nip_mdns_register_name( NULL, 0, name_ptr, 0 )

Does name exist in list?

Returns:
NIP_MDNS_NO_NAMESTRING on failure

Definition at line 555 of file mdns.h.

Referenced by nip_mdns_disp_check_cache().

#define NIP_MDNS_COUNTER_SIZE   1

Byte-Size of temporary query and answer counters for transmission.

DNS defines these counters to be 16-Bit, but for internal use we can limit them to 8-Bit, as we can -- depending on available memory -- assure, that a counter value of 255 will never be exceeded. If by any chance any query/answer counter might exceed 255 you SHOULD set NIP_MDNS_COUNTER_SIZE to 2, as the program does not perform any boundary checks. Setting it to 2 will only lead to 4 additional Bytes of RAM being used, which will most probbly not hurt, if you feel able to transmit more than 255 queries or answers in one packet.

Definition at line 103 of file mdns.h.

#define NIP_MDNS_CREATE_IN_ADDR_ARPA_PTR   1

Definition at line 83 of file mdns.h.

#define NIP_MDNS_CSTAT_AUTH_BIT   0x01

All Cache entries with the NIP_MDNS_CSTAT_AUTHORATIVE_BIT status bit set are considered authorative and will be used to reply to remote queries and will be defended upon conflicts.

Definition at line 295 of file mdns.h.

Referenced by nip_mdns_disp_check_cache().

#define NIP_MDNS_CSTAT_AUTH_MASK   0x0F

Definition at line 296 of file mdns.h.

Referenced by nip_mdns_cache_task().

#define NIP_MDNS_CSTAT_LEARNED_BIT   0x80

All Cache entries with the NIP_MDNS_CSTAT_LEARNED_BIT status bit set are considered learned and bound to one or more local queries.

Definition at line 299 of file mdns.h.

#define NIP_MDNS_CSTAT_LEARNED_MASK   0xF0

Definition at line 300 of file mdns.h.

#define NIP_MDNS_DEFAULT_TTL   4500

default TTL for not-A-records, 75min

Definition at line 117 of file mdns.h.

#define NIP_MDNS_DEFAULT_TTL_A   12

default TTL for records with a host name \ in rname or rdata, 2min

Definition at line 115 of file mdns.h.

Referenced by nip_mdns_register_hostname().

#define NIP_MDNS_DEFEND_HOSTNAME   1

Should mdns-hostname be unique in the network?

Definition at line 70 of file mdns.h.

#define NIP_MDNS_DISCARD_ON_OUT_OF_MEMORY   1

If this is set to 1 we won't wait for memory to become free, but discard any incoming packet if we don't have enough memory available to serve it.

Definition at line 54 of file mdns.h.

#define NIP_MDNS_GET_AUTH_CSTAT ( item_ptr   )     ((item_ptr)->stat & NIP_MDNS_CSTAT_AUTH_MASK)

Definition at line 605 of file mdns.h.

#define NIP_MDNS_GET_LEARNED_CSTAT ( item_ptr   )     ((item_ptr)->stat & NIP_MDNS_CSTAT_LEARNED_MASK)

Definition at line 602 of file mdns.h.

#define NIP_MDNS_GET_RECORD ( cache_id_ptr,
record_ptr   )     nip_mdns_cache_task( NIP_MDNS_TASK_GET_LEARNED, cache_id_ptr, record_ptr )

Definition at line 599 of file mdns.h.

#define NIP_MDNS_MAX_CACHE_SIZE   20

maximum number of entries in MDNS cache

Definition at line 65 of file mdns.h.

Referenced by nip_mdns_cache_task().

#define NIP_MDNS_MAX_NAME_DEPTH   6

The currently used system maximizes the size of MDNS names to 6 dotted parts which is the maximum size needed for IPv4 in-addr.arpa pointers.

More flexible implementations would require a more complexly programmed system of name concatenation.

Definition at line 79 of file mdns.h.

Referenced by nip_mdns_cache_task(), nip_mdns_disp_check_cache(), nip_mdns_disp_check_queries(), nip_mdns_query(), nip_mdns_register_name(), and nip_mdns_tx_name().

#define NIP_MDNS_MAX_NAMESTRING_USG   (NIP_MDNS_MAX_CACHE_SIZE/2 + NIP_MDNS_MAX_QUERIES)

Size of usage counter assumes that average usage of a namestring will not exceed two occurances per cache entry and one per query.

If that assumption fails to be true, NIP_E_OUT_OF_MEMORY errors will occur upon registering names beyond that point.

Definition at line 185 of file mdns.h.

#define NIP_MDNS_MAX_NAMESTRINGS   20

maximum number of cached DNS name strings.

The hereby meant name strings are the parts in between two dots of a DNS name, not the entire name.

Definition at line 60 of file mdns.h.

Referenced by nip_mdns_register_name().

#define NIP_MDNS_MAX_QUERIES   5

maximum number of open MDNS queries.

Definition at line 48 of file mdns.h.

Referenced by nip_mdns_query().

#define NIP_MDNS_NAME_USE ( idarr,
idcnt   )     nip_mdns_register_name( idarr, idcnt, NULL, 1 )

Increment name usage.

Usage of at most idcnt items in idarr will be increased by 1

Returns:
NIP_MDNS_NO_NAMESTRING on error

Definition at line 549 of file mdns.h.

Referenced by nip_mdns_cache_task(), and nip_mdns_query().

#define NIP_MDNS_NFY_ALL   (NIP_MDNS_NFY_LOCAL|NIP_MDNS_NFY_REMOTE)

Definition at line 150 of file mdns.h.

#define NIP_MDNS_NFY_LOCAL   0x80

Definition at line 128 of file mdns.h.

#define NIP_MDNS_NFY_NONE   0x00

Definition at line 151 of file mdns.h.

#define NIP_MDNS_NFY_NONE   0x00

Definition at line 151 of file mdns.h.

#define NIP_MDNS_NFY_REMOTE   0x40

Definition at line 129 of file mdns.h.

Referenced by nip_mdns_disp_check_queries().

#define NIP_MDNS_NO_CACHE_ID   0

#define NIP_MDNS_NO_NAMESTRING   0

#define NIP_MDNS_NO_QUERY   0x3F

Definition at line 124 of file mdns.h.

Referenced by nip_mdns_disp_check_cache(), nip_mdns_notify(), and nip_mdns_query().

#define NIP_MDNS_NO_QUERY_TIMER   255

Query timer with this value is disabled until set to a different value.

Definition at line 107 of file mdns.h.

#define NIP_MDNS_OTH_RECORD_SIZE   (NIP_MDNS_BASE_RECORD_SIZE+sizeof(struct nip_mdns_rdata_oth))

Definition at line 427 of file mdns.h.

Referenced by nip_mdns_record_size().

#define NIP_MDNS_PROBE ( name   )     nip_mdns_query( NIP_MDNS_QTYPE_PROBE, name, NIP_MDNS_TYPE_ANY )

Send PROBE request for record.

Definition at line 566 of file mdns.h.

#define NIP_MDNS_PROBE_COUNT   3

Maximum number of probes to send until assuming no conflict.

Definition at line 110 of file mdns.h.

#define NIP_MDNS_PTR_RECORD_SIZE   (NIP_MDNS_BASE_RECORD_SIZE+sizeof(struct nip_mdns_rdata_ptr))

Definition at line 430 of file mdns.h.

Referenced by nip_mdns_record_size().

#define NIP_MDNS_QA_COUNTERS_NUMBER   4

number of query/answer counters

Definition at line 478 of file mdns.h.

Referenced by nip_mdns_parse_packet().

#define NIP_MDNS_QA_COUNTERS_OFFSET   4

counter offset in dns header

Definition at line 477 of file mdns.h.

#define NIP_MDNS_QTYPE_LOCAL_BIT   0x01

Definition at line 362 of file mdns.h.

Referenced by nip_mdns_disp_check_queries().

#define NIP_MDNS_QTYPE_REMOTE_BIT   0x02

Definition at line 363 of file mdns.h.

#define NIP_MDNS_QTYPE_TX_BIT   0x80

Definition at line 361 of file mdns.h.

Referenced by nip_mdns_disp_check_queries().

#define NIP_MDNS_QUERY_ACTIVE   0x00

Definition at line 126 of file mdns.h.

Referenced by nip_mdns_query().

#define NIP_MDNS_QUERY_DELETE   0x80

Definition at line 125 of file mdns.h.

#define NIP_MDNS_QUERY_ID_MASK   0x3F

Definition at line 123 of file mdns.h.

Referenced by nip_mdns_disp_check_queries(), nip_mdns_notify(), and nip_mdns_query().

#define NIP_MDNS_QUERY_NOTIFIED ( c_id,
q_id   )     nip_mdns_notify( NIP_MDNS_NFYTASK_NOTIFIED, c_id, q_id, NIP_MDNS_NFY_REMOTE )

Cache subscriptions for (Remote) Queries will be removed upon notification.

Definition at line 580 of file mdns.h.

Referenced by nip_mdns_disp_check_queries().

#define NIP_MDNS_RDATA_PTR_SIZE   sizeof(nip_mdns_namestring_id_t)

PTR data entry only holds instance name as app, proto and domain are implicit.

Definition at line 227 of file mdns.h.

#define NIP_MDNS_RDATA_SRV_SIZE   (3*sizeof(uint16_t)+sizeof(struct nip_mdns_data_a))

PTR data entry only holds instance name as app, proto and domain are implicit.

Definition at line 213 of file mdns.h.

#define NIP_MDNS_REG_NAME ( idarr,
idcnt,
name_ptr   )     nip_mdns_register_name( idarr, idcnt, name_ptr, 1 )

Register dns-encoded name.

Name will be decoded from name_ptr. At most idcnt part-IDs will be written to idarr.

Returns:
ID of last part on SUCCESS

Definition at line 545 of file mdns.h.

#define NIP_MDNS_REG_STRING ( name_ptr   )     nip_mdns_register_name( NULL, 0, name_ptr, 1 )

Register name string.

That is just one part of a name.

Returns:
namestring ID

Definition at line 541 of file mdns.h.

Referenced by nip_mdns_init(), and nip_mdns_register_hostname().

#define NIP_MDNS_REGISTER ( cache_id_ptr,
record_ptr   )     nip_mdns_cache_task( NIP_MDNS_TASK_REGISTER, cache_id_ptr, record_ptr )

Definition at line 587 of file mdns.h.

Referenced by nip_mdns_register_hostname().

#define NIP_MDNS_REGUNIQUE ( cache_id_ptr,
record_ptr   )     nip_mdns_cache_task( NIP_MDNS_TASK_REGUNIQUE, cache_id_ptr, record_ptr )

Definition at line 593 of file mdns.h.

Referenced by nip_mdns_register_hostname().

 
#define NIP_MDNS_RESET_CACHE (  )     nip_mdns_cache_task( NIP_MDNS_TASK_RESET, NULL, NULL )

Definition at line 596 of file mdns.h.

Referenced by nip_mdns_interface_up().

#define NIP_MDNS_SET_AUTH_CSTAT ( item_ptr,
newstat   )     (item_ptr)->stat = ((item_ptr)->stat & ~NIP_MDNS_CSTAT_LEARNED_MASK) | newstat

Definition at line 611 of file mdns.h.

#define NIP_MDNS_SET_LEARNED_CSTAT ( item_ptr,
newstat   )     (item_ptr)->stat = ((item_ptr)->stat & ~NIP_MDNS_CSTAT_LEARNED_MASK) | newstat

Definition at line 608 of file mdns.h.

#define NIP_MDNS_SRV_RECORD_SIZE   (NIP_MDNS_BASE_RECORD_SIZE+sizeof(struct nip_mdns_rdata_srv))

Definition at line 429 of file mdns.h.

Referenced by nip_mdns_record_size().

#define NIP_MDNS_STRINGOFF   (sizeof(nip_mdns_namestring_id_t)+sizeof(nip_mdns_namestring_usg_t))

Definition at line 415 of file mdns.h.

Referenced by nip_mdns_register_name().

#define NIP_MDNS_SUBSCRIBE_REMOTE ( c_id,
q_id   )     nip_mdns_notify( NIP_MDNS_NFYTASK_SUBSCRIBE, c_id, q_id, NIP_MDNS_NFY_REMOTE )

Definition at line 573 of file mdns.h.

Referenced by nip_mdns_disp_check_cache().

#define NIP_MDNS_UNREG_NAME ( idarr,
idcnt   )     nip_mdns_register_name( idarr, idcnt, NULL, -1 )

Unregister name occurence.

Usage of at most idcnt items in idarr will be decreased by 1

Returns:
NIP_MDNS_NO_NAMESTRING on error

Definition at line 552 of file mdns.h.

Referenced by nip_mdns_cache_task(), and nip_mdns_register_hostname().

#define NIP_MDNS_UNREGISTER ( cache_id_ptr   )     nip_mdns_cache_task( NIP_MDNS_TASK_UNREGISTER, cache_id_ptr, NULL )

Definition at line 590 of file mdns.h.

#define NIP_MDNS_UNSUBSCRIBE_QUERY ( q_id   )     nip_mdns_notify( NIP_MDNS_NFYTASK_UNSUBSCRIBE, NIP_MDNS_NO_CACHE_ID, q_id, NIP_MDNS_NFY_ALL )

Definition at line 576 of file mdns.h.

Referenced by nip_mdns_disp_check_queries().

#define NIP_MDNS_WRITE_NAME ( idarr,
idcnt,
buf_ptr   )     nip_mdns_register_name( idarr, idcnt, buf_ptr, 0 )

Write mdns-encoded name to buffer.

At most idcnt items of idarr will be concatenated and written to buffer.

Todo:
has yet to be implemented
Returns:
NIP_MDNS_NO_NAMESTRING on error

Definition at line 560 of file mdns.h.

Referenced by nip_mdns_disp_check_queries(), and nip_mdns_tx_name().


Typedef Documentation

typedef uint8_t nip_mdns_cache_cnt_t

Definition at line 171 of file mdns.h.

typedef uint8_t nip_mdns_cache_id_t

Definition at line 170 of file mdns.h.

typedef uint8_t nip_mdns_namestring_cnt_t

Definition at line 156 of file mdns.h.

typedef uint8_t nip_mdns_namestring_id_t

Definition at line 155 of file mdns.h.

typedef uint8_t nip_mdns_namestring_len_t

Per standard, the size of the name string length is limited to 6 Bit.

Definition at line 166 of file mdns.h.

typedef uint8_t nip_mdns_namestring_usg_t

Definition at line 187 of file mdns.h.

typedef uint8_t nip_mdns_qa_counter_t

Definition at line 472 of file mdns.h.

typedef uint8_t nip_mdns_query_cnt_t

Definition at line 122 of file mdns.h.

typedef uint8_t nip_mdns_query_id_t

Definition at line 121 of file mdns.h.

typedef uint8_t nip_mdns_record_size_t

Definition at line 431 of file mdns.h.


Enumeration Type Documentation

Enumerator:
NIP_MDNS_CSTAT_PROBING  item is being registered
NIP_MDNS_CSTAT_PROBECONFLICT  probing failed, select new name
NIP_MDNS_CSTAT_AUTHORATIVE  item has been registered but must not be defended (need not be unique)
NIP_MDNS_CSTAT_UNIQUE_AUTH  item has been registered and must be defended (is unique)
NIP_MDNS_CSTAT_ANNOUNCING  item is being announced
NIP_MDNS_CSTAT_CONFLICT  conflict on authorative item
NIP_MDNS_CSTAT_DELETE  item is scheduled for deletion -> notify subscribers
NIP_MDNS_CSTAT_LEARNED  item has been learned through MDNS
NIP_MDNS_CSTAT_REFRESH  item timed out and we're trying to refresh
NIP_MDNS_CSTAT_OUTDATED1  someone else asked for this item
NIP_MDNS_CSTAT_OUTDATED2  someone asked for this item again, previous question unanswered

Definition at line 301 of file mdns.h.

Enumerator:
NIP_MDNS_NTASK_FIND  check if name from query is in cache
NIP_MDNS_NTASK_WRITE  write name to query

Definition at line 351 of file mdns.h.

Enumerator:
NIP_MDNS_NFYTASK_NOTIFY  notify query about cache change
NIP_MDNS_NFYTASK_SUBSCRIBE  add cache subscription
NIP_MDNS_NFYTASK_UNSUBSCRIBE  remove subscription
NIP_MDNS_NFYTASK_NOTIFIED  remove notification marker

Definition at line 339 of file mdns.h.

Enumerator:
NIP_MDNS_PTASK_INC_COUNTER  increment one of the section counters.

NIP_MDNS_PTASK_SECTION_PTR  move pointer to specific section
NIP_MDNS_PTASK_SET_TC  set truncated flag (TC-flag) in header
NIP_MDNS_PTASK_NEXT_ITEM  forward pointer to next item in section

Definition at line 495 of file mdns.h.

The lower two Bits of Packet type describe wether a Query or a Response packet will be sent.

The higher Bits are used to code additional information that is needed to determine timing and answer coding.

Enumerator:
NIP_MDNS_PTYPE_NONE 
NIP_MDNS_PTYPE_QUERY 
NIP_MDNS_PTYPE_RESPONSE 
NIP_MDNS_PTYPE_PROBE 
NIP_MDNS_PTYPE_ANSWCONTINUED  continuation of known answers
NIP_MDNS_PTYPE_PROBERESPONSE  special type to signal urgency.

Definition at line 388 of file mdns.h.

Section types in DNS packet.

The values are also used as qa_count-array item selectors and as 16-bit offsets in DNS header starting at the NIP_MDNS_QA_COUNTERS_OFFSET position of the header. DO NOT ALTER THE VALUES unless you change a whole bunch of code along with it.

Enumerator:
NIP_MDNS_QDCOUNT_OFFSET 
NIP_MDNS_ANCOUNT_OFFSET 
NIP_MDNS_NSCOUNT_OFFSET 
NIP_MDNS_ARCOUNT_OFFSET 

Definition at line 483 of file mdns.h.

Query types.

The enumeration values are chosen so that the lower two bits decide what packet type will result from the query. That is: LOCAL, PROBE and REMLOC queries will result in a Query-Packet being sent when the timer triggers. REMOTE and REMLOC queries will result in a Response-Packet being sent, whenever there are active Remote-Subscriptions. The High-order Bit indicates Queries that are actively transmitted on the network.

Enumerator:
NIP_MDNS_QTYPE_LOCAL  local query that we're caching remote records for
NIP_MDNS_QTYPE_REMOTE  remote query that we have authorative records for
NIP_MDNS_QTYPE_REMLOC  query is remote and local
NIP_MDNS_QTYPE_PROBE  probe query
NIP_MDNS_QTYPE_ANNOUNCE  Fake remote query to collect announcement answers.

Definition at line 372 of file mdns.h.

Enumerator:
NIP_MDNS_STAT_DOWN  mDNS inactive
NIP_MDNS_STAT_INIT  mDNS trying to go up, initialization pending
NIP_MDNS_STAT_UP  mDNS up -> statemachines running
NIP_MDNS_STAT_CACHE_CHECK 
NIP_MDNS_STAT_QUERY_CHECK 
NIP_MDNS_STAT_RESET  mDNS waiting for reset
NIP_MDNS_STAT_BYE  mDNS going down

Definition at line 277 of file mdns.h.

Enumerator:
NIP_MDNS_TASK_UNREGISTER  unregister authorative record
NIP_MDNS_TASK_REGISTER  register authorative record
NIP_MDNS_TASK_REGUNIQUE  register UNIQUE authorative record
NIP_MDNS_TASK_LEARN  learning remote record
NIP_MDNS_TASK_SEARCH  search record
NIP_MDNS_TASK_GET  return record data for given, learned Cache ID
NIP_MDNS_TASK_GET_LEARNED  return record data for given, authorative Cache ID
NIP_MDNS_TASK_RESET  reset cache

Definition at line 323 of file mdns.h.

Enumerator:
NIP_MDNS_TYPE_A 
NIP_MDNS_TYPE_NS 
NIP_MDNS_TYPE_CNAME 
NIP_MDNS_TYPE_SOA 
NIP_MDNS_TYPE_PTR 
NIP_MDNS_TYPE_MX 
NIP_MDNS_TYPE_TXT 
NIP_MDNS_TYPE_AAAA 
NIP_MDNS_TYPE_SRV 
NIP_MDNS_TYPE_ANY 

Definition at line 259 of file mdns.h.


Function Documentation

struct nip_mdns_cache* nip_mdns_cache_ptr ( nip_mdns_cache_id_t  id  )  [read]

Get pointer to specific cache entry.

Note:
You have to call nip_mem_release_block( nip_mdns_cache.id ) to release the retrieved pointer and unlock the cache.
Returns:
Pointer to cache entry. On error NULL will be returned and nip_error be set to one of the following values:
  • NIP_E_NOT_FOUND no record found for given ID
  • NIP_E_LOCKED cache locked, try again later

Definition at line 563 of file mdns.c.

References nip_mdns_cache::id, nip_mem_ptr_t::id, NIP_E_LOCKED, NIP_E_NOT_FOUND, nip_error, NIP_MDNS_BASE_CACHE_SIZE, nip_mdns_record_size(), nip_mem_buf_used(), nip_mem_obtain_ptr(), nip_mem_release_block(), NULL, and nip_mdns_cache::record.

Here is the call graph for this function:

nip_error_t nip_mdns_cache_task ( nip_mdns_task_t  task,
nip_mdns_cache_id_t id,
struct nip_mdns_record record 
)

Perform mDNS cache operation.

Type of operation depends on task parameter.

  • The register operation will add a new authorative record.
  • The learn operation will add or update a remote DNS record.
  • The get operation will retrieve the record data for a given ID.
  • The search operation will return the Id of the existing cache record that matches certain attributes from the given record. The set of attributes chosen for the match depends on the record type.
  • The reset operation removes all learned entries from cache, clears the subscription array and resets all registered entries into PROBING state.

Note:
This function will not trigger any dispatcher events or update the subscription list as it's just an internal function to be called by other mDNS functions.
Parameters:
record Pointer to DNS record to be added or searched
task register, learn or search record or reset cache
Returns:
Id of registered, updated or found cache entry. Will be set to NIP_MDNS_NO_CACHE_ID on error, nip_error will be set to one of the following then:
  • NIP_E_LOCKED cache locked, try again later
  • NIP_E_OUT_OF_MEMORY unable to allocate memory for new record
  • NIP_E_OUT_OF_RESSOURECES cache full
  • NIP_E_NOT_FOUND search operation was unsuccessfull
  • NIP_E_EXISTS register failed because record exists already
  • NIP_E_INTERNAL_ERROR something went wrong where it shouldn't have

Todo:
support multiple entries for the same name?

Todo:
nip_mdns_register_record_names( record, 1 )

Todo:
on error goto release

Todo:
nip_mdns_register_record_names( l->record, -1 )

Todo:
on error, try to unregister new record names, set INTERNAL_ERROR because name-count may now be inconsistant and goto release.

Todo:
set notification bit

Definition at line 627 of file mdns.c.

References nip_mdns_cache::age, nip_mdns_record::data, nip_mdns_cache::id, nip_mem_ptr_t::id, nip_mdns_record::name, NIP_DISP_CHECK_MDNS, nip_disp_notify, NIP_E_EXISTS, NIP_E_INTERNAL_ERROR, NIP_E_LOCKED, NIP_E_NOT_FOUND, NIP_E_OK, NIP_E_OUT_OF_MEMORY, NIP_E_OUT_OF_RESSOURCES, nip_error, NIP_MDNS_BASE_CACHE_SIZE, NIP_MDNS_CSTAT_ANNOUNCING, NIP_MDNS_CSTAT_AUTH_MASK, NIP_MDNS_CSTAT_DELETE, NIP_MDNS_CSTAT_LEARNED, NIP_MDNS_CSTAT_PROBING, NIP_MDNS_MAX_CACHE_SIZE, NIP_MDNS_MAX_NAME_DEPTH, NIP_MDNS_NAME_USE, NIP_MDNS_NO_CACHE_ID, nip_mdns_record_size(), NIP_MDNS_TASK_GET, NIP_MDNS_TASK_GET_LEARNED, NIP_MDNS_TASK_LEARN, NIP_MDNS_TASK_REGISTER, NIP_MDNS_TASK_REGUNIQUE, NIP_MDNS_TASK_RESET, NIP_MDNS_TASK_SEARCH, NIP_MDNS_TYPE_PTR, NIP_MDNS_UNREG_NAME, nip_mem_buf_used(), nip_mem_obtain_ptr(), nip_mem_ptr(), nip_mem_release_block(), nip_mem_set_used(), nip_mem_write(), nip_memcmp, nip_memcpy(), NULL, nip_mdns_name::part, nip_mem_ptr_t::ptr, nip_mdns_cache::record, nip_mdns_cache::stat, nip_mdns_record::ttl, and nip_mdns_record::type.

Referenced by nip_mdns_disp_check_queries().

Here is the call graph for this function:

Here is the caller graph for this function:

nip_error_t nip_mdns_close ( nip_mdns_query_id_t  r_id  ) 

Close query.

Todo:
implement

Definition at line 889 of file mdns.c.

References NIP_E_OK.

void nip_mdns_disp_check ( void   ) 

Dispatcher function to be called upon receiving mDNS events.

Todo:
check that the packet originated on the local link

Todo:
loop through queries

Todo:
-> loop through answers in packet

Todo:
answer matches local query? -> update cache -> update subscriptions
Todo:
answer matches remote query? -> update subscriptions for matching cache entries

Todo:
loop through queries

Todo:
remote query? -> loop through subscription list -> retrieve answers from cache and fill packet
Todo:
local query? -> check timer
Todo:
remove query marked for deletion and all notifications done? -> remove from list -> remove subscriptions

Todo:
loop through namestrings to remove unused names

Definition at line 1838 of file mdns.c.

References nip_udp_sock_addr::ip, NIP_CURR_CMD, NIP_DNS_OP_MASK, NIP_DNS_QR_MASK, NIP_DNS_RC_MASK, NIP_E_OK, NIP_IP_ADDR, nip_mdns, nip_mdns_disp_check_cache(), nip_mdns_disp_check_queries(), nip_mdns_if_id, nip_mdns_init(), NIP_MDNS_NSCOUNT_OFFSET, NIP_MDNS_PTYPE_NONE, NIP_MDNS_PTYPE_PROBE, NIP_MDNS_PTYPE_QUERY, NIP_MDNS_PTYPE_RESPONSE, NIP_MDNS_QDCOUNT_OFFSET, nip_mdns_sock, NIP_MDNS_STAT_CACHE_CHECK, NIP_MDNS_STAT_DOWN, NIP_MDNS_STAT_INIT, NIP_MDNS_STAT_QUERY_CHECK, nip_memcmp, nip_udp_cancel_recv(), nip_udp_data_ptr(), NIP_UDP_NO_SOCKET, nip_udp_ptr_release(), nip_udp_recvfrom(), NIP_UDP_RX_BUF, NULL, nip_dns_header::qa_count, nip_dns_header::qr_opcode_aa_tc_rd, nip_dns_header::ra_z_ad_cd_rcode, nip_mdns_check::recv, nip_mdns_check::recv_size, and nip_mdns_check::stat.

Here is the call graph for this function:

nip_mdns_cache_id_t nip_mdns_fetch_results ( nip_mdns_query_id_t  r_id  ) 

Fetch next result for lookup query.

This function has to be called repeatedly, to fetch all results until nip_mdns_close() is called.

Parameters:
r_id ID of query to fetch result from
Returns:
ID of cache entry to result. If no result was available NIP_MDNS_NO_CACHE_ID will be returned and nip_error be set to NIP_E_AGAIN.

Todo:
implement

Definition at line 901 of file mdns.c.

References NIP_MDNS_NO_CACHE_ID.

nip_error_t nip_mdns_init ( void   ) 

void nip_mdns_interface_down ( void   ) 

Todo:
send notifications to network

Todo:
reset cache, clean up remote queries

Definition at line 1052 of file mdns.c.

References nip_mdns, nip_mdns_if_id, nip_mdns_sock, NIP_MDNS_STAT_DOWN, NIP_NET_NO_IF, nip_udp_close(), and nip_mdns_check::stat.

Here is the call graph for this function:

void nip_mdns_interface_up ( nip_net_if_id_t  if_id  ) 

Register host name and refresh cache.

Definition at line 1039 of file mdns.c.

References NIP_DISP_CHECK_MDNS, nip_disp_notify, nip_mdns, nip_mdns_if_id, NIP_MDNS_RESET_CACHE, NIP_MDNS_STAT_INIT, and nip_mdns_check::stat.

Execute MDNS lookup query.

The query will be registered within the system and a query ID will be returned. That query has to be ultimately closed by calling nip_mdns_close(). Answers to the query can be polled by calling nip_mdns_fetch_results().

Parameters:
name pointer to DNS name
type DNS type
Returns:
query-ID or NIP_MDNS_NO_QUERY

Todo:
set timer correctly

Definition at line 440 of file mdns.c.

References nip_mdns_query::id, nip_mem_ptr_t::id, NIP_E_OK, NIP_MDNS_MAX_NAME_DEPTH, NIP_MDNS_MAX_QUERIES, NIP_MDNS_NAME_USE, NIP_MDNS_NO_QUERY, NIP_MDNS_QTYPE_LOCAL, NIP_MDNS_QTYPE_PROBE, NIP_MDNS_QTYPE_REMLOC, NIP_MDNS_QTYPE_REMOTE, NIP_MDNS_QUERY_ACTIVE, NIP_MDNS_QUERY_ID_MASK, nip_mem_buf_used(), nip_mem_obtain_ptr(), nip_mem_release_block(), nip_mem_write(), nip_memcmp, NULL, nip_mdns_query::rr_name, nip_mdns_query::rr_type, nip_mdns_query::timer, and nip_mdns_query::type.

Referenced by nip_mdns_disp_check_cache().

Here is the call graph for this function:

Here is the caller graph for this function:

nip_mdns_namestring_id_t nip_mdns_register_name ( nip_mdns_namestring_id_t id,
uint8_t  cnt,
nip_mem_ptr_t name_ptr,
nip_mdns_namestring_usg_t  usg 
)

Registers new MDNS namestring or retrieves already registered entry for that name.

The namestring's usage counter will be increased for every call of nip_mdns_register_name(). This function may also be used to unregister a previously registered namestring by providing a negative usage count.

Parameters:
id if set, the usage counter for that namestring will be increased and name and len parameter will be ignored.
cnt if > 1, id will be treated as array of namestrings to be registered. Must be 0 if id is not set.
name_ptr pointer to buffer holding the name. If id is set, the found name(s) will be appended to that buffer, preceded by their length. The pointer has to point to a nip_dns_string structure.
len length of name
usg number of string usages to register (negative to unregister)
Returns:
ID of namestring or NIP_MDNS_NO_NAMESTRING on error.
Note:
If usg is 0 a simple lookup of the given namestring will be performed and -- if found -- it's Id be returned.

The function's result depends very much on the correct combination of the various parameters. Those are chosen to be as minimal as possible, which will most probably lead to erroneous usage of the function. You SHOULD NOT call this function directly but use the provided macros, which, depending on the provided function, require only a subset of the parameters to be set.

  • NIP_MDNS_REG_STRING
  • NIP_MDNS_REG_NAME
  • NIP_MDNS_NAME_USE
  • NIP_MDNS_UNREG_NAME
  • NIP_MDNS_CHECK_NAME
  • NIP_MDNS_WRITE_NAME

Definition at line 258 of file mdns.c.

References nip_mdns_namestring::id, nip_mem_ptr_t::id, nip_dns_string::len, NIP_E_OK, NIP_MDNS_MAX_NAME_DEPTH, NIP_MDNS_MAX_NAMESTRINGS, nip_mdns_name_cmp(), nip_mdns_names, NIP_MDNS_NO_NAMESTRING, NIP_MDNS_STRINGOFF, nip_mem_buf_used(), nip_mem_insert(), NIP_MEM_NULL, nip_mem_ptr(), nip_mem_release_block(), nip_mem_release_ptr(), nip_mem_set_used(), nip_mem_write(), nip_memcpy(), NULL, nip_mem_ptr_t::ptr, nip_dns_string::s, nip_mdns_namestring::str, and nip_mdns_namestring::usg.

Here is the call graph for this function:


Variable Documentation


Generated on Thu Jul 10 01:09:37 2008 for NIP by  doxygen 1.5.5