/*     
 * $RCSfile: hippi_hdrs.h,v $
 *
 * x-kernel v3.3
 *
 * Copyright (c) 1993,1991,1990,1996  Arizona Board of Regents
 *
 * $Log: hippi_hdrs.h,v $
 * Revision 1.1  1997/03/11 20:47:08  dorgival
 * Initial revision
 *
 *
 */
/*
 * hippi_hdrs
 */

#ifndef __hippi_hdrs_h__
#define __hippi_hdrs_h__

/*
 * The driver must include raw_hippi.h anyway, so we don't need to
 * redefine struct hippi_fp_header here. Just as a reminder, it is
 * copied below (and commented out)
 */

#include <raw_hippi.h>

#if 0

struct hippi_ifield {
    u_long Ifield;
    u_long filler[7];
};


union hippi_fp_header {
    struct {
	int d2_off:3;
	int d1_size:8;
	int res:11;
	int b:1;
	int p:1;
	int ulp:8;
	int d2_size;
    } fields;

    struct {
	u_long w1;
	u_long w2;
    } words;
};

#endif

struct eth_addr {
    u_short high;
    u_short mid;
    u_short low;
};

struct hippi_le_header {
    u_int dst_sw_address:24;
    u_int m_type:4;
    u_int w:1;
    u_int fc:3;

    u_int src_sw_address:24;
    u_int sat:4;
    u_int dat:4;

    u_short         res;
    struct eth_addr dst_ieee_address;
    u_short         le_local_admin;
    struct eth_addr src_ieee_address;
};

struct llc {
    u_char  dsap;
    u_char  ssap;
    u_char  control;
    u_char  org_code[3];
    u_short ether_type;
};

typedef struct {
    union  hippi_fp_header fp;
    struct hippi_le_header le;
    struct llc             llc;
} hippi_header_in_t;

typedef struct {
    struct hippi_ifield     cci;
    union  hippi_fp_header  fp;
    struct hippi_le_header  le;
    struct llc              llc;
} hippi_header_out_t;

typedef union {
    hippi_header_in_t  in;
    hippi_header_out_t out;
} hippi_header_any_t;

#define LEN_ROUND8( len ) (((len)+7)&(~7))

#endif /* __hippi_hdrs_h__ */
