File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / ftam / ftamshare.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

/* ftamshare.c - FPM: encode/decode shared ASE information */

#ifndef	lint
static char *rcsid = "$Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/ftam/ftamshare.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $";
#endif

/* 
 * $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/ftam/ftamshare.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $
 *
 *
 * $Log: ftamshare.c,v $
 * Revision 1.1.1.1  2018/04/24 16:12:56  root
 * BSD 4.3reno
 *
 * Revision 7.0  89/11/23  21:53:53  mrose
 * Release 6.0
 * 
 */

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


/* LINTLIBRARY */

#include <stdio.h>
#include "fpkt.h"

/*  */

struct type_FTAM_Shared__ASE__Information *shared2fpm (fsb, sharedASE, fti)
register struct ftamblk *fsb;
PE	sharedASE;
struct FTAMindication *fti;
{
    register struct type_FTAM_Shared__ASE__Information *fpm;

    if ((fpm = (struct type_FTAM_Shared__ASE__Information *)
		    calloc (1, sizeof *fpm)) == NULL) {
	(void) ftamlose (fti, FS_GEN (fsb), 1, NULLCP, "out of memory");
	if (fpm)
	    free_FTAM_Shared__ASE__Information (fpm);
	return NULL;
    }

    fpm -> indirect__reference = sharedASE -> pe_context;
    fpm -> encoding -> offset = choice_UNIV_0_single__ASN1__type;
    (fpm -> encoding -> un.single__ASN1__type = sharedASE) -> pe_refcnt++;

    return fpm;
}

/*  */

int	fpm2shared (fsb, fpm, sharedASE, fti)
struct ftamblk *fsb;
register struct type_FTAM_Shared__ASE__Information *fpm;
PE    *sharedASE;
struct FTAMindication *fti;
{
    PE	    pe;
    
    if (fpm -> encoding -> offset != choice_UNIV_0_single__ASN1__type)
	return ftamlose (fti, FS_GEN (fsb), 1, NULLCP,
			 "shared ASE information not single-ASN1-type");

    if ((pe = pe_cpy (fpm -> encoding -> un.single__ASN1__type)) == NULLPE)
	(void) ftamlose (fti, FS_GEN (fsb), 1, NULLCP, "out of memory");
    (*sharedASE = pe) -> pe_context = fpm -> indirect__reference;

    return OK;
}

unix.superglobalmegacorp.com

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