/* automatically generated by pepy 7.0 #3 (wk87), do not edit! */

#include <isode/psap.h>

static char *pepyid = "pepy 7.0 #3 (wk87) of Fri Jul 26 17:16:06 PDT 1991";

void	advise ();

/* Generated from module HNMP */
# line 5 "gen/HNMP-types.py"

#include <stdio.h>
#include "HNMP-types.h"

#ifndef PEPYPARM
#define PEPYPARM char *
#endif /* PEPYPARM */
extern PEPYPARM NullParm;

/* ARGSUSED */

int	encode_HNMP_Message (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_Message * parm;
{
    PE	p0_z = NULLPE;
    register PE *p0 = &p0_z;

    if (((*pe) = pe_alloc (PE_CLASS_UNIV, PE_FORM_CONS, PE_CONS_SEQ)) == NULLPE) {
        advise (NULLCP, "Message: %s", PEPY_ERR_NOMEM);
        return NOTOK;
    }
    {
# line 19 "gen/HNMP-types.py"

            
    }
    (*p0) = NULLPE;

    {	/* version */
        register integer p1 = parm -> version ;

        if (((*p0) = num2prim (p1, PE_CLASS_UNIV, PE_PRIM_INT)) == NULLPE) {
            advise (NULLCP, "version: %s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
        switch (p1) {
            case 1:	/* version-1 */
                break;
            case 2:	/* version-2 */
                break;
        }

#ifdef DEBUG
        (void) testdebug ((*p0), "version");
#endif

    }

    if ((*p0) != NULLPE)
        if (seq_add ((*pe), (*p0), -1) == NOTOK) {
            advise (NULLCP, "Message %s%s", PEPY_ERR_BAD_SEQ,
                    pe_error ((*pe) -> pe_errno));
            return NOTOK;
        }
    (*p0) = NULLPE;

    {	/* community */
        register struct qbuf *p2;

        p2 = parm -> community ;
        if (p2 == ((struct qbuf *) 0)) {
            advise (NULLCP, "community %s", PEPY_ERR_INIT_FAILED);
            return NOTOK;
        }
        if (((*p0) = qb2prim (p2, PE_CLASS_UNIV, PE_PRIM_OCTS)) == NULLPE) {
            advise (NULLCP, "community: %s", PEPY_ERR_NOMEM);
            return NOTOK;
        }

#ifdef DEBUG
        (void) testdebug ((*p0), "community");
#endif

    }

    if ((*p0) != NULLPE)
        if (seq_add ((*pe), (*p0), -1) == NOTOK) {
            advise (NULLCP, "Message %s%s", PEPY_ERR_BAD_SEQ,
                    pe_error ((*pe) -> pe_errno));
            return NOTOK;
        }
    (*p0) = NULLPE;

    {	/* from-module-type */
        register integer p3 = parm -> from__module__type ;

        if (((*p0) = num2prim (p3, PE_CLASS_UNIV, PE_PRIM_INT)) == NULLPE) {
            advise (NULLCP, "from-module-type: %s", PEPY_ERR_NOMEM);
            return NOTOK;
        }

#ifdef DEBUG
        (void) testdebug ((*p0), "from-module-type");
#endif

    }

    if ((*p0) != NULLPE)
        if (seq_add ((*pe), (*p0), -1) == NOTOK) {
            advise (NULLCP, "Message %s%s", PEPY_ERR_BAD_SEQ,
                    pe_error ((*pe) -> pe_errno));
            return NOTOK;
        }
    (*p0) = NULLPE;

    {	/* from-module-id */
        register integer p4 = parm -> from__module__id ;

        if (((*p0) = num2prim (p4, PE_CLASS_UNIV, PE_PRIM_INT)) == NULLPE) {
            advise (NULLCP, "from-module-id: %s", PEPY_ERR_NOMEM);
            return NOTOK;
        }

#ifdef DEBUG
        (void) testdebug ((*p0), "from-module-id");
#endif

    }

    if ((*p0) != NULLPE)
        if (seq_add ((*pe), (*p0), -1) == NOTOK) {
            advise (NULLCP, "Message %s%s", PEPY_ERR_BAD_SEQ,
                    pe_error ((*pe) -> pe_errno));
            return NOTOK;
        }
    (*p0) = NULLPE;

    {	/* to-module-id */
        register integer p5 = parm -> to__module__id ;

        if (((*p0) = num2prim (p5, PE_CLASS_UNIV, PE_PRIM_INT)) == NULLPE) {
            advise (NULLCP, "to-module-id: %s", PEPY_ERR_NOMEM);
            return NOTOK;
        }

#ifdef DEBUG
        (void) testdebug ((*p0), "to-module-id");
#endif

    }

    if ((*p0) != NULLPE)
        if (seq_add ((*pe), (*p0), -1) == NOTOK) {
            advise (NULLCP, "Message %s%s", PEPY_ERR_BAD_SEQ,
                    pe_error ((*pe) -> pe_errno));
            return NOTOK;
        }
    (*p0) = NULLPE;

    {	/* msg-id */
        register integer p6 = parm -> msg__id ;

        if (((*p0) = num2prim (p6, PE_CLASS_UNIV, PE_PRIM_INT)) == NULLPE) {
            advise (NULLCP, "msg-id: %s", PEPY_ERR_NOMEM);
            return NOTOK;
        }

#ifdef DEBUG
        (void) testdebug ((*p0), "msg-id");
#endif

    }

    if ((*p0) != NULLPE)
        if (seq_add ((*pe), (*p0), -1) == NOTOK) {
            advise (NULLCP, "Message %s%s", PEPY_ERR_BAD_SEQ,
                    pe_error ((*pe) -> pe_errno));
            return NOTOK;
        }
    (*p0) = NULLPE;

    {	/* msg-timestamp */
        if (encode_HNMP_TimeTicks (p0, 0, NULL, NULLCP, parm -> msg__timestamp ) == NOTOK)
            return NOTOK;

#ifdef DEBUG
        (void) testdebug ((*p0), "msg-timestamp");
#endif

    }

    if ((*p0) != NULLPE)
        if (seq_add ((*pe), (*p0), -1) == NOTOK) {
            advise (NULLCP, "Message %s%s", PEPY_ERR_BAD_SEQ,
                    pe_error ((*pe) -> pe_errno));
            return NOTOK;
        }
    (*p0) = NULLPE;

    {	/* data */
        if (encode_HNMP_PDU (p0, 0, NULL, NULLCP, parm -> data ) == NOTOK)
            return NOTOK;

#ifdef DEBUG
        (void) testdebug ((*p0), "data");
#endif

    }

    if ((*p0) != NULLPE)
        if (seq_add ((*pe), (*p0), -1) == NOTOK) {
            advise (NULLCP, "Message %s%s", PEPY_ERR_BAD_SEQ,
                    pe_error ((*pe) -> pe_errno));
            return NOTOK;
        }

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.Message");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_PDU * parm;
{
    int	p7;

    switch (p7 = (parm -> offset)) {
        case 1:	/* ack */
            {
                if (encode_HNMP_Ack__PDU (pe, 0, NULL, NULLCP, parm -> un.ack ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "ack");
#endif

            }
            break;
        case 2:	/* hello */
            {
                if (encode_HNMP_Hello__PDU (pe, 0, NULL, NULLCP, parm -> un.hello ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "hello");
#endif

            }
            break;
        case 3:	/* welcome */
            {
                if (encode_HNMP_Welcome__PDU (pe, 0, NULL, NULLCP, parm -> un.welcome ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "welcome");
#endif

            }
            break;
        case 4:	/* goodbye */
            {
                if (encode_HNMP_Goodbye__PDU (pe, 0, NULL, NULLCP, parm -> un.goodbye ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "goodbye");
#endif

            }
            break;
        case 5:	/* redirect */
            {
                if (encode_HNMP_Redirect__PDU (pe, 0, NULL, NULLCP, parm -> un.redirect ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "redirect");
#endif

            }
            break;
        case 6:	/* get-key */
            {
                if (encode_HNMP_GetKey__PDU (pe, 0, NULL, NULLCP, parm -> un.get__key ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "get-key");
#endif

            }
            break;
        case 7:	/* send-key */
            {
                if (encode_HNMP_SendKey__PDU (pe, 0, NULL, NULLCP, parm -> un.send__key ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "send-key");
#endif

            }
            break;
        case 8:	/* announce-object */
            {
                if (encode_HNMP_Announce__PDU (pe, 0, NULL, NULLCP, parm -> un.announce__object ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "announce-object");
#endif

            }
            break;
        case 9:	/* delete-object */
            {
                if (encode_HNMP_Delete__PDU (pe, 0, NULL, NULLCP, parm -> un.delete__object ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "delete-object");
#endif

            }
            break;
        case 10:	/* activate-object */
            {
                if (encode_HNMP_Activate__PDU (pe, 0, NULL, NULLCP, parm -> un.activate__object ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "activate-object");
#endif

            }
            break;
        case 11:	/* deactivate-object */
            {
                if (encode_HNMP_Deactivate__PDU (pe, 0, NULL, NULLCP, parm -> un.deactivate__object ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "deactivate-object");
#endif

            }
            break;
        case 12:	/* subscribe-relations */
            {
                if (encode_HNMP_SubRelations__PDU (pe, 0, NULL, NULLCP, parm -> un.subscribe__relations ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "subscribe-relations");
#endif

            }
            break;
        case 13:	/* unsubscribe-relations */
            {
                if (encode_HNMP_UnsubRelations__PDU (pe, 0, NULL, NULLCP, parm -> un.unsubscribe__relations ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "unsubscribe-relations");
#endif

            }
            break;
        case 14:	/* send-relations */
            {
                if (encode_HNMP_SendRelations__PDU (pe, 0, NULL, NULLCP, parm -> un.send__relations ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "send-relations");
#endif

            }
            break;
        case 15:	/* subscribe-data */
            {
                if (encode_HNMP_SubData__PDU (pe, 0, NULL, NULLCP, parm -> un.subscribe__data ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "subscribe-data");
#endif

            }
            break;
        case 16:	/* unsubscribe-data */
            {
                if (encode_HNMP_UnsubData__PDU (pe, 0, NULL, NULLCP, parm -> un.unsubscribe__data ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "unsubscribe-data");
#endif

            }
            break;
        case 17:	/* send-data */
            {
                if (encode_HNMP_SendData__PDU (pe, 0, NULL, NULLCP, parm -> un.send__data ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "send-data");
#endif

            }
            break;
        case 18:	/* set-data */
            {
                if (encode_HNMP_SetData__PDU (pe, 0, NULL, NULLCP, parm -> un.set__data ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "set-data");
#endif

            }
            break;
        case 19:	/* get-data */
            {
                if (encode_HNMP_GetData__PDU (pe, 0, NULL, NULLCP, parm -> un.get__data ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "get-data");
#endif

            }
            break;
        case 20:	/* get-next-data */
            {
                if (encode_HNMP_GetNextData__PDU (pe, 0, NULL, NULLCP, parm -> un.get__next__data ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "get-next-data");
#endif

            }
            break;
        case 21:	/* get-walk-data */
            {
                if (encode_HNMP_GetWalkData__PDU (pe, 0, NULL, NULLCP, parm -> un.get__walk__data ) == NOTOK)
                    return NOTOK;

#ifdef DEBUG
                (void) testdebug ((*pe), "get-walk-data");
#endif

            }
            break;

        default:
            advise (NULLCP, "PDU %s%d", PEPY_ERR_INVALID_CHOICE, 
                    p7);
            return NOTOK;
    }

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_Ack__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_Ack__PDU * parm;
{
    register integer p8 = parm -> parm ;

    if (((*pe) = num2prim (p8, PE_CLASS_CONT, 0)) == NULLPE) {
        advise (NULLCP, "Ack-PDU: %s", PEPY_ERR_NOMEM);
        return NOTOK;
    }

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.Ack-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_Hello__PDU (pe, explicit, len, buffer, parm)
PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_Hello__PDU * parm;
{
    if (((*pe) = pe_alloc (PE_CLASS_CONT, PE_FORM_PRIM, 1)) == NULLPE) {
        advise (NULLCP, "Hello-PDU: %s", PEPY_ERR_NOMEM);
        return NOTOK;
    }

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.Hello-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_Welcome__PDU (pe, explicit, len, buffer, parm)
PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_Welcome__PDU * parm;
{
    if (((*pe) = pe_alloc (PE_CLASS_CONT, PE_FORM_PRIM, 2)) == NULLPE) {
        advise (NULLCP, "Welcome-PDU: %s", PEPY_ERR_NOMEM);
        return NOTOK;
    }

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.Welcome-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_Goodbye__PDU (pe, explicit, len, buffer, parm)
PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_Goodbye__PDU * parm;
{
    if (((*pe) = pe_alloc (PE_CLASS_CONT, PE_FORM_PRIM, 3)) == NULLPE) {
        advise (NULLCP, "Goodbye-PDU: %s", PEPY_ERR_NOMEM);
        return NOTOK;
    }

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.Goodbye-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_Redirect__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_Redirect__PDU * parm;
{
    if (encode_HNMP_IpAddress (pe, 0, len, buffer, parm ) == NOTOK)
        return NOTOK;
    (*pe) -> pe_class = PE_CLASS_CONT;
    (*pe) -> pe_id = 4;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.Redirect-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_GetKey__PDU (pe, explicit, len, buffer, parm)
PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_GetKey__PDU * parm;
{
    if (((*pe) = pe_alloc (PE_CLASS_CONT, PE_FORM_PRIM, 5)) == NULLPE) {
        advise (NULLCP, "GetKey-PDU: %s", PEPY_ERR_NOMEM);
        return NOTOK;
    }

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.GetKey-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_SendKey__PDU (pe, explicit, len, buffer, parm)
PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_SendKey__PDU * parm;
{
    if (((*pe) = pe_alloc (PE_CLASS_CONT, PE_FORM_PRIM, 6)) == NULLPE) {
        advise (NULLCP, "SendKey-PDU: %s", PEPY_ERR_NOMEM);
        return NOTOK;
    }

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.SendKey-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_Announce__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_Announce__PDU * parm;
{
    if (encode_HNMP_ObjectBlock (pe, 0, len, buffer, parm ) == NOTOK)
        return NOTOK;
    (*pe) -> pe_class = PE_CLASS_CONT;
    (*pe) -> pe_id = 7;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.Announce-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_Delete__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_Delete__PDU * parm;
{
    if (encode_HNMP_ObjectId (pe, 0, len, buffer, parm ) == NOTOK)
        return NOTOK;
    (*pe) -> pe_class = PE_CLASS_CONT;
    (*pe) -> pe_id = 8;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.Delete-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_Activate__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_Activate__PDU * parm;
{
    if (encode_HNMP_ObjectId (pe, 0, len, buffer, parm ) == NOTOK)
        return NOTOK;
    (*pe) -> pe_class = PE_CLASS_CONT;
    (*pe) -> pe_id = 9;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.Activate-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_Deactivate__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_Deactivate__PDU * parm;
{
    if (encode_HNMP_ObjectId (pe, 0, len, buffer, parm ) == NOTOK)
        return NOTOK;
    (*pe) -> pe_class = PE_CLASS_CONT;
    (*pe) -> pe_id = 10;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.Deactivate-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_SubRelations__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_SubRelations__PDU * parm;
{
    if (encode_HNMP_ObjectBlock (pe, 0, len, buffer, parm ) == NOTOK)
        return NOTOK;
    (*pe) -> pe_class = PE_CLASS_CONT;
    (*pe) -> pe_id = 11;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.SubRelations-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_UnsubRelations__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_UnsubRelations__PDU * parm;
{
    if (encode_HNMP_ObjectId (pe, 0, len, buffer, parm ) == NOTOK)
        return NOTOK;
    (*pe) -> pe_class = PE_CLASS_CONT;
    (*pe) -> pe_id = 12;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.UnsubRelations-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_SendRelations__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_SendRelations__PDU * parm;
{
    if (encode_HNMP_ObjectBlock (pe, 0, len, buffer, parm ) == NOTOK)
        return NOTOK;
    (*pe) -> pe_class = PE_CLASS_CONT;
    (*pe) -> pe_id = 13;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.SendRelations-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_SubData__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_SubData__PDU * parm;
{
    if (encode_HNMP_ObjectBlock (pe, 0, len, buffer, parm ) == NOTOK)
        return NOTOK;
    (*pe) -> pe_class = PE_CLASS_CONT;
    (*pe) -> pe_id = 14;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.SubData-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_UnsubData__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_UnsubData__PDU * parm;
{
    if (encode_HNMP_ObjectId (pe, 0, len, buffer, parm ) == NOTOK)
        return NOTOK;
    (*pe) -> pe_class = PE_CLASS_CONT;
    (*pe) -> pe_id = 15;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.UnsubData-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_SendData__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_SendData__PDU * parm;
{
    if (encode_HNMP_ObjectBlock (pe, 0, len, buffer, parm ) == NOTOK)
        return NOTOK;
    (*pe) -> pe_class = PE_CLASS_CONT;
    (*pe) -> pe_id = 16;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.SendData-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_SetData__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_SetData__PDU * parm;
{
    if (encode_HNMP_ObjectBlock (pe, 0, len, buffer, parm ) == NOTOK)
        return NOTOK;
    (*pe) -> pe_class = PE_CLASS_CONT;
    (*pe) -> pe_id = 17;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.SetData-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_GetData__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_GetData__PDU * parm;
{
    if (encode_HNMP_ObjectBlock (pe, 0, len, buffer, parm ) == NOTOK)
        return NOTOK;
    (*pe) -> pe_class = PE_CLASS_CONT;
    (*pe) -> pe_id = 18;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.GetData-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_GetNextData__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_GetNextData__PDU * parm;
{
    if (encode_HNMP_ObjectBlock (pe, 0, len, buffer, parm ) == NOTOK)
        return NOTOK;
    (*pe) -> pe_class = PE_CLASS_CONT;
    (*pe) -> pe_id = 19;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.GetNextData-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_GetWalkData__PDU (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_GetWalkData__PDU * parm;
{
    if (encode_HNMP_ObjectBlock (pe, 0, len, buffer, parm ) == NOTOK)
        return NOTOK;
    (*pe) -> pe_class = PE_CLASS_CONT;
    (*pe) -> pe_id = 20;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.GetWalkData-PDU");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_ObjectId (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_ObjectId * parm;
{
    register integer p9 = parm -> parm ;

    if (((*pe) = num2prim (p9, PE_CLASS_UNIV, PE_PRIM_INT)) == NULLPE) {
        advise (NULLCP, "ObjectId: %s", PEPY_ERR_NOMEM);
        return NOTOK;
    }

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.ObjectId");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_ObjectBlock (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_ObjectBlock * parm;
{
    PE	p10_z = NULLPE;
    register PE *p10 = &p10_z;

    if (((*pe) = pe_alloc (PE_CLASS_UNIV, PE_FORM_CONS, PE_CONS_SEQ)) == NULLPE) {
        advise (NULLCP, "ObjectBlock: %s", PEPY_ERR_NOMEM);
        return NOTOK;
    }
    {
# line 252 "gen/HNMP-types.py"

            
    }
    (*p10) = NULLPE;

    {	/* object-id */
        register integer p11 = parm -> object__id ;

        if (((*p10) = num2prim (p11, PE_CLASS_UNIV, PE_PRIM_INT)) == NULLPE) {
            advise (NULLCP, "object-id: %s", PEPY_ERR_NOMEM);
            return NOTOK;
        }

#ifdef DEBUG
        (void) testdebug ((*p10), "object-id");
#endif

    }

    if ((*p10) != NULLPE)
        if (seq_add ((*pe), (*p10), -1) == NOTOK) {
            advise (NULLCP, "ObjectBlock %s%s", PEPY_ERR_BAD_SEQ,
                    pe_error ((*pe) -> pe_errno));
            return NOTOK;
        }
    (*p10) = NULLPE;

    {	/* variables */
        if (encode_HNMP_VarBindList (p10, 0, NULL, NULLCP, parm -> variables ) == NOTOK)
            return NOTOK;

#ifdef DEBUG
        (void) testdebug ((*p10), "variables");
#endif

    }

    if ((*p10) != NULLPE)
        if (seq_add ((*pe), (*p10), -1) == NOTOK) {
            advise (NULLCP, "ObjectBlock %s%s", PEPY_ERR_BAD_SEQ,
                    pe_error ((*pe) -> pe_errno));
            return NOTOK;
        }

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.ObjectBlock");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_VarBindList (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_VarBindList * parm;
{
    PE	p12 = NULLPE;
    PE	p13_z = NULLPE;
    register PE *p13 = &p13_z;

    if (((*pe) = pe_alloc (PE_CLASS_UNIV, PE_FORM_CONS, PE_CONS_SEQ)) == NULLPE) {
        advise (NULLCP, "VarBindList: %s", PEPY_ERR_NOMEM);
        return NOTOK;
    }
    for (; parm; parm = parm -> next) {
        if (encode_HNMP_VarBind (p13, 0, NULL, NULLCP, parm -> VarBind ) == NOTOK)
            return NOTOK;

#ifdef DEBUG
        (void) testdebug ((*p13), "element");
#endif

        seq_addon ((*pe), p12, (*p13));
        p12 = (*p13);
    }

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.VarBindList");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_VarBind (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_VarBind * parm;
{
    PE	p14_z = NULLPE;
    register PE *p14 = &p14_z;

    if (((*pe) = pe_alloc (PE_CLASS_UNIV, PE_FORM_CONS, PE_CONS_SEQ)) == NULLPE) {
        advise (NULLCP, "VarBind: %s", PEPY_ERR_NOMEM);
        return NOTOK;
    }
    {
# line 272 "gen/HNMP-types.py"

            
    }
    (*p14) = NULLPE;

    {	/* name */
        if (encode_HNMP_ObjectName (p14, 0, NULL, NULLCP, parm -> name ) == NOTOK)
            return NOTOK;

#ifdef DEBUG
        (void) testdebug ((*p14), "name");
#endif

    }

    if ((*p14) != NULLPE)
        if (seq_add ((*pe), (*p14), -1) == NOTOK) {
            advise (NULLCP, "VarBind %s%s", PEPY_ERR_BAD_SEQ,
                    pe_error ((*pe) -> pe_errno));
            return NOTOK;
        }
    (*p14) = NULLPE;

    {	/* value */
        if (encode_HNMP_ObjectSyntax (p14, 0, NULL, NULLCP, parm -> value ) == NOTOK)
            return NOTOK;

#ifdef DEBUG
        (void) testdebug ((*p14), "value");
#endif

    }

    if ((*p14) != NULLPE)
        if (seq_add ((*pe), (*p14), -1) == NOTOK) {
            advise (NULLCP, "VarBind %s%s", PEPY_ERR_BAD_SEQ,
                    pe_error ((*pe) -> pe_errno));
            return NOTOK;
        }
    (*p14) = NULLPE;

    {	/* interval */
        register integer p15 = parm -> interval ;

        if (((*p14) = num2prim (p15, PE_CLASS_UNIV, PE_PRIM_INT)) == NULLPE) {
            advise (NULLCP, "interval: %s", PEPY_ERR_NOMEM);
            return NOTOK;
        }

#ifdef DEBUG
        (void) testdebug ((*p14), "interval");
#endif

    }

    if ((*p14) != NULLPE)
        if (seq_add ((*pe), (*p14), -1) == NOTOK) {
            advise (NULLCP, "VarBind %s%s", PEPY_ERR_BAD_SEQ,
                    pe_error ((*pe) -> pe_errno));
            return NOTOK;
        }
    (*p14) = NULLPE;

    {	/* timestamp */
        if (encode_HNMP_TimeTicks (p14, 0, NULL, NULLCP, parm -> timestamp ) == NOTOK)
            return NOTOK;

#ifdef DEBUG
        (void) testdebug ((*p14), "timestamp");
#endif

    }

    if ((*p14) != NULLPE)
        if (seq_add ((*pe), (*p14), -1) == NOTOK) {
            advise (NULLCP, "VarBind %s%s", PEPY_ERR_BAD_SEQ,
                    pe_error ((*pe) -> pe_errno));
            return NOTOK;
        }

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.VarBind");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_ObjectName (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_ObjectName * parm;
{
    register OID p16;

    p16 = parm ;
    if (p16 == NULLOID) {
        advise (NULLCP, "ObjectName %s", PEPY_ERR_INIT_FAILED);
        return NOTOK;
    }
    if (((*pe) = obj2prim (p16, PE_CLASS_UNIV, PE_PRIM_OID)) == NULLPE) {
        advise (NULLCP, "ObjectName: %s", PEPY_ERR_NOMEM);
        return NOTOK;
    }

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.ObjectName");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_ObjectSyntax (pe, explicit, len, buffer, parm)
PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_ObjectSyntax * parm;
{
    PE	p17 = parm ;

    if (p17 == NULLPE) {
        advise (NULLCP, "ObjectSyntax %s", PEPY_ERR_INIT_FAILED);
        return NOTOK;
    }
    ((*pe) = p17) -> pe_refcnt++;

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.ObjectSyntax");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_IpAddress (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_IpAddress * parm;
{
    register struct qbuf *p18;

    p18 = parm ;
    if (p18 == ((struct qbuf *) 0)) {
        advise (NULLCP, "IpAddress %s", PEPY_ERR_INIT_FAILED);
        return NOTOK;
    }
    if (((*pe) = qb2prim (p18, PE_CLASS_APPL, 0)) == NULLPE) {
        advise (NULLCP, "IpAddress: %s", PEPY_ERR_NOMEM);
        return NOTOK;
    }

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.IpAddress");
#endif


    return OK;
}

/* ARGSUSED */

int	encode_HNMP_TimeTicks (pe, explicit, len, buffer, parm)
register PE     *pe;
int	explicit;
int	len;
char   *buffer;
struct type_HNMP_TimeTicks * parm;
{
    register integer p19 = parm -> parm ;

    if (((*pe) = num2prim (p19, PE_CLASS_APPL, 3)) == NULLPE) {
        advise (NULLCP, "TimeTicks: %s", PEPY_ERR_NOMEM);
        return NOTOK;
    }

#ifdef DEBUG
    (void) testdebug ((*pe), "HNMP.TimeTicks");
#endif


    return OK;
}

/* ARGSUSED */

int	decode_HNMP_Message (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_Message ** parm;
{
    register PE p20;

#ifdef DEBUG
    (void) testdebug (pe, "HNMP.Message");
#endif

    if (explicit) {
        if (pe -> pe_class != PE_CLASS_UNIV
                || pe -> pe_form != PE_FORM_CONS
                || pe -> pe_id != PE_CONS_SEQ) {
            advise (NULLCP, "Message bad class/form/id: %s/%d/0x%x",
                    pe_classlist[pe -> pe_class], pe -> pe_form, pe -> pe_id);
            return NOTOK;
        }
    }
    else
        if (pe -> pe_form != PE_FORM_CONS) {
            advise (NULLCP, "Message bad form: %d", pe -> pe_form);
            return NOTOK;
        }

    {
# line 313 "gen/HNMP-types.py"

        if ((*(parm) = (struct type_HNMP_Message *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_Message *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    
    }
    {
# line 321 "gen/HNMP-types.py"

            
    }
    if ((p20 = prim2seq (pe)) == NULLPE) {
        advise (NULLCP, "Message %s%s", PEPY_ERR_BAD_SEQ,
                pe_error (pe -> pe_errno));
        return NOTOK;
    }
    pe = p20;

    {
        register PE p21;

        if ((p21 = first_member (pe)) != NULLPE) {
            p20 = p21;

            {	/* version */
                register integer p22;

#ifdef DEBUG
                (void) testdebug (p21, "version");
#endif

                if (p21 -> pe_class != PE_CLASS_UNIV
                        || p21 -> pe_form != PE_FORM_PRIM
                        || p21 -> pe_id != PE_PRIM_INT) {
                    advise (NULLCP, "version bad class/form/id: %s/%d/0x%x",
                            pe_classlist[p21 -> pe_class], p21 -> pe_form, p21 -> pe_id);
                    return NOTOK;
                }

                if ((p22 = prim2num (p21)) == NOTOK
                        && p21 -> pe_errno != PE_ERR_NONE) {
                    advise (NULLCP, "version %s%s", PEPY_ERR_BAD_INTEGER,
                            pe_error (p21 -> pe_errno));
                    return NOTOK;
                }
                (*parm) -> version  = p22;
                switch (p22) {
                    case 1:	/* version-1 */
                        break;
                    case 2:	/* version-2 */
                        break;
                }
            }
        }
        else {
            advise (NULLCP, "Message %sversion element", PEPY_ERR_MISSING);
            return NOTOK;
        }

    }

    {
        register PE p23;

        if ((p23 = (pe != p20 ? next_member (pe, p20) : first_member (pe))) != NULLPE) {
            p20 = p23;

            {	/* community */
                register struct qbuf *p24;

#ifdef DEBUG
                (void) testdebug (p23, "community");
#endif

                if (p23 -> pe_class != PE_CLASS_UNIV || p23 -> pe_id != PE_PRIM_OCTS) {
                    advise (NULLCP, "community bad class/form/id: %s/%d/0x%x",
                            pe_classlist[p23 -> pe_class], p23 -> pe_form, p23 -> pe_id);
                    return NOTOK;
                }

                if ((p24 = prim2qb (p23)) == (struct qbuf *)0) {
                    advise (NULLCP, "community %s%s", PEPY_ERR_BAD_OCTET,
                            pe_error (p23 -> pe_errno));
                    return NOTOK;
                }
                (*parm) -> community  = p24;
            }
        }
        else {
            advise (NULLCP, "Message %scommunity element", PEPY_ERR_MISSING);
            return NOTOK;
        }

    }

    {
        register PE p25;

        if ((p25 = (pe != p20 ? next_member (pe, p20) : first_member (pe))) != NULLPE) {
            p20 = p25;

            {	/* from-module-type */
                register integer p26;

#ifdef DEBUG
                (void) testdebug (p25, "from-module-type");
#endif

                if (p25 -> pe_class != PE_CLASS_UNIV
                        || p25 -> pe_form != PE_FORM_PRIM
                        || p25 -> pe_id != PE_PRIM_INT) {
                    advise (NULLCP, "from-module-type bad class/form/id: %s/%d/0x%x",
                            pe_classlist[p25 -> pe_class], p25 -> pe_form, p25 -> pe_id);
                    return NOTOK;
                }

                if ((p26 = prim2num (p25)) == NOTOK
                        && p25 -> pe_errno != PE_ERR_NONE) {
                    advise (NULLCP, "from-module-type %s%s", PEPY_ERR_BAD_INTEGER,
                            pe_error (p25 -> pe_errno));
                    return NOTOK;
                }
                (*parm) -> from__module__type  = p26;
            }
        }
        else {
            advise (NULLCP, "Message %sfrom-module-type element", PEPY_ERR_MISSING);
            return NOTOK;
        }

    }

    {
        register PE p27;

        if ((p27 = (pe != p20 ? next_member (pe, p20) : first_member (pe))) != NULLPE) {
            p20 = p27;

            {	/* from-module-id */
                register integer p28;

#ifdef DEBUG
                (void) testdebug (p27, "from-module-id");
#endif

                if (p27 -> pe_class != PE_CLASS_UNIV
                        || p27 -> pe_form != PE_FORM_PRIM
                        || p27 -> pe_id != PE_PRIM_INT) {
                    advise (NULLCP, "from-module-id bad class/form/id: %s/%d/0x%x",
                            pe_classlist[p27 -> pe_class], p27 -> pe_form, p27 -> pe_id);
                    return NOTOK;
                }

                if ((p28 = prim2num (p27)) == NOTOK
                        && p27 -> pe_errno != PE_ERR_NONE) {
                    advise (NULLCP, "from-module-id %s%s", PEPY_ERR_BAD_INTEGER,
                            pe_error (p27 -> pe_errno));
                    return NOTOK;
                }
                (*parm) -> from__module__id  = p28;
            }
        }
        else {
            advise (NULLCP, "Message %sfrom-module-id element", PEPY_ERR_MISSING);
            return NOTOK;
        }

    }

    {
        register PE p29;

        if ((p29 = (pe != p20 ? next_member (pe, p20) : first_member (pe))) != NULLPE) {
            p20 = p29;

            {	/* to-module-id */
                register integer p30;

#ifdef DEBUG
                (void) testdebug (p29, "to-module-id");
#endif

                if (p29 -> pe_class != PE_CLASS_UNIV
                        || p29 -> pe_form != PE_FORM_PRIM
                        || p29 -> pe_id != PE_PRIM_INT) {
                    advise (NULLCP, "to-module-id bad class/form/id: %s/%d/0x%x",
                            pe_classlist[p29 -> pe_class], p29 -> pe_form, p29 -> pe_id);
                    return NOTOK;
                }

                if ((p30 = prim2num (p29)) == NOTOK
                        && p29 -> pe_errno != PE_ERR_NONE) {
                    advise (NULLCP, "to-module-id %s%s", PEPY_ERR_BAD_INTEGER,
                            pe_error (p29 -> pe_errno));
                    return NOTOK;
                }
                (*parm) -> to__module__id  = p30;
            }
        }
        else {
            advise (NULLCP, "Message %sto-module-id element", PEPY_ERR_MISSING);
            return NOTOK;
        }

    }

    {
        register PE p31;

        if ((p31 = (pe != p20 ? next_member (pe, p20) : first_member (pe))) != NULLPE) {
            p20 = p31;

            {	/* msg-id */
                register integer p32;

#ifdef DEBUG
                (void) testdebug (p31, "msg-id");
#endif

                if (p31 -> pe_class != PE_CLASS_UNIV
                        || p31 -> pe_form != PE_FORM_PRIM
                        || p31 -> pe_id != PE_PRIM_INT) {
                    advise (NULLCP, "msg-id bad class/form/id: %s/%d/0x%x",
                            pe_classlist[p31 -> pe_class], p31 -> pe_form, p31 -> pe_id);
                    return NOTOK;
                }

                if ((p32 = prim2num (p31)) == NOTOK
                        && p31 -> pe_errno != PE_ERR_NONE) {
                    advise (NULLCP, "msg-id %s%s", PEPY_ERR_BAD_INTEGER,
                            pe_error (p31 -> pe_errno));
                    return NOTOK;
                }
                (*parm) -> msg__id  = p32;
            }
        }
        else {
            advise (NULLCP, "Message %smsg-id element", PEPY_ERR_MISSING);
            return NOTOK;
        }

    }

    {
        register PE p33;

        if ((p33 = (pe != p20 ? next_member (pe, p20) : first_member (pe))) != NULLPE) {
            p20 = p33;

            {	/* msg-timestamp */
#ifdef DEBUG
                (void) testdebug (p33, "msg-timestamp");
#endif

                if (decode_HNMP_TimeTicks (p33, 1, NULLIP, NULLVP, &((*parm) -> msg__timestamp)) == NOTOK)
                    return NOTOK;
            }
        }
        else {
            advise (NULLCP, "Message %smsg-timestamp element", PEPY_ERR_MISSING);
            return NOTOK;
        }

    }

    {
        register PE p34;

        if ((p34 = (pe != p20 ? next_member (pe, p20) : first_member (pe))) != NULLPE) {
            p20 = p34;

            {	/* data */
#ifdef DEBUG
                (void) testdebug (p34, "data");
#endif

                if (decode_HNMP_PDU (p34, 1, NULLIP, NULLVP, &((*parm) -> data)) == NOTOK)
                    return NOTOK;
            }
        }
        else {
            advise (NULLCP, "Message %sdata element", PEPY_ERR_MISSING);
            return NOTOK;
        }

    }


    if (pe -> pe_cardinal > 8) {
        advise (NULLCP, "Message %s(8): %d", PEPY_ERR_TOO_MANY_ELEMENTS,
                pe -> pe_cardinal);
        return NOTOK;
    }

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_PDU (pe, explicit, len, buffer, parm)
PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.PDU");
#endif

    {
# line 362 "gen/HNMP-types.py"

        if ((*(parm) = (struct type_HNMP_PDU *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_PDU *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    
    }
    switch (PE_ID (pe -> pe_class, pe -> pe_id)) {
        case PE_ID (PE_CLASS_CONT, 0):	/* ack */
            {
#ifdef DEBUG
                (void) testdebug (pe, "ack");
#endif

                if (decode_HNMP_Ack__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.ack)) == NOTOK)
                    return NOTOK;
                {
# line 374 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_ack; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 1):	/* hello */
            {
#ifdef DEBUG
                (void) testdebug (pe, "hello");
#endif

                if (decode_HNMP_Hello__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.hello)) == NOTOK)
                    return NOTOK;
                {
# line 379 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_hello; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 2):	/* welcome */
            {
#ifdef DEBUG
                (void) testdebug (pe, "welcome");
#endif

                if (decode_HNMP_Welcome__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.welcome)) == NOTOK)
                    return NOTOK;
                {
# line 384 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_welcome; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 3):	/* goodbye */
            {
#ifdef DEBUG
                (void) testdebug (pe, "goodbye");
#endif

                if (decode_HNMP_Goodbye__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.goodbye)) == NOTOK)
                    return NOTOK;
                {
# line 389 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_goodbye; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 4):	/* redirect */
            {
#ifdef DEBUG
                (void) testdebug (pe, "redirect");
#endif

                if (decode_HNMP_Redirect__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.redirect)) == NOTOK)
                    return NOTOK;
                {
# line 394 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_redirect; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 5):	/* get-key */
            {
#ifdef DEBUG
                (void) testdebug (pe, "get-key");
#endif

                if (decode_HNMP_GetKey__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.get__key)) == NOTOK)
                    return NOTOK;
                {
# line 399 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_get__key; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 6):	/* send-key */
            {
#ifdef DEBUG
                (void) testdebug (pe, "send-key");
#endif

                if (decode_HNMP_SendKey__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.send__key)) == NOTOK)
                    return NOTOK;
                {
# line 404 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_send__key; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 7):	/* announce-object */
            {
#ifdef DEBUG
                (void) testdebug (pe, "announce-object");
#endif

                if (decode_HNMP_Announce__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.announce__object)) == NOTOK)
                    return NOTOK;
                {
# line 409 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_announce__object; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 8):	/* delete-object */
            {
#ifdef DEBUG
                (void) testdebug (pe, "delete-object");
#endif

                if (decode_HNMP_Delete__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.delete__object)) == NOTOK)
                    return NOTOK;
                {
# line 414 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_delete__object; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 9):	/* activate-object */
            {
#ifdef DEBUG
                (void) testdebug (pe, "activate-object");
#endif

                if (decode_HNMP_Activate__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.activate__object)) == NOTOK)
                    return NOTOK;
                {
# line 419 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_activate__object; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 10):	/* deactivate-object */
            {
#ifdef DEBUG
                (void) testdebug (pe, "deactivate-object");
#endif

                if (decode_HNMP_Deactivate__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.deactivate__object)) == NOTOK)
                    return NOTOK;
                {
# line 424 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_deactivate__object; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 11):	/* subscribe-relations */
            {
#ifdef DEBUG
                (void) testdebug (pe, "subscribe-relations");
#endif

                if (decode_HNMP_SubRelations__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.subscribe__relations)) == NOTOK)
                    return NOTOK;
                {
# line 429 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_subscribe__relations; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 12):	/* unsubscribe-relations */
            {
#ifdef DEBUG
                (void) testdebug (pe, "unsubscribe-relations");
#endif

                if (decode_HNMP_UnsubRelations__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.unsubscribe__relations)) == NOTOK)
                    return NOTOK;
                {
# line 434 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_unsubscribe__relations; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 13):	/* send-relations */
            {
#ifdef DEBUG
                (void) testdebug (pe, "send-relations");
#endif

                if (decode_HNMP_SendRelations__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.send__relations)) == NOTOK)
                    return NOTOK;
                {
# line 439 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_send__relations; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 14):	/* subscribe-data */
            {
#ifdef DEBUG
                (void) testdebug (pe, "subscribe-data");
#endif

                if (decode_HNMP_SubData__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.subscribe__data)) == NOTOK)
                    return NOTOK;
                {
# line 444 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_subscribe__data; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 15):	/* unsubscribe-data */
            {
#ifdef DEBUG
                (void) testdebug (pe, "unsubscribe-data");
#endif

                if (decode_HNMP_UnsubData__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.unsubscribe__data)) == NOTOK)
                    return NOTOK;
                {
# line 449 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_unsubscribe__data; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 16):	/* send-data */
            {
#ifdef DEBUG
                (void) testdebug (pe, "send-data");
#endif

                if (decode_HNMP_SendData__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.send__data)) == NOTOK)
                    return NOTOK;
                {
# line 454 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_send__data; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 17):	/* set-data */
            {
#ifdef DEBUG
                (void) testdebug (pe, "set-data");
#endif

                if (decode_HNMP_SetData__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.set__data)) == NOTOK)
                    return NOTOK;
                {
# line 459 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_set__data; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 18):	/* get-data */
            {
#ifdef DEBUG
                (void) testdebug (pe, "get-data");
#endif

                if (decode_HNMP_GetData__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.get__data)) == NOTOK)
                    return NOTOK;
                {
# line 464 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_get__data; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 19):	/* get-next-data */
            {
#ifdef DEBUG
                (void) testdebug (pe, "get-next-data");
#endif

                if (decode_HNMP_GetNextData__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.get__next__data)) == NOTOK)
                    return NOTOK;
                {
# line 469 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_get__next__data; 
                }
            }
            break;
        case PE_ID (PE_CLASS_CONT, 20):	/* get-walk-data */
            {
#ifdef DEBUG
                (void) testdebug (pe, "get-walk-data");
#endif

                if (decode_HNMP_GetWalkData__PDU (pe, 1, NULLIP, NULLVP, &((*parm) -> un.get__walk__data)) == NOTOK)
                    return NOTOK;
                {
# line 474 "gen/HNMP-types.py"
 (*(parm)) -> offset = type_HNMP_PDU_get__walk__data; 
                }
            }
            break;

        default:
            advise (NULLCP, "PDU %s%s/%d/0x%x", PEPY_ERR_UNKNOWN_CHOICE,
                    pe_classlist[pe -> pe_class], pe -> pe_form, pe -> pe_id);
            return NOTOK;
    }

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_Ack__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_Ack__PDU ** parm;
{
    register integer p35;

#ifdef DEBUG
    (void) testdebug (pe, "HNMP.Ack-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 0)) {
        advise (NULLCP, "Ack-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    {
# line 478 "gen/HNMP-types.py"

        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;
        }
    
    }
    if ((p35 = prim2num (pe)) == NOTOK
            && pe -> pe_errno != PE_ERR_NONE) {
        advise (NULLCP, "Ack-PDU %s%s", PEPY_ERR_BAD_INTEGER,
                pe_error (pe -> pe_errno));
        return NOTOK;
    }
    (*parm) -> parm  = p35;
    if (len)
        *len = p35;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_Hello__PDU (pe, explicit, len, buffer, parm)
PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_Hello__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.Hello-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 1)) {
        advise (NULLCP, "Hello-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    {
# line 490 "gen/HNMP-types.py"

        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;
        }
    
    }

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_Welcome__PDU (pe, explicit, len, buffer, parm)
PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_Welcome__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.Welcome-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 2)) {
        advise (NULLCP, "Welcome-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    {
# line 501 "gen/HNMP-types.py"

        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;
        }
    
    }

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_Goodbye__PDU (pe, explicit, len, buffer, parm)
PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_Goodbye__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.Goodbye-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 3)) {
        advise (NULLCP, "Goodbye-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    {
# line 512 "gen/HNMP-types.py"

        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;
        }
    
    }

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_Redirect__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_Redirect__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.Redirect-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 4)) {
        advise (NULLCP, "Redirect-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if (decode_HNMP_IpAddress (pe, 0, len, buffer, &((*parm))) == NOTOK)
        return NOTOK;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_GetKey__PDU (pe, explicit, len, buffer, parm)
PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_GetKey__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.GetKey-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 5)) {
        advise (NULLCP, "GetKey-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    {
# line 528 "gen/HNMP-types.py"

        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;
        }
    
    }

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_SendKey__PDU (pe, explicit, len, buffer, parm)
PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_SendKey__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.SendKey-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 6)) {
        advise (NULLCP, "SendKey-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    {
# line 539 "gen/HNMP-types.py"

        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;
        }
    
    }

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_Announce__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_Announce__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.Announce-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 7)) {
        advise (NULLCP, "Announce-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if (decode_HNMP_ObjectBlock (pe, 0, len, buffer, &((*parm))) == NOTOK)
        return NOTOK;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_Delete__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_Delete__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.Delete-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 8)) {
        advise (NULLCP, "Delete-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if (decode_HNMP_ObjectId (pe, 0, len, buffer, &((*parm))) == NOTOK)
        return NOTOK;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_Activate__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_Activate__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.Activate-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 9)) {
        advise (NULLCP, "Activate-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if (decode_HNMP_ObjectId (pe, 0, len, buffer, &((*parm))) == NOTOK)
        return NOTOK;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_Deactivate__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_Deactivate__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.Deactivate-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 10)) {
        advise (NULLCP, "Deactivate-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if (decode_HNMP_ObjectId (pe, 0, len, buffer, &((*parm))) == NOTOK)
        return NOTOK;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_SubRelations__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_SubRelations__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.SubRelations-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 11)) {
        advise (NULLCP, "SubRelations-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if (decode_HNMP_ObjectBlock (pe, 0, len, buffer, &((*parm))) == NOTOK)
        return NOTOK;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_UnsubRelations__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_UnsubRelations__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.UnsubRelations-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 12)) {
        advise (NULLCP, "UnsubRelations-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if (decode_HNMP_ObjectId (pe, 0, len, buffer, &((*parm))) == NOTOK)
        return NOTOK;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_SendRelations__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_SendRelations__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.SendRelations-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 13)) {
        advise (NULLCP, "SendRelations-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if (decode_HNMP_ObjectBlock (pe, 0, len, buffer, &((*parm))) == NOTOK)
        return NOTOK;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_SubData__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_SubData__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.SubData-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 14)) {
        advise (NULLCP, "SubData-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if (decode_HNMP_ObjectBlock (pe, 0, len, buffer, &((*parm))) == NOTOK)
        return NOTOK;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_UnsubData__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_UnsubData__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.UnsubData-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 15)) {
        advise (NULLCP, "UnsubData-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if (decode_HNMP_ObjectId (pe, 0, len, buffer, &((*parm))) == NOTOK)
        return NOTOK;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_SendData__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_SendData__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.SendData-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 16)) {
        advise (NULLCP, "SendData-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if (decode_HNMP_ObjectBlock (pe, 0, len, buffer, &((*parm))) == NOTOK)
        return NOTOK;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_SetData__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_SetData__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.SetData-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 17)) {
        advise (NULLCP, "SetData-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if (decode_HNMP_ObjectBlock (pe, 0, len, buffer, &((*parm))) == NOTOK)
        return NOTOK;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_GetData__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_GetData__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.GetData-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 18)) {
        advise (NULLCP, "GetData-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if (decode_HNMP_ObjectBlock (pe, 0, len, buffer, &((*parm))) == NOTOK)
        return NOTOK;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_GetNextData__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_GetNextData__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.GetNextData-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 19)) {
        advise (NULLCP, "GetNextData-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if (decode_HNMP_ObjectBlock (pe, 0, len, buffer, &((*parm))) == NOTOK)
        return NOTOK;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_GetWalkData__PDU (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_GetWalkData__PDU ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.GetWalkData-PDU");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_CONT, 20)) {
        advise (NULLCP, "GetWalkData-PDU %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if (decode_HNMP_ObjectBlock (pe, 0, len, buffer, &((*parm))) == NOTOK)
        return NOTOK;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_ObjectId (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_ObjectId ** parm;
{
    register integer p36;

#ifdef DEBUG
    (void) testdebug (pe, "HNMP.ObjectId");
#endif

    if (explicit) {
        if (pe -> pe_class != PE_CLASS_UNIV
                || pe -> pe_form != PE_FORM_PRIM
                || pe -> pe_id != PE_PRIM_INT) {
            advise (NULLCP, "ObjectId bad class/form/id: %s/%d/0x%x",
                    pe_classlist[pe -> pe_class], pe -> pe_form, pe -> pe_id);
            return NOTOK;
        }
    }
    else
        if (pe -> pe_form != PE_FORM_PRIM) {
            advise (NULLCP, "ObjectId bad form: %d", pe -> pe_form);
            return NOTOK;
        }

    {
# line 620 "gen/HNMP-types.py"

        if ((*(parm) = (struct type_HNMP_ObjectId *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_ObjectId *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    
    }
    if ((p36 = prim2num (pe)) == NOTOK
            && pe -> pe_errno != PE_ERR_NONE) {
        advise (NULLCP, "ObjectId %s%s", PEPY_ERR_BAD_INTEGER,
                pe_error (pe -> pe_errno));
        return NOTOK;
    }
    (*parm) -> parm  = p36;
    if (len)
        *len = p36;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_ObjectBlock (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_ObjectBlock ** parm;
{
    register PE p37;

#ifdef DEBUG
    (void) testdebug (pe, "HNMP.ObjectBlock");
#endif

    if (explicit) {
        if (pe -> pe_class != PE_CLASS_UNIV
                || pe -> pe_form != PE_FORM_CONS
                || pe -> pe_id != PE_CONS_SEQ) {
            advise (NULLCP, "ObjectBlock bad class/form/id: %s/%d/0x%x",
                    pe_classlist[pe -> pe_class], pe -> pe_form, pe -> pe_id);
            return NOTOK;
        }
    }
    else
        if (pe -> pe_form != PE_FORM_CONS) {
            advise (NULLCP, "ObjectBlock bad form: %d", pe -> pe_form);
            return NOTOK;
        }

    {
# line 631 "gen/HNMP-types.py"

        if ((*(parm) = (struct type_HNMP_ObjectBlock *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_ObjectBlock *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    
    }
    {
# line 639 "gen/HNMP-types.py"

            
    }
    if ((p37 = prim2seq (pe)) == NULLPE) {
        advise (NULLCP, "ObjectBlock %s%s", PEPY_ERR_BAD_SEQ,
                pe_error (pe -> pe_errno));
        return NOTOK;
    }
    pe = p37;

    {
        register PE p38;

        if ((p38 = first_member (pe)) != NULLPE) {
            p37 = p38;

            {	/* object-id */
                register integer p39;

#ifdef DEBUG
                (void) testdebug (p38, "object-id");
#endif

                if (p38 -> pe_class != PE_CLASS_UNIV
                        || p38 -> pe_form != PE_FORM_PRIM
                        || p38 -> pe_id != PE_PRIM_INT) {
                    advise (NULLCP, "object-id bad class/form/id: %s/%d/0x%x",
                            pe_classlist[p38 -> pe_class], p38 -> pe_form, p38 -> pe_id);
                    return NOTOK;
                }

                if ((p39 = prim2num (p38)) == NOTOK
                        && p38 -> pe_errno != PE_ERR_NONE) {
                    advise (NULLCP, "object-id %s%s", PEPY_ERR_BAD_INTEGER,
                            pe_error (p38 -> pe_errno));
                    return NOTOK;
                }
                (*parm) -> object__id  = p39;
            }
        }
        else {
            advise (NULLCP, "ObjectBlock %sobject-id element", PEPY_ERR_MISSING);
            return NOTOK;
        }

    }

    {
        register PE p40;

        if ((p40 = (pe != p37 ? next_member (pe, p37) : first_member (pe))) != NULLPE) {
            p37 = p40;

            {	/* variables */
#ifdef DEBUG
                (void) testdebug (p40, "variables");
#endif

                if (decode_HNMP_VarBindList (p40, 1, NULLIP, NULLVP, &((*parm) -> variables)) == NOTOK)
                    return NOTOK;
            }
        }
        else {
            advise (NULLCP, "ObjectBlock %svariables element", PEPY_ERR_MISSING);
            return NOTOK;
        }

    }


    if (pe -> pe_cardinal > 2) {
        advise (NULLCP, "ObjectBlock %s(2): %d", PEPY_ERR_TOO_MANY_ELEMENTS,
                pe -> pe_cardinal);
        return NOTOK;
    }

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_VarBindList (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_VarBindList ** parm;
{
    register PE p41;

#ifdef DEBUG
    (void) testdebug (pe, "HNMP.VarBindList");
#endif

    if (explicit) {
        if (pe -> pe_class != PE_CLASS_UNIV
                || pe -> pe_form != PE_FORM_CONS
                || pe -> pe_id != PE_CONS_SEQ) {
            advise (NULLCP, "VarBindList bad class/form/id: %s/%d/0x%x",
                    pe_classlist[pe -> pe_class], pe -> pe_form, pe -> pe_id);
            return NOTOK;
        }
    }
    else
        if (pe -> pe_form != PE_FORM_CONS) {
            advise (NULLCP, "VarBindList bad form: %d", pe -> pe_form);
            return NOTOK;
        }

    if ((p41 = prim2seq (pe)) == NULLPE) {
        advise (NULLCP, "VarBindList %s%s", PEPY_ERR_BAD_SEQ,
                pe_error (pe -> pe_errno));
        return NOTOK;
    }
    pe = p41;

    for (p41 = first_member (pe); p41; p41 = next_member (pe, p41)) {
        {
# line 653 "gen/HNMP-types.py"

                if ((*(parm) = (struct type_HNMP_VarBindList *)
                        calloc (1, sizeof **(parm))) == ((struct type_HNMP_VarBindList *) 0)) {
                    advise (NULLCP, "%s", PEPY_ERR_NOMEM);
                    return NOTOK;
                }
            
        }
        {
#ifdef DEBUG
            (void) testdebug (p41, "element");
#endif

            if (decode_HNMP_VarBind (p41, 1, NULLIP, NULLVP, &((*parm) -> VarBind)) == NOTOK)
                return NOTOK;
            {
# line 662 "gen/HNMP-types.py"
 parm = &((*parm) -> next); 
            }
        }
    }

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_VarBind (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_VarBind ** parm;
{
    register PE p42;

#ifdef DEBUG
    (void) testdebug (pe, "HNMP.VarBind");
#endif

    if (explicit) {
        if (pe -> pe_class != PE_CLASS_UNIV
                || pe -> pe_form != PE_FORM_CONS
                || pe -> pe_id != PE_CONS_SEQ) {
            advise (NULLCP, "VarBind bad class/form/id: %s/%d/0x%x",
                    pe_classlist[pe -> pe_class], pe -> pe_form, pe -> pe_id);
            return NOTOK;
        }
    }
    else
        if (pe -> pe_form != PE_FORM_CONS) {
            advise (NULLCP, "VarBind bad form: %d", pe -> pe_form);
            return NOTOK;
        }

    {
# line 665 "gen/HNMP-types.py"

        if ((*(parm) = (struct type_HNMP_VarBind *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_VarBind *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    
    }
    {
# line 673 "gen/HNMP-types.py"

            
    }
    if ((p42 = prim2seq (pe)) == NULLPE) {
        advise (NULLCP, "VarBind %s%s", PEPY_ERR_BAD_SEQ,
                pe_error (pe -> pe_errno));
        return NOTOK;
    }
    pe = p42;

    {
        register PE p43;

        if ((p43 = first_member (pe)) != NULLPE) {
            p42 = p43;

            {	/* name */
#ifdef DEBUG
                (void) testdebug (p43, "name");
#endif

                if (decode_HNMP_ObjectName (p43, 1, NULLIP, NULLVP, &((*parm) -> name)) == NOTOK)
                    return NOTOK;
            }
        }
        else {
            advise (NULLCP, "VarBind %sname element", PEPY_ERR_MISSING);
            return NOTOK;
        }

    }

    {
        register PE p44;

        if ((p44 = (pe != p42 ? next_member (pe, p42) : first_member (pe))) != NULLPE) {
            p42 = p44;

            {	/* value */
#ifdef DEBUG
                (void) testdebug (p44, "value");
#endif

                if (decode_HNMP_ObjectSyntax (p44, 1, NULLIP, NULLVP, &((*parm) -> value)) == NOTOK)
                    return NOTOK;
            }
        }
        else {
            advise (NULLCP, "VarBind %svalue element", PEPY_ERR_MISSING);
            return NOTOK;
        }

    }

    {
        register PE p45;

        if ((p45 = (pe != p42 ? next_member (pe, p42) : first_member (pe))) != NULLPE) {
            p42 = p45;

            {	/* interval */
                register integer p46;

#ifdef DEBUG
                (void) testdebug (p45, "interval");
#endif

                if (p45 -> pe_class != PE_CLASS_UNIV
                        || p45 -> pe_form != PE_FORM_PRIM
                        || p45 -> pe_id != PE_PRIM_INT) {
                    advise (NULLCP, "interval bad class/form/id: %s/%d/0x%x",
                            pe_classlist[p45 -> pe_class], p45 -> pe_form, p45 -> pe_id);
                    return NOTOK;
                }

                if ((p46 = prim2num (p45)) == NOTOK
                        && p45 -> pe_errno != PE_ERR_NONE) {
                    advise (NULLCP, "interval %s%s", PEPY_ERR_BAD_INTEGER,
                            pe_error (p45 -> pe_errno));
                    return NOTOK;
                }
                (*parm) -> interval  = p46;
            }
        }
        else {
            advise (NULLCP, "VarBind %sinterval element", PEPY_ERR_MISSING);
            return NOTOK;
        }

    }

    {
        register PE p47;

        if ((p47 = (pe != p42 ? next_member (pe, p42) : first_member (pe))) != NULLPE) {
            p42 = p47;

            {	/* timestamp */
#ifdef DEBUG
                (void) testdebug (p47, "timestamp");
#endif

                if (decode_HNMP_TimeTicks (p47, 1, NULLIP, NULLVP, &((*parm) -> timestamp)) == NOTOK)
                    return NOTOK;
            }
        }
        else {
            advise (NULLCP, "VarBind %stimestamp element", PEPY_ERR_MISSING);
            return NOTOK;
        }

    }


    if (pe -> pe_cardinal > 4) {
        advise (NULLCP, "VarBind %s(4): %d", PEPY_ERR_TOO_MANY_ELEMENTS,
                pe -> pe_cardinal);
        return NOTOK;
    }

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_ObjectName (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_ObjectName ** parm;
{
    register OID p48;

#ifdef DEBUG
    (void) testdebug (pe, "HNMP.ObjectName");
#endif

    if (explicit) {
        if (pe -> pe_class != PE_CLASS_UNIV
                || pe -> pe_form != PE_FORM_PRIM
                || pe -> pe_id != PE_PRIM_OID) {
            advise (NULLCP, "ObjectName bad class/form/id: %s/%d/0x%x",
                    pe_classlist[pe -> pe_class], pe -> pe_form, pe -> pe_id);
            return NOTOK;
        }
    }
    else
        if (pe -> pe_form != PE_FORM_PRIM) {
            advise (NULLCP, "ObjectName bad form: %d", pe -> pe_form);
            return NOTOK;
        }

    if ((p48 = prim2oid (pe)) == NULLOID) {
        advise (NULLCP, "ObjectName %s%s", PEPY_ERR_BAD_OID,
                pe_error (pe -> pe_errno));
        return NOTOK;
    }
    if (buffer)
        *buffer = sprintoid (p48);
    (*parm)  = oid_cpy (p48);

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_ObjectSyntax (pe, explicit, len, buffer, parm)
PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_ObjectSyntax ** parm;
{
#ifdef DEBUG
    (void) testdebug (pe, "HNMP.ObjectSyntax");
#endif

    ((*parm)  = pe) -> pe_refcnt++;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_IpAddress (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_IpAddress ** parm;
{
    register struct qbuf *p49;

#ifdef DEBUG
    (void) testdebug (pe, "HNMP.IpAddress");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_APPL, 0)) {
        advise (NULLCP, "IpAddress %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    if ((p49 = prim2qb (pe)) == (struct qbuf *)0) {
        advise (NULLCP, "IpAddress %s%s", PEPY_ERR_BAD_OCTET,
                pe_error (pe -> pe_errno));
        return NOTOK;
    }
    (*parm)  = p49;

    return OK;
}

/* ARGSUSED */

int	decode_HNMP_TimeTicks (pe, explicit, len, buffer, parm)
register PE	pe;
int	explicit;
int    *len;
char  **buffer;
struct type_HNMP_TimeTicks ** parm;
{
    register integer p50;

#ifdef DEBUG
    (void) testdebug (pe, "HNMP.TimeTicks");
#endif

    if (explicit
            && PE_ID (pe -> pe_class, pe -> pe_id)
                    != PE_ID (PE_CLASS_APPL, 3)) {
        advise (NULLCP, "TimeTicks %s%s/0x%x", PEPY_ERR_BAD_CLASS,
                pe_classlist[pe -> pe_class], pe -> pe_id);
        return NOTOK;
    }
    {
# line 707 "gen/HNMP-types.py"

        if ((*(parm) = (struct type_HNMP_TimeTicks *)
                calloc (1, sizeof **(parm))) == ((struct type_HNMP_TimeTicks *) 0)) {
            advise (NULLCP, "%s", PEPY_ERR_NOMEM);
            return NOTOK;
        }
    
    }
    if ((p50 = prim2num (pe)) == NOTOK
            && pe -> pe_errno != PE_ERR_NONE) {
        advise (NULLCP, "TimeTicks %s%s", PEPY_ERR_BAD_INTEGER,
                pe_error (pe -> pe_errno));
        return NOTOK;
    }
    (*parm) -> parm  = p50;
    if (len)
        *len = p50;

    return OK;
}
# line 720 "gen/HNMP-types.py"


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);
}

