#ifndef __NET_H__
#define __NET_H__

#include <802_15_4.h>

#define NET_ADDR_ANY 0xffffffffUL

#define NET_PROTO_ICMP 0x00

typedef unsigned long net_addr_t;

typedef struct {
  net_addr_t    src;
  net_addr_t    dst;
  unsigned char ttl;
  unsigned char protocol;
} net_hdr_t;

#ifdef __cplusplus
extern "C" {
#endif

  void net_addr_print(net_addr_t addr);

  int net_rt_add(net_addr_t dst, saddr_t nh);
  saddr_t net_rt_lookup(net_addr_t dst);
  void net_rt_dump();

  void net_init(net_addr_t addr);
  int net_send(net_addr_t dst, unsigned char protocol,
	       const unsigned char * payload, unsigned char payload_len);
  void net_recv(mac_frame * frame);
  net_addr_t net_get_local_addr();

#ifdef __cplusplus
}
#endif

#endif /* __NET_H__ */
