/*
    NetIPModule.h, Copyright  (c) by Jonas Bandi,
    Swiss Federal Institute of Technology,
    Computer Engineering and Networks Laboratory.
 
    TOPSY -- A Teachable Operating System.
             Implementation of a tiny and simple
             micro kernel for teaching purposes.
 
    For further information, please visit http://www.tik.ee.ethz.ch/~topsy
 
    This software is provided under the terms of the GNU General Public
    Licence. A full copy of the GNU GPL is provided in the file COPYING
    found in the development root of Topsy.
*/
/*
 
    File:                  $Source: /home/ruf/cvs_Topsy/cvs/Topsy/Net/Modules/IP6/NetIP6Module.h,v $
    Affiliation:           ETH Zuerich, TIK
    Version:               $Revision: 2922 $
    Last Date of Change:   $Date: 2007-03-19 17:48:52 +0100 (Mon, 19 Mär 2007) $  by: $Author: baderma $
 
*/
#ifndef _NET_IP6_MODULE_H_
#define _NET_IP6_MODULE_H_

#include "NetHAL.h"
#include "NetModulesNew.h"


typedef struct
{
  u16 bitfield0;    /* bitfield: version:4, traffic class:8, flow label:20; */
  u16 bitfield1;
  u16 payloadlength;
  u8  nextheader;
  u8  hoplimit;
  u16 saddr0;
  u16 saddr1;
  u16 saddr2;
  u16 saddr3;
  u16 saddr4;
  u16 saddr5;
  u16 saddr6;
  u16 saddr7;

  u16 daddr0;
  u16 daddr1;
  u16 daddr2;
  u16 daddr3;
  u16 daddr4;
  u16 daddr5;
  u16 daddr6;
  u16 daddr7;

}
NetIP6Hdr;


#define NETIP_PROTOCOL_ICMP6 58
#define NETIP_PROTOCOL_UDP  17
#define NETIP_PROTOCOL_TCP  6
//#define NETIP_FRAGOFF_MASK  0x1FFF
#define NETIP6_DEFAULT_MTU 1500
#define NETIP6_DEFAULT_TRAFFICCLASS 0x0
#define NETIP6_DEFAULT_FLOWLABEL_0 0x0
#define NETIP6_DEFAULT_FLOWLABEL_1 0x0
#define NETIP6_DEFAULT_HOPLIMIT 64
//#define NETIP_DEFAULT_TOS 0

// function prototypes for IPModuleDown
void netIP6ModuleDownInit (NetModule this);
int netIP6ModuleDownConfig (NetModule this, Message *msg);
void netIP6ModuleDownMain (LWPool lw, ThreadArg arg);
// function prototypes for IPModuleUp
void netIP6ModuleUpInit (NetModule this);
int netIP6ModuleUpConfig (NetModule this, Message *msg);
void netIP6ModuleUpMain (LWPool lw, ThreadArg arg);

#endif

