/*
 *      Binding Update List header file
 *
 *      Authors:
 *      Juha Mynttinen            <jmynttin@cc.hut.fi>
 *
 *      $Id: bul.h,v 1.1.1.1 2000/06/13 08:24:43 henkku Exp $
 *
 *      This program is free software; you can redistribute it and/or
 *      modify it under the terms of the GNU General Public License
 *      as published by the Free Software Foundation; either version
 *      2 of the License, or (at your option) any later version.
 *
 */

#ifndef _BUL_H
#define _BUL_H

#include "hashlist.h"

#define NOT_SENT 0x01 
#define RESEND_EXP 0x02
#define RESEND_CONST 0x04
#define SEND_NOMORE 0x08

#define BUL_ACK 0x01
#define BUL_ROUTER 0x02
#define BUL_HOME 0x04

struct mipv6_bul_entry {
	struct in6_addr cn_addr;      /* CN to which BU was sent */
	struct in6_addr home_addr;    /* home address of this binding */
	struct in6_addr coa;          /* care-of address of the sent BU */
	unsigned long expire;         /* expiration time of this entry (jiffies) */ 
	__u16 seq;                    /* sequence number of the latest BU */
	__u32 lastsend;               /* last time when BU was sent (jiffies) */
	__u8 prefix;
	__u8 flags;
  
	/* retransmission info */
	__u8 state;
	__u32 delay;
	__u32 maxdelay;
	unsigned long callback_time;
	int (*callback)(struct mipv6_bul_entry *entry);
};

int mipv6_initialize_bul(__u32 size);

int mipv6_shutdown_bul(void);

int mipv6_bul_add(struct in6_addr *cn_addr,
		  struct in6_addr *home_addr,
		  struct in6_addr *coa,
		  __u32 lifetime,
		  __u16 seq,
		  __u8 prefix,
		  __u8 flags,
		  int (*callback)(struct mipv6_bul_entry *entry),
		  __u32 callback_time,
		  __u8 state,
		  __u32 delay,
		  __u32 maxdelay);

int mipv6_bul_delete(struct in6_addr *cn_addr);

void mipv6_bul_dump(void);

struct mipv6_bul_entry *mipv6_bul_get(struct in6_addr *cn_addr);

void mipv6_bul_put(struct mipv6_bul_entry *entry);

int bul_iterate(int (*func)(struct mipv6_bul_entry *entry));

#endif /* BUL_H */



