3.2.4.1 Registering a Peer Name
To register a Peer Name, the application or higher-layer protocol MUST provide:
An indication of which cloud that the name is to be registered in.
The elements to form a Peer Name:
For an Unsecured Peer Name, a classifier and optionally, a Peer Identity.
For a Secure Peer Name, a Peer Identity and an optional classifier.
For a delegated Peer Name, a Peer Identity, Certificate Chain, and an optional classifier.
Optionally, a ServiceLocationPrefix value
Optionally, a FriendlyName string
Optionally, an Extended Payload
An Endpoint list. Optional if an Extended Payload is supplied.
If there are no addresses currently available in the Local Endpoint List, a failure MUST be returned to the application or higher-layer protocol.
To register a Peer Name in a given cloud, a node MUST perform the following steps:
Verify that an entry for the cloud exists in the Cloud Table. If not, return a failure.
Verify that the Peer Name conforms to the syntax as specified in section 2.2.4.
If the application or higher-layer protocol did not specify a ServiceLocationPrefix value, select any one of the addresses in the Local Endpoint List, and select the first 64 bits as the ServiceLocationPrefix.
Create a PNRP ID from the Peer Name provided by the application or higher-layer protocol and the Service Location Prefix, using the process specified in section 3.1.4.4.1, where the 64-bit ServiceLocationSuffix MUST be set to a random value.
The node MUST add the PNRP ID to its Locally Registered PNRP ID List.
The node MUST then initiate the procedure as specified in section 3.1.4.4.2 to resolve the PNRP ID equal to the new PNRP ID + 1. ResolveCritera MUST be set to SEARCH_OPCODE_NONE, ResolveReasonCode MUST be set to REASON_REGISTRATION, PickBestMatchFromLocalIds MUST be set to FALSE, and InitialBestMatchRouteEntry MUST be a ROUTE_ENTRY structure holding the PNRP ID and the endpoints in the Local Endpoint List.
(Note that because the previously mentioned route entry is in each LOOKUP message sent, the nodes receiving the LOOKUP will have the opportunity to learn of the existence of the new node.)
If this is the first locally registered PNRP ID, publish an address used by the node to SSDP (as specified in [UPNPARCH1], section 1). The format of the text in the AL field MUST be in the form of an IPv6 Addresses and port in the format as specified in [RFC2732] (for example, the format of the hostname portion of a URL).