#ifndef __ROUTING_H__
#define __ROUTING_H__

#include <net.h>

#define ROUTING_TYPE_RREQ 0x00
#define ROUTING_TYPE_RREP 0x01

typedef struct {
  unsigned char type;
} routing_hdr_t;

typedef struct {
  routing_hdr_t hdr;
  net_addr_t    orig;
  net_addr_t    dst;
  unsigned char orig_seq_num;
  unsigned char num_hops;
} rreq_t;

typedef struct {
  routing_hdr_t hdr;
  net_addr_t    orig;
  net_addr_t    dst;
  unsigned char num_hops;
  unsigned char dst_seq_num;
} rrep_t;

#ifdef __cplusplus
extern "C" {
#endif

  void routing_init();
  void routing_send_rreq(net_addr_t dst);
  void routing_recv(mac_frame * frame);
  void routing_refresh();

#ifdef __cplusplus
}
#endif

#endif /* __ROUTING_H__ */
