The information element has to absent from the SETUP message.
UNISVE_PRESENT
The information element has to be present in the SETUP message and must match the SVE.
UNISVE_ANY
The information element may be absent from the SETUP message or may have any value.
The called address is matched by a
struct unisve_addr {
enum unisve_tag tag;
enum uni_addr_type type;/* type of address */
enum uni_addr_plan plan;/* addressing plan */
u_int32_t len; /* length of address */
u_charaddr[UNI_ADDR_MAXLEN];
};
Here type is the type of address and plan is the address plan. len is the length of the address (for ATME addresses not counting the selector byte) and addr is the address itself.
In case of ATME addresses the selector byte is matched by a
struct unisve_selector {
enum unisve_tag tag;
u_int8_t selector;
};
Here selector is the selector byte that must match the 20th byte of the ATME calling address from the SETUP message.
The BLLI information element is matched by two SVEs: one for layer 2 options and one for layer 3 options. The layer 2 SVE is:
struct unisve_blli_id2 {
enum unisve_tag tag;
u_int8_t proto:5;/* the protocol */
u_int8_t user:7; /* user specific protocol */
};
Where the user fields is matched only if the proto field specifies UNI_BLLI_L2_USER. The layer 3 SVE is:
struct unisve_blli_id3 {
enum unisve_tag tag;
u_int8_t proto:5;/* L3 protocol */
u_int8_t user:7; /* user specific protocol */
u_int8_t ipi:8; /* ISO/IEC TR 9557 IPI */
u_int32_t oui:24; /* IEEE 802.1 OUI */
u_int32_t pid:16; /* IEEE 802.1 PID */
u_int32_t noipi; /* ISO/IEC TR 9557 per frame */
};
For the exact rules how matching occures refer to the source code or the ATM Forum document.
Finally the BHLI information element is matched with a
struct unisve_bhli {
enum unisve_tag tag;
enum uni_bhli type; /* type of info */
u_int32_t len; /* length of info */
u_int8_t info[8];/* info itself */
};
For each SVE type there is a function that checks whether the SVE is correct specified. The functions unisve_check_addr, unisve_check_selector, unisve_check_blli_id2, unisve_check_blli_id3, and unisve_check_bhli return one of the following error codes:
enum {
UNISVE_OK = 0,
UNISVE_ERROR_BAD_TAG,
UNISVE_ERROR_TYPE_PLAN_CONFLICT,
UNISVE_ERROR_ADDR_SEL_CONFLICT,
UNISVE_ERROR_ADDR_LEN,
UNISVE_ERROR_BAD_ADDR_TYPE,
UNISVE_ERROR_BAD_BHLI_TYPE,
UNISVE_ERROR_BAD_BHLI_LEN,
};
A code of UNISVE_OK means that the SVE has no error. The function unisve_check_sap checks a complete SAP and returns one of the above codes.
There is a definition UNISVE_ERRSTR that evaluates to a comma separated list of strings that can be used to initializes an array of char pointers to map the error codes into human readable strings.
The ATM Forum document defines the concept of overlaping SAPs. This basically means, that an incoming SETUP could match more than one SAP (and more than one application) to receive the SETUP. For each SVE type there is a function that checks whether two SVEs overlap and there is a function that checks whether two SAPs overlap. The functions unisve_overlap_addr, unisve_overlap_selector, unisve_overlap_blli_id2, unisve_overlap_blli_id3, unisve_overlap_bhli, and unisve_overlap_sap return 1 if the SVEs or SAPs overlap and 0 if they do not. They assume, that the SAPs are correct.
The ATM Forum document specifies a catch-all SAP. The function unisve_is_catchall returns 1 if the SAP is the catch-all SAP and 0 otherwise.
Finally the function unisve_match is used to match a SAP against the information elements from a SETUP message. It returns 1 if they match and 0 otherwise.