File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / dsap / x500as / nrs-dec.py
Revision 1.1: download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
CVS tags: MAIN, HEAD
Initial revision

-- nrs-dec.py - additional QUIPU NRS type definitions module

--
--				  NOTICE
--
--    Acquisition, use, and distribution of this module and related
--    materials are subject to the restrictions of a license agreement.
--    Consult the Preface in the User's Manual for the full terms of
--    this agreement.
--
--


QuipuNRS
	{
	ccitt
	data(9)
	pss(2342)
	ucl(19200300)
	quipu(99)
	nRSDefinitions(2)
	}

DEFINITIONS ::=

%{
#include <stdio.h>
#include "quipu/util.h"
#include "quipu/nrs_info.h"

extern  LLog    * log_dsap;
#define decode_UNIV_NumericString parse_UNIV_NumericString
#define decode_UNIV_VisibleString parse_UNIV_VisibleString
#define decode_UNIV_OCTETSTRING parse_UNIV_OCTETSTRING
%}

PREFIXES encode decode print

BEGIN

DECODER decode

Context [[P int *]]
	::=
        INTEGER
        [[i (*parm)]]
        {
            context-unknown(-1),
            x29(0),
            ts29(1),
            niftp(2),
            mail-niftp(3),
            not-used(4),
            mail-telex(5),
            jtmp(6),
            jtmp-files(7),
            jtmp-reg(8),
            ybts-node(9),
            ybts(10),
            ftam(11),
            jtm(12),
            jtm-reg(13),
            vt(14),
            motis(15)
        }

Address-space-id [[P int *]]
	::=
        INTEGER
        [[i (*parm)]]
        {
            pss(0),
            janet(1),
            telex(2),
            osi-cons(3)
        }

Route-cost [[P PE *]]
	::=
        ANY
        [[a (*parm)]]

Addressing-info [[P struct addr_info **]]
    %{
	struct str_seq		**ss;
    %}
	::=
    %{
	if(((*parm) = (struct addr_info *) calloc(1, sizeof(struct addr_info))) == (struct addr_info *)NULL)
	{
	}
    %}
        CHOICE
        {
        dte-only
		[0] NumericString [[s (*parm)->dte_number]]
            %{
		(*parm)->addr_info_type = ADDR_INFO_DTE_ONLY;
	    %} ,

        dte-appli-info
		[1] SEQUENCE
                    %{
			ss = &((*parm)->applic_info);
                    %}
                {
		dte-number
			[0] NumericString [[s (*parm)->dte_number]] ,

		applic-info
			[1] SEQUENCE OF
                            %{
				if(((*ss) = (struct str_seq *) calloc(1, sizeof(struct str_seq))) == (struct str_seq *)NULL)
				{
				}
                            %}
				VisibleString [[s (*ss)->ss_str]]
                            %{
				ss = &((*ss)->ss_next);
			    %}
            	    %{
			(*ss) = (struct str_seq *)NULL;
	            %}
                }
            %{
		(*parm)->addr_info_type = ADDR_INFO_DTE_APPLIC_INFO;
	    %} ,

	dte-cudf
		[2] SEQUENCE
                {
                dte-number
			[0] NumericString [[s (*parm)->dte_number]] ,

                cudf
			[1] OCTET STRING [[s (*parm)->cudf]]
                }
            %{
		(*parm)->addr_info_type = ADDR_INFO_DTE_CUDF;
	    %} ,

        dte-cudf-applic-info
		[3] SEQUENCE
                    %{
			ss = &((*parm)->applic_info);
                    %}
                {
                dte-number
			[0] NumericString [[s (*parm)->dte_number]] ,

                cudf
			[1] OCTET STRING [[s (*parm)->cudf]] ,

                applic-info
			[2] SEQUENCE OF
                            %{
				if(((*ss) = (struct str_seq *) calloc(1, sizeof(struct str_seq))) == (struct str_seq *)NULL)
				{
				}
                            %}
                        	VisibleString [[s (*ss)->ss_str]]
                            %{
				ss = &((*ss)->ss_next);
			    %}
                    %{
		        (*ss) = (struct str_seq *)NULL;
		    %}
                }
            %{
		(*parm)->addr_info_type = ADDR_INFO_DTE_CUDF_APPLIC_INFO;
	    %} ,

        dte-ybts
		[4] SEQUENCE
                {
                dte-number
			[0] NumericString [[s (*parm)->dte_number]] ,

                ybts-string
			[1] VisibleString [[s (*parm)->ybts_string]]
                }
            %{
	        (*parm)->addr_info_type = ADDR_INFO_DTE_YBTS;
	    %} ,

            dte-ybts-applic-info[5]
                SEQUENCE
                    %{
			ss = &((*parm)->applic_info);
                    %}
                {
                dte-number
			[0] NumericString [[s (*parm)->dte_number]] ,

                ybts-string
			[1] VisibleString [[s (*parm)->ybts_string]] ,

                applic-info
			[2] SEQUENCE OF
                            %{
				if(((*ss) = (struct str_seq *) calloc(1, sizeof(struct str_seq))) == (struct str_seq *)NULL)
				{
				}
                            %}
                        	VisibleString [[s (*ss)->ss_str]]
                            %{
				ss = &((*ss)->ss_next);
			    %}
                    %{
		        (*ss) = (struct str_seq *)NULL;
		    %}
                }
            %{
		(*parm)->addr_info_type = ADDR_INFO_DTE_YBTS_APPLIC_INFO;
	    %} ,

            dte-ybts-appli-relays[6]
                SEQUENCE
                    %{
			ss = &((*parm)->applic_relay);
                    %}
                {
                dte-number
			[0] NumericString [[s (*parm)->dte_number]] ,

                ybts-string
			[1] VisibleString [[s (*parm)->ybts_string]] ,

                applic-relay
			[2] SEQUENCE OF
                            %{
				if(((*ss) = (struct str_seq *) calloc(1, sizeof(struct str_seq))) == (struct str_seq *)NULL)
				{
				}
                            %}
                                VisibleString [[s (*ss)->ss_str]]
                            %{
				ss = &((*ss)->ss_next);
			    %}
                    %{
		        (*ss) = (struct str_seq *)NULL;
		    %}
                }
            %{
		(*parm)->addr_info_type = ADDR_INFO_DTE_YBTS_APPLIC_RELAY;
	    %} ,

        none-needed
		[7] NULL
            %{
		(*parm)->addr_info_type = ADDR_INFO_NONE_NEEDED;
	    %} ,

        osi-addressing
		[8] SEQUENCE
                {
                nsap
			[0] NumericString [[s (*parm)->nsap]] ,

                tselector
			[1] OCTET STRING [[s (*parm)->tselector]]
                            OPTIONAL ,

                sselector
			[2] OCTET STRING [[s (*parm)->sselector]]
                            OPTIONAL ,

                pselector
			[3] OCTET STRING [[s (*parm)->pselector]]
                            OPTIONAL ,

                place-holder
			[4] ANY [[a (*parm)->place_holder]]
                            OPTIONAL ,

                application-title
			[5] ANY [[a (*parm)->application_title]]
                            OPTIONAL ,

                per-application-context-info
			[6] ANY [[a (*parm)->per_app_context_info]]
                            OPTIONAL
                }
            %{
		(*parm)->addr_info_type = ADDR_INFO_OSI_ADDRESSING;
	    %} ,

        osi-nsap-only
		[9] NumericString [[s (*parm)->nsap]]
            %{
		(*parm)->addr_info_type = ADDR_INFO_OSI_NSAP_ONLY;
	    %} ,

        osi-nsap-applic-info
		[10] SEQUENCE
                    %{
			ss = &((*parm)->applic_info);
                    %}
                {
                nsap
			[0] NumericString [[s (*parm)->nsap]] ,

                applic-info
			[1] SEQUENCE OF
                            %{
				if(((*ss) = (struct str_seq *) calloc(1, sizeof(struct str_seq))) == (struct str_seq *)NULL)
				{
				}
                            %}
                        	VisibleString [[s (*ss)->ss_str]]
                            %{
				ss = &((*ss)->ss_next);
			    %}
                    %{
		        (*ss) = (struct str_seq *)NULL;
		    %}
                }
            %{
		(*parm)->addr_info_type = ADDR_INFO_OSI_NSAP_APPLIC_INFO;
	    %} ,

        osi-nsap-applic-relays
		[11] SEQUENCE
                    %{
			ss = &((*parm)->applic_relay);
                    %}
                {
                nsap
			[0] NumericString [[s (*parm)->nsap]] ,

                applic-relay
			[1] SEQUENCE OF
                            %{
				if(((*ss) = (struct str_seq *) calloc(1, sizeof(struct str_seq))) == (struct str_seq *)NULL)
				{
				}
                            %}
                                VisibleString [[s (*ss)->ss_str]]
                            %{
				ss = &((*ss)->ss_next);
			    %}
                    %{
		        (*ss) = (struct str_seq *)NULL;
		    %}
                }
            %{
		(*parm)->addr_info_type = ADDR_INFO_OSI_NSAP_APPLIC_RELAY;
	    %} ,

        dte-ybts-osi-addressing
		[12] SEQUENCE
                {
                dte-number
			[0] NumericString [[s (*parm)->dte_number]] ,

                ybts-string
			[1] VisibleString [[s (*parm)->ybts_string]] ,

                tselector
			[2] OCTET STRING [[s (*parm)->tselector]]
                            OPTIONAL ,

                sselector
			[3] OCTET STRING [[s (*parm)->sselector]]
                            OPTIONAL ,

                pselector
			[4] OCTET STRING [[s (*parm)->pselector]]
                            OPTIONAL ,

                place-holder
			[5] ANY [[a (*parm)->place_holder]]
                            OPTIONAL ,

                application-title
			[6] ANY [[a (*parm)->application_title]]
                            OPTIONAL ,

                per-application-context-info
			[7] ANY [[a (*parm)->per_app_context_info]]
                            OPTIONAL
                }
            %{
		(*parm)->addr_info_type = ADDR_INFO_DTE_YBTS_OSI_ADDRESSING;
	    %}
        }

NRSInformation [[P struct nrs_info **]]
    %{
	struct nrs_routes	**rt;
    %}
	::=
    %{
	if(((*parm) = (struct nrs_info *) calloc(1, sizeof(struct nrs_info))) == (struct nrs_info *)NULL)
	{
	}
    %}
	SET
	{
		[0] Context [[p &((*parm)->context)]],
		[1] Address-space-id [[p &((*parm)->addr_sp_id)]],
	routes
	    %{
		rt = &((*parm)->routes);
	    %}
		[2] SEQUENCE OF
		    %{
			if(((*rt) = (struct nrs_routes *) calloc(1, sizeof(struct nrs_routes))) == (struct nrs_routes *)NULL)
			{
			}
		    %}
			SEQUENCE
			{
				Route-cost [[p &((*rt)->cost)]],
				Addressing-info [[p &((*rt)->addr_info)]]
			}
		    %{
			rt = &((*rt)->next);
		    %}
	    %{
		(*rt) = (struct nrs_routes *)NULL;
	    %}
	}

END


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.