#include "addr.h"
#include "sap.h"
String SAP_selGet(SapSelector *sel, String str);
String SAP_selPr(SapSelector *sel, Char *first, Char *last);
Int SAP_selCmp(SapSelector *sel1, SapSelector sel2);
String SAP_nAddrGet(N_SapAddr *nsap, String str);
String SAP_nAddrPr(N_SapAddr *nsap, Char *first, Char *last);
Int SAP_nAddrCmp(N_SapAddr *nsap1, N_SapAddr nsap2);
SAP_ module is responsible for SAP_ address management. An overview of SAP address representation is first provided.
A hierarchical SAP addressing scheme is used. At the Network layer, communicating entities are identified by their NSAP addresses. The Network layer uniquely identifies each of the open systems by their NSAP addresses. Let's take the case of a layer (N) above the Network layer. In this case, an (N) address consists of two parts:
The (N)-SAP address is a unique representation of a SAP to the OSI environment. The (N)-SAP address selector is a unique representation of a SAP to the service provider. The SAP address selector is communicated to the service provider during the creation of the SAP.
All software layers use a uniform representation for SAP address selectors and SAP addresses. Data abstractions used by software layers to represent SAP addressing are in addr.h.
A SAP address selector in general has the form:
typedef struct SapSelector {
Int len;
Byte addr[SAPSZ];
} SapSelector;
The Network layer SAP address is of particular importance and has the form:
typedef struct N_SapAddr {
Int len;
Byte addr[NSAPSZ];
} N_SapAddr;
Above the network layer, SAP addresses are constructed on top of N_SapAddr. For example, the Presentation SAP address has the form:
typedef struct P_SapAddr{
S_SapSelector ssap;
T_SapSelector tsap;
N_SapAddr nsap;
} P_SapAddr;
SAP_selGet is facility that converts an ascii representation of a SAP address into a representation suited for SapSelector or SapAddr storage.
SAP_selCmp is a facility that compares two SapSelectors for equality. Zero is returned if the two were identical. A non-zero value is returned if the two were not identical.