-- automatically generated by posy 7.0 #3 (wk87), do not edit!

HNMP DEFINITIONS ::=

%{
#include <stdio.h>
#include "HNMP-types.h"
%}

PREFIXES encode decode print

BEGIN


ENCODER encode

Message [[P struct type_HNMP_Message *]] ::=
        SEQUENCE
            %{
            %}
        {
            version
                INTEGER
                [[i parm -> version ]]
                {
                    version-1(1),
                    version-2(2)
                },

            community
                OCTET STRING
                [[q parm -> community ]],

            from-module-type
                INTEGER
                [[i parm -> from__module__type ]],

            from-module-id
                INTEGER
                [[i parm -> from__module__id ]],

            to-module-id
                INTEGER
                [[i parm -> to__module__id ]],

            msg-id
                INTEGER
                [[i parm -> msg__id ]],

            msg-timestamp
                TimeTicks
                [[p parm -> msg__timestamp ]],

            data
                PDU
                [[p parm -> data ]]
        }

PDU [[P struct type_HNMP_PDU *]] ::=
        CHOICE <<parm -> offset>> {
            ack
                Ack-PDU
                [[p parm -> un.ack ]],

            hello
                Hello-PDU
                [[p parm -> un.hello ]],

            welcome
                Welcome-PDU
                [[p parm -> un.welcome ]],

            goodbye
                Goodbye-PDU
                [[p parm -> un.goodbye ]],

            redirect
                Redirect-PDU
                [[p parm -> un.redirect ]],

            get-key
                GetKey-PDU
                [[p parm -> un.get__key ]],

            send-key
                SendKey-PDU
                [[p parm -> un.send__key ]],

            announce-object
                Announce-PDU
                [[p parm -> un.announce__object ]],

            delete-object
                Delete-PDU
                [[p parm -> un.delete__object ]],

            activate-object
                Activate-PDU
                [[p parm -> un.activate__object ]],

            deactivate-object
                Deactivate-PDU
                [[p parm -> un.deactivate__object ]],

            subscribe-relations
                SubRelations-PDU
                [[p parm -> un.subscribe__relations ]],

            unsubscribe-relations
                UnsubRelations-PDU
                [[p parm -> un.unsubscribe__relations ]],

            send-relations
                SendRelations-PDU
                [[p parm -> un.send__relations ]],

            subscribe-data
                SubData-PDU
                [[p parm -> un.subscribe__data ]],

            unsubscribe-data
                UnsubData-PDU
                [[p parm -> un.unsubscribe__data ]],

            send-data
                SendData-PDU
                [[p parm -> un.send__data ]],

            set-data
                SetData-PDU
                [[p parm -> un.set__data ]],

            get-data
                GetData-PDU
                [[p parm -> un.get__data ]],

            get-next-data
                GetNextData-PDU
                [[p parm -> un.get__next__data ]],

            get-walk-data
                GetWalkData-PDU
                [[p parm -> un.get__walk__data ]]
        }

Ack-PDU [[P struct type_HNMP_Ack__PDU *]] ::=
    [0]
        IMPLICIT INTEGER
        [[i parm -> parm ]]

Hello-PDU [[P struct type_HNMP_Hello__PDU *]] ::=
    [1]
        IMPLICIT NULL

Welcome-PDU [[P struct type_HNMP_Welcome__PDU *]] ::=
    [2]
        IMPLICIT NULL

Goodbye-PDU [[P struct type_HNMP_Goodbye__PDU *]] ::=
    [3]
        IMPLICIT NULL

Redirect-PDU [[P struct type_HNMP_Redirect__PDU *]] ::=
    [4]
        IMPLICIT IpAddress
        [[p parm ]]

GetKey-PDU [[P struct type_HNMP_GetKey__PDU *]] ::=
    [5]
        IMPLICIT NULL

SendKey-PDU [[P struct type_HNMP_SendKey__PDU *]] ::=
    [6]
        IMPLICIT NULL

Announce-PDU [[P struct type_HNMP_Announce__PDU *]] ::=
    [7]
        IMPLICIT ObjectBlock
        [[p parm ]]

Delete-PDU [[P struct type_HNMP_Delete__PDU *]] ::=
    [8]
        IMPLICIT ObjectId
        [[p parm ]]

Activate-PDU [[P struct type_HNMP_Activate__PDU *]] ::=
    [9]
        IMPLICIT ObjectId
        [[p parm ]]

Deactivate-PDU [[P struct type_HNMP_Deactivate__PDU *]] ::=
    [10]
        IMPLICIT ObjectId
        [[p parm ]]

SubRelations-PDU [[P struct type_HNMP_SubRelations__PDU *]] ::=
    [11]
        IMPLICIT ObjectBlock
        [[p parm ]]

UnsubRelations-PDU [[P struct type_HNMP_UnsubRelations__PDU *]] ::=
    [12]
        IMPLICIT ObjectId
        [[p parm ]]

SendRelations-PDU [[P struct type_HNMP_SendRelations__PDU *]] ::=
    [13]
        IMPLICIT ObjectBlock
        [[p parm ]]

SubData-PDU [[P struct type_HNMP_SubData__PDU *]] ::=
    [14]
        IMPLICIT ObjectBlock
        [[p parm ]]

UnsubData-PDU [[P struct type_HNMP_UnsubData__PDU *]] ::=
    [15]
        IMPLICIT ObjectId
        [[p parm ]]

SendData-PDU [[P struct type_HNMP_SendData__PDU *]] ::=
    [16]
        IMPLICIT ObjectBlock
        [[p parm ]]

SetData-PDU [[P struct type_HNMP_SetData__PDU *]] ::=
    [17]
        IMPLICIT ObjectBlock
        [[p parm ]]

GetData-PDU [[P struct type_HNMP_GetData__PDU *]] ::=
    [18]
        IMPLICIT ObjectBlock
        [[p parm ]]

GetNextData-PDU [[P struct type_HNMP_GetNextData__PDU *]] ::=
    [19]
        IMPLICIT ObjectBlock
        [[p parm ]]

GetWalkData-PDU [[P struct type_HNMP_GetWalkData__PDU *]] ::=
    [20]
        IMPLICIT ObjectBlock
        [[p parm ]]

ObjectId [[P struct type_HNMP_ObjectId *]] ::=
        INTEGER
        [[i parm -> parm ]]

ObjectBlock [[P struct type_HNMP_ObjectBlock *]] ::=
        SEQUENCE
            %{
            %}
        {
            object-id
                INTEGER
                [[i parm -> object__id ]],

            variables
                VarBindList
                [[p parm -> variables ]]
        }

VarBindList [[P struct type_HNMP_VarBindList *]] ::=
        SEQUENCE OF
            <<; parm; parm = parm -> next>>
            VarBind
            [[p parm -> VarBind ]]

VarBind [[P struct type_HNMP_VarBind *]] ::=
        SEQUENCE
            %{
            %}
        {
            name
                ObjectName
                [[p parm -> name ]],

            value
                ObjectSyntax
                [[p parm -> value ]],

            interval
                INTEGER
                [[i parm -> interval ]],

            timestamp
                TimeTicks
                [[p parm -> timestamp ]]
        }

ObjectName [[P struct type_HNMP_ObjectName *]] ::=
        OBJECT IDENTIFIER
        [[O parm ]]

ObjectSyntax [[P struct type_HNMP_ObjectSyntax *]] ::=
        ANY
        [[a parm ]]

IpAddress [[P struct type_HNMP_IpAddress *]] ::=
    [APPLICATION 0]
        IMPLICIT OCTET STRING
        [[q parm ]]

TimeTicks [[P struct type_HNMP_TimeTicks *]] ::=
    [APPLICATION 3]
        IMPLICIT INTEGER
        [[i parm -> parm ]]

DECODER decode

Message [[P struct type_HNMP_Message **]] ::=
    %{
        if ((*(parm) = (struct type_HNMP_Message *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_Message *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    %}
        SEQUENCE
            %{
            %}
        {
            version
                INTEGER
                [[i (*parm) -> version ]]
                {
                    version-1(1),
                    version-2(2)
                },

            community
                OCTET STRING
                [[q (*parm) -> community ]],

            from-module-type
                INTEGER
                [[i (*parm) -> from__module__type ]],

            from-module-id
                INTEGER
                [[i (*parm) -> from__module__id ]],

            to-module-id
                INTEGER
                [[i (*parm) -> to__module__id ]],

            msg-id
                INTEGER
                [[i (*parm) -> msg__id ]],

            msg-timestamp
                TimeTicks
                [[p &((*parm) -> msg__timestamp)]],

            data
                PDU
                [[p &((*parm) -> data)]]
        }

PDU [[P struct type_HNMP_PDU **]] ::=
    %{
        if ((*(parm) = (struct type_HNMP_PDU *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_PDU *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    %}
        CHOICE
        {
            ack
                Ack-PDU
                [[p &((*parm) -> un.ack)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_ack; %},

            hello
                Hello-PDU
                [[p &((*parm) -> un.hello)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_hello; %},

            welcome
                Welcome-PDU
                [[p &((*parm) -> un.welcome)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_welcome; %},

            goodbye
                Goodbye-PDU
                [[p &((*parm) -> un.goodbye)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_goodbye; %},

            redirect
                Redirect-PDU
                [[p &((*parm) -> un.redirect)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_redirect; %},

            get-key
                GetKey-PDU
                [[p &((*parm) -> un.get__key)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_get__key; %},

            send-key
                SendKey-PDU
                [[p &((*parm) -> un.send__key)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_send__key; %},

            announce-object
                Announce-PDU
                [[p &((*parm) -> un.announce__object)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_announce__object; %},

            delete-object
                Delete-PDU
                [[p &((*parm) -> un.delete__object)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_delete__object; %},

            activate-object
                Activate-PDU
                [[p &((*parm) -> un.activate__object)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_activate__object; %},

            deactivate-object
                Deactivate-PDU
                [[p &((*parm) -> un.deactivate__object)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_deactivate__object; %},

            subscribe-relations
                SubRelations-PDU
                [[p &((*parm) -> un.subscribe__relations)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_subscribe__relations; %},

            unsubscribe-relations
                UnsubRelations-PDU
                [[p &((*parm) -> un.unsubscribe__relations)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_unsubscribe__relations; %},

            send-relations
                SendRelations-PDU
                [[p &((*parm) -> un.send__relations)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_send__relations; %},

            subscribe-data
                SubData-PDU
                [[p &((*parm) -> un.subscribe__data)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_subscribe__data; %},

            unsubscribe-data
                UnsubData-PDU
                [[p &((*parm) -> un.unsubscribe__data)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_unsubscribe__data; %},

            send-data
                SendData-PDU
                [[p &((*parm) -> un.send__data)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_send__data; %},

            set-data
                SetData-PDU
                [[p &((*parm) -> un.set__data)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_set__data; %},

            get-data
                GetData-PDU
                [[p &((*parm) -> un.get__data)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_get__data; %},

            get-next-data
                GetNextData-PDU
                [[p &((*parm) -> un.get__next__data)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_get__next__data; %},

            get-walk-data
                GetWalkData-PDU
                [[p &((*parm) -> un.get__walk__data)]]
                %{ (*(parm)) -> offset = type_HNMP_PDU_get__walk__data; %}
        }

Ack-PDU [[P struct type_HNMP_Ack__PDU **]] ::=
    %{
        if ((*(parm) = (struct type_HNMP_Ack__PDU *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_Ack__PDU *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    %}
    [0]
        IMPLICIT INTEGER
        [[i (*parm) -> parm ]]

Hello-PDU [[P struct type_HNMP_Hello__PDU **]] ::=
    %{
        if ((*(parm) = (struct type_HNMP_Hello__PDU *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_Hello__PDU *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    %}
    [1]
        IMPLICIT NULL

Welcome-PDU [[P struct type_HNMP_Welcome__PDU **]] ::=
    %{
        if ((*(parm) = (struct type_HNMP_Welcome__PDU *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_Welcome__PDU *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    %}
    [2]
        IMPLICIT NULL

Goodbye-PDU [[P struct type_HNMP_Goodbye__PDU **]] ::=
    %{
        if ((*(parm) = (struct type_HNMP_Goodbye__PDU *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_Goodbye__PDU *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    %}
    [3]
        IMPLICIT NULL

Redirect-PDU [[P struct type_HNMP_Redirect__PDU **]] ::=
    [4]
        IMPLICIT IpAddress
        [[p &((*parm))]]

GetKey-PDU [[P struct type_HNMP_GetKey__PDU **]] ::=
    %{
        if ((*(parm) = (struct type_HNMP_GetKey__PDU *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_GetKey__PDU *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    %}
    [5]
        IMPLICIT NULL

SendKey-PDU [[P struct type_HNMP_SendKey__PDU **]] ::=
    %{
        if ((*(parm) = (struct type_HNMP_SendKey__PDU *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_SendKey__PDU *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    %}
    [6]
        IMPLICIT NULL

Announce-PDU [[P struct type_HNMP_Announce__PDU **]] ::=
    [7]
        IMPLICIT ObjectBlock
        [[p &((*parm))]]

Delete-PDU [[P struct type_HNMP_Delete__PDU **]] ::=
    [8]
        IMPLICIT ObjectId
        [[p &((*parm))]]

Activate-PDU [[P struct type_HNMP_Activate__PDU **]] ::=
    [9]
        IMPLICIT ObjectId
        [[p &((*parm))]]

Deactivate-PDU [[P struct type_HNMP_Deactivate__PDU **]] ::=
    [10]
        IMPLICIT ObjectId
        [[p &((*parm))]]

SubRelations-PDU [[P struct type_HNMP_SubRelations__PDU **]] ::=
    [11]
        IMPLICIT ObjectBlock
        [[p &((*parm))]]

UnsubRelations-PDU [[P struct type_HNMP_UnsubRelations__PDU **]] ::=
    [12]
        IMPLICIT ObjectId
        [[p &((*parm))]]

SendRelations-PDU [[P struct type_HNMP_SendRelations__PDU **]] ::=
    [13]
        IMPLICIT ObjectBlock
        [[p &((*parm))]]

SubData-PDU [[P struct type_HNMP_SubData__PDU **]] ::=
    [14]
        IMPLICIT ObjectBlock
        [[p &((*parm))]]

UnsubData-PDU [[P struct type_HNMP_UnsubData__PDU **]] ::=
    [15]
        IMPLICIT ObjectId
        [[p &((*parm))]]

SendData-PDU [[P struct type_HNMP_SendData__PDU **]] ::=
    [16]
        IMPLICIT ObjectBlock
        [[p &((*parm))]]

SetData-PDU [[P struct type_HNMP_SetData__PDU **]] ::=
    [17]
        IMPLICIT ObjectBlock
        [[p &((*parm))]]

GetData-PDU [[P struct type_HNMP_GetData__PDU **]] ::=
    [18]
        IMPLICIT ObjectBlock
        [[p &((*parm))]]

GetNextData-PDU [[P struct type_HNMP_GetNextData__PDU **]] ::=
    [19]
        IMPLICIT ObjectBlock
        [[p &((*parm))]]

GetWalkData-PDU [[P struct type_HNMP_GetWalkData__PDU **]] ::=
    [20]
        IMPLICIT ObjectBlock
        [[p &((*parm))]]

ObjectId [[P struct type_HNMP_ObjectId **]] ::=
    %{
        if ((*(parm) = (struct type_HNMP_ObjectId *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_ObjectId *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    %}
        INTEGER
        [[i (*parm) -> parm ]]

ObjectBlock [[P struct type_HNMP_ObjectBlock **]] ::=
    %{
        if ((*(parm) = (struct type_HNMP_ObjectBlock *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_ObjectBlock *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    %}
        SEQUENCE
            %{
            %}
        {
            object-id
                INTEGER
                [[i (*parm) -> object__id ]],

            variables
                VarBindList
                [[p &((*parm) -> variables)]]
        }

VarBindList [[P struct type_HNMP_VarBindList **]] ::=
        SEQUENCE OF
            %{
                if ((*(parm) = (struct type_HNMP_VarBindList *)
                        calloc (1, sizeof **(parm))) == ((struct type_HNMP_VarBindList *) 0)) {
                    advise (NULLCP, "%s", PEPY_ERR_NOMEM);
                    return NOTOK;
                }
            %}
            VarBind
            [[p &((*parm) -> VarBind)]]
            %{ parm = &((*parm) -> next); %}

VarBind [[P struct type_HNMP_VarBind **]] ::=
    %{
        if ((*(parm) = (struct type_HNMP_VarBind *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_VarBind *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    %}
        SEQUENCE
            %{
            %}
        {
            name
                ObjectName
                [[p &((*parm) -> name)]],

            value
                ObjectSyntax
                [[p &((*parm) -> value)]],

            interval
                INTEGER
                [[i (*parm) -> interval ]],

            timestamp
                TimeTicks
                [[p &((*parm) -> timestamp)]]
        }

ObjectName [[P struct type_HNMP_ObjectName **]] ::=
        OBJECT IDENTIFIER
        [[O (*parm) ]]

ObjectSyntax [[P struct type_HNMP_ObjectSyntax **]] ::=
        ANY
        [[a (*parm) ]]

IpAddress [[P struct type_HNMP_IpAddress **]] ::=
    [APPLICATION 0]
        IMPLICIT OCTET STRING
        [[q (*parm) ]]

TimeTicks [[P struct type_HNMP_TimeTicks **]] ::=
    %{
        if ((*(parm) = (struct type_HNMP_TimeTicks *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_TimeTicks *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    %}
    [APPLICATION 3]
        IMPLICIT INTEGER
        [[i (*parm) -> parm ]]

END

%{

free_HNMP_Message (arg)
struct type_HNMP_Message *arg;
{
    struct type_HNMP_Message *parm = arg;

    if (parm == NULL)
	return;

    if (parm -> community)
        qb_free (parm -> community),
            parm -> community = NULL;
    if (parm -> msg__timestamp)
        free_HNMP_TimeTicks (parm -> msg__timestamp),
            parm -> msg__timestamp = NULL;
    if (parm -> data)
        free_HNMP_PDU (parm -> data),
            parm -> data = NULL;

    free ((char *) arg);
}

free_HNMP_PDU (arg)
struct type_HNMP_PDU *arg;
{
    struct type_HNMP_PDU *parm = arg;

    if (parm == NULL)
	return;

    switch (parm -> offset) {
        case type_HNMP_PDU_ack:
            if (parm -> un.ack)
                free_HNMP_Ack__PDU (parm -> un.ack),
                    parm -> un.ack = NULL;
            break;

        case type_HNMP_PDU_hello:
            if (parm -> un.hello)
                free_HNMP_Hello__PDU (parm -> un.hello),
                    parm -> un.hello = NULL;
            break;

        case type_HNMP_PDU_welcome:
            if (parm -> un.welcome)
                free_HNMP_Welcome__PDU (parm -> un.welcome),
                    parm -> un.welcome = NULL;
            break;

        case type_HNMP_PDU_goodbye:
            if (parm -> un.goodbye)
                free_HNMP_Goodbye__PDU (parm -> un.goodbye),
                    parm -> un.goodbye = NULL;
            break;

        case type_HNMP_PDU_redirect:
            if (parm -> un.redirect)
                free_HNMP_Redirect__PDU (parm -> un.redirect),
                    parm -> un.redirect = NULL;
            break;

        case type_HNMP_PDU_get__key:
            if (parm -> un.get__key)
                free_HNMP_GetKey__PDU (parm -> un.get__key),
                    parm -> un.get__key = NULL;
            break;

        case type_HNMP_PDU_send__key:
            if (parm -> un.send__key)
                free_HNMP_SendKey__PDU (parm -> un.send__key),
                    parm -> un.send__key = NULL;
            break;

        case type_HNMP_PDU_announce__object:
            if (parm -> un.announce__object)
                free_HNMP_Announce__PDU (parm -> un.announce__object),
                    parm -> un.announce__object = NULL;
            break;

        case type_HNMP_PDU_delete__object:
            if (parm -> un.delete__object)
                free_HNMP_Delete__PDU (parm -> un.delete__object),
                    parm -> un.delete__object = NULL;
            break;

        case type_HNMP_PDU_activate__object:
            if (parm -> un.activate__object)
                free_HNMP_Activate__PDU (parm -> un.activate__object),
                    parm -> un.activate__object = NULL;
            break;

        case type_HNMP_PDU_deactivate__object:
            if (parm -> un.deactivate__object)
                free_HNMP_Deactivate__PDU (parm -> un.deactivate__object),
                    parm -> un.deactivate__object = NULL;
            break;

        case type_HNMP_PDU_subscribe__relations:
            if (parm -> un.subscribe__relations)
                free_HNMP_SubRelations__PDU (parm -> un.subscribe__relations),
                    parm -> un.subscribe__relations = NULL;
            break;

        case type_HNMP_PDU_unsubscribe__relations:
            if (parm -> un.unsubscribe__relations)
                free_HNMP_UnsubRelations__PDU (parm -> un.unsubscribe__relations),
                    parm -> un.unsubscribe__relations = NULL;
            break;

        case type_HNMP_PDU_send__relations:
            if (parm -> un.send__relations)
                free_HNMP_SendRelations__PDU (parm -> un.send__relations),
                    parm -> un.send__relations = NULL;
            break;

        case type_HNMP_PDU_subscribe__data:
            if (parm -> un.subscribe__data)
                free_HNMP_SubData__PDU (parm -> un.subscribe__data),
                    parm -> un.subscribe__data = NULL;
            break;

        case type_HNMP_PDU_unsubscribe__data:
            if (parm -> un.unsubscribe__data)
                free_HNMP_UnsubData__PDU (parm -> un.unsubscribe__data),
                    parm -> un.unsubscribe__data = NULL;
            break;

        case type_HNMP_PDU_send__data:
            if (parm -> un.send__data)
                free_HNMP_SendData__PDU (parm -> un.send__data),
                    parm -> un.send__data = NULL;
            break;

        case type_HNMP_PDU_set__data:
            if (parm -> un.set__data)
                free_HNMP_SetData__PDU (parm -> un.set__data),
                    parm -> un.set__data = NULL;
            break;

        case type_HNMP_PDU_get__data:
            if (parm -> un.get__data)
                free_HNMP_GetData__PDU (parm -> un.get__data),
                    parm -> un.get__data = NULL;
            break;

        case type_HNMP_PDU_get__next__data:
            if (parm -> un.get__next__data)
                free_HNMP_GetNextData__PDU (parm -> un.get__next__data),
                    parm -> un.get__next__data = NULL;
            break;

        case type_HNMP_PDU_get__walk__data:
            if (parm -> un.get__walk__data)
                free_HNMP_GetWalkData__PDU (parm -> un.get__walk__data),
                    parm -> un.get__walk__data = NULL;
            break;
    }

    free ((char *) arg);
}

free_HNMP_Ack__PDU (arg)
struct type_HNMP_Ack__PDU *arg;
{
    struct type_HNMP_Ack__PDU *parm = arg;

    if (parm == NULL)
	return;


    free ((char *) arg);
}

free_HNMP_Hello__PDU (arg)
struct type_HNMP_Hello__PDU *arg;
{
    struct type_HNMP_Hello__PDU *parm = arg;

    if (parm == NULL)
	return;


    free ((char *) arg);
}

free_HNMP_Welcome__PDU (arg)
struct type_HNMP_Welcome__PDU *arg;
{
    struct type_HNMP_Welcome__PDU *parm = arg;

    if (parm == NULL)
	return;


    free ((char *) arg);
}

free_HNMP_Goodbye__PDU (arg)
struct type_HNMP_Goodbye__PDU *arg;
{
    struct type_HNMP_Goodbye__PDU *parm = arg;

    if (parm == NULL)
	return;


    free ((char *) arg);
}

free_HNMP_GetKey__PDU (arg)
struct type_HNMP_GetKey__PDU *arg;
{
    struct type_HNMP_GetKey__PDU *parm = arg;

    if (parm == NULL)
	return;


    free ((char *) arg);
}

free_HNMP_SendKey__PDU (arg)
struct type_HNMP_SendKey__PDU *arg;
{
    struct type_HNMP_SendKey__PDU *parm = arg;

    if (parm == NULL)
	return;


    free ((char *) arg);
}

free_HNMP_ObjectId (arg)
struct type_HNMP_ObjectId *arg;
{
    struct type_HNMP_ObjectId *parm = arg;

    if (parm == NULL)
	return;


    free ((char *) arg);
}

free_HNMP_ObjectBlock (arg)
struct type_HNMP_ObjectBlock *arg;
{
    struct type_HNMP_ObjectBlock *parm = arg;

    if (parm == NULL)
	return;

    if (parm -> variables)
        free_HNMP_VarBindList (parm -> variables),
            parm -> variables = NULL;

    free ((char *) arg);
}

free_HNMP_VarBindList (arg)
struct type_HNMP_VarBindList *arg;
{
    struct type_HNMP_VarBindList *parm = arg;

    if (parm == NULL)
	return;

    for (parm = parm; parm;) {
        struct type_HNMP_VarBindList *f_parm = parm -> next;

        if (parm -> VarBind)
            free_HNMP_VarBind (parm -> VarBind),
                parm -> VarBind = NULL;

        if (parm)
            free ((char *) parm);
        parm = f_parm;
    }

}

free_HNMP_VarBind (arg)
struct type_HNMP_VarBind *arg;
{
    struct type_HNMP_VarBind *parm = arg;

    if (parm == NULL)
	return;

    if (parm -> name)
        free_HNMP_ObjectName (parm -> name),
            parm -> name = NULL;
    if (parm -> value)
        free_HNMP_ObjectSyntax (parm -> value),
            parm -> value = NULL;
    if (parm -> timestamp)
        free_HNMP_TimeTicks (parm -> timestamp),
            parm -> timestamp = NULL;

    free ((char *) arg);
}

free_HNMP_TimeTicks (arg)
struct type_HNMP_TimeTicks *arg;
{
    struct type_HNMP_TimeTicks *parm = arg;

    if (parm == NULL)
	return;


    free ((char *) arg);
}

%}
