#ident "$Id: ipdl_proto.h,v 1.1 1995/03/16 17:05:08 garyp Exp $"
/*****************************************************************************
 * Copyright (c) 1988-95 Digi International Inc., All Rights Reserved
 * 
 * This  software  contains  proprietary  and  confidential   information   of
 * Digi International  Inc.   By  accepting  transfer  of this copy, Recipient
 * agrees to retain this software in  confidence,  to  prevent  disclosure  to
 * others,  and  to make no  use of this software other than that for which it
 * was delivered.  This is an unpublished copyright work  Digi   International
 * Inc.    Except   as   permitted   by  federal  law,  17 USC 117, copying is
 * strictly prohibited.
 * 
 * Digi  International  Inc.  CONFIDENTIAL  -   (Digi    International    Inc.
 * Confidential  when   combined   with   the   aggregated  modules  for  this
 * product) OBJECT CODE ONLY SOURCE MATERIALS
 * 
 * (C) COPYRIGHT Digi International Inc. 1995
 * 
 * All Rights Reserved
 * 
 * US   Government   Users   Restricted   Rights   -   Use,   duplication   or
 * disclosure  restricted by GSA ADP Schedule Contract with Digi International
 * Inc.
 * 
 *****************************************************************************/


/******************************************************************
 *
 *  SpiderTCP Interface Primitives
 *
 *  Copyright (c) 1988  Spider Systems Limited
 *
 *  This Source Code is furnished under Licence, and may not be
 *  copied or distributed without express written agreement.
 *
 *  All rights reserved.
 *
 *  Written by 		Nick Felisiak, Ian Heavens, Peter Reid, 
 *			Gavin Shearer, Mark Valentine 
 *
 *  DL_PROTO.H
 *
 *  Datalink Streams proto primitives for TCP/IP on V.3 Streams               
 *
 ******************************************************************/

/*
 *	 /projects/common/PBRAIN/SCCS/pbrainF/dev/src/include/sys/snet/0/s.ipdl_proto.h
 *	@(#)ipdl_proto.h	1.5
 *
 *	Last delta created	08:56:54 1/15/90
 *	This file extracted	14:27:45 10/26/92
 *
 *	Modifications:
 *
 */

#define NET_TX		3	/* send ip pkt to sub-net */
#define BROAD_TX	15	/* send ip broadcast pkt to sub-net */
#define SN_FRGSZ	10	/* ip request sub net frag size */
#define IP_NETREG	11	/* ip send sub net addr to sub-net */
#define IP_RX		7	/* ip receives from sub net */
#define ARP_SNADDR	IP_NETREG	/* old, ARP specific defintion */	

/*
 * - IP sends data pkt to datalink module for transmission
 */
typedef struct net_tx {
	int prim_type;
	unsigned long src_inaddr;
	unsigned long dst_inaddr;
	unsigned long hdr_cnt;
#ifdef EMD 
	char	padding[4];	/* make sizeof(net_tx) >= sizeof(eth_tx) */
#endif
} S_NET_TX;

/*
 *
 * - IP sends broadcast data pkt to datalink module for transmission
 */
typedef struct broad_tx {
	int prim_type;
	unsigned long src_inaddr;
	unsigned long dst_net;
#ifdef EMD 
	char	padding[4];	/* make sizeof(net_tx) >= sizeof(eth_tx) */
#endif
} S_BROAD_TX;


/*
 * ip receives only primitive type, data unknown to lower layer
 */
typedef struct ip_rx {
	int prim_type;
} S_IP_RX;

union dl_proto {
	int type;
	S_NET_TX net_tx;
	S_BROAD_TX broad_tx;
};


/*
 * datalink layer registration
 */
 typedef struct ip_dl_reg {
	int prim_type;
	long inaddr;
	long subnet_mask;
	long int_flags;	/* flags to be filled in by lower module */
#ifdef ESETADDR
	char ethaddr[6];
#endif
} IP_DL_REG;

/*
 * the old, ARP specific interface definition
 */
#define arp_snaddr	ip_dl_reg 
#define S_ARP_SNADDR	IP_DL_REG

/*
 * datalink layer information (received after a IP_DLL_REG sent down)
 */
typedef struct sn_frgsz {
	int prim_type;
	int frgsz;
	int opt_size;
	long int_flags;
} S_SN_FRGSZ;


/*
 * errors generated 
 */
#ifndef EFRGSZ
#define EFRGSZ	1
#endif
#ifndef EDLTYPE
#define EDLTYPE 2
#endif
#ifndef EPRIM
#define EPRIM	3
#endif
#ifndef EBUF
#define EBUF	4
#endif
#ifndef EMSG
#define EMSG	5
#endif

