Struct:tsMdnsConfigService

Jump to: navigation, search
#include "trsocket.h"
 
/*
 * mDNS service configuration (DNS SRV record).
 *  Service Instance Name ([RFC6763].4.1): <Instance> . <Service> . <Domain>
 *      <Instance>: user-friendly name, e.g. "Web server at Alpha Station".
 *      <Service>: type of service, e.g. "_http._tcp".
 *      <Domain>: always ".local" for mDNS.
 */
struct tsMdnsConfigService
{
    ttUserConstCharPtr mcsName;
    ttUserConstCharPtr mcsType;
    unsigned int mcsPort;
};
 
typedef struct tsMdnsConfigService ttMdnsConfigService;
typedef ttMdnsConfigService TM_FAR * ttMdnsConfigServicePtr;
typedef const ttMdnsConfigService TM_FAR * ttMdnsConstConfigServicePtr;

Structure Description

Hosts can use mDNS to browse for servers on the local link. This structure supplies the configuration information for one DNS SRV (service) record that can be sent in response to browser queries from other hosts. Web, FTP and network printing servers are typical services that could advertised to mDNS clients.

Create a variable of type ttMdnsConfig for the local mDNS server configuration. Create an array of ttMdnsConfigService entries for all available servers on the local host. Set the array point in member ttMdnsConfig.mcServiceArr and the array length in ttMdnsConfig.mcServiceCount. After calling tfMdnsStart(), the user is free to discard the array or change its contents.


Members

  • mcsName
    The Instance name discussed in section 4.1 of RFC 6763. This should be a user-friendly name and must be unique on the local link. For example, "Web server on Station 7A".
  • mcsType
    The Service name discussed in section 4.1 of RFC 6763. This is a modified version of information from /etc/services. For example, "_http._tcp".
  • mcsPort
    The TCP or UDP port on which the local server is listening. This will usually correspond with the /etc/services information (e.g. "http 80/tcp").