#ifndef DSR_H
#define DSR_H

/* option types */
#define PAD1        0
#define PADN        1
#define ROUTE_REQ   2
#define ROUTE_REPLY 3
#define ROUTE_ERROR 4
#define ACK_REQ     5
#define ACK         6
#define SRC_ROUTE   7

#ifdef DSR_CRYPT
#define QOS_CRYPT   16
#define QOS_CRYPT_REQ 17

#define QOS_CRYPT_REQ_TIMEOUT 3000 /* milliseconds */
#define QOS_CRYPT_MAX_REQ_TIMEOUT  20000 /* milliseconds */
#define QOS_CRYPT_REQ_RXMT 16 /* resend qos_req 16 times */
#define QOS_CRYPT_VALIDITY_TIMEOUT 10 /* seconds */
#define QOS_CRYPT_REFRESH_INTERVAL 10 /* seconds: defines interval in which expired 
					 qos values nodes are checked and qos_req is resent */

#define SIGTYPE_SSL 1
#define SIGTYPE_GPG 2
#define MAX_SIG_LEN 100 /* max length of signature */
#define MAX_QOS 255 /* max value of qos */
#define MAX_TRUST 255 /* max value of trust */
#endif

/* ietf draft definitions */
#define BCAST_JITTER         20  /* milliseconds default 10 */
#define MAX_ROUTE_LEN        15  /* nodes default 15 */
#define ROUTE_CACHE_TIMEOUT  300 /* seconds */

#define SEND_BUFFER_TIMEOUT  30  /* seconds */
#define REQ_TABLE_SIZE       12  /* nodes default 64 */
#define REQ_TABLE_IDS        16
#define MAX_REQ_RXMT         16
#define MAX_REQ_PERIOD       1   /* seconds default 10 */
#define REQ_PERIOD           250 /* milliseconds default 500 */

#define DSR_RXMT_BUFFER_SIZE 300 /* packets default 50 */
#define DSR_MAXRXTSHIFT      0   /* default twice */

/* own definitions */
#define ROUTE_CACHE_SIZE 20      /* entries */
#define SEND_BUFFER_SIZE 50      /* packets */
#define NO_NEXT_HEADER   59      /* ipv6 no next header */
#define DSR_PROTOCOL     168     /* protocol number */
#define ACK_TIMEOUT_MS   300     /* milliseconds 300-500 is good */
#define ACK_TIMEOUT_JF   ((ACK_TIMEOUT_MS * HZ) / 1000)

#define DSR_SUBNET(x)     ((x & NETMASK) == NETWORK)
#define NOT_DSR_SUBNET(x) ((x & NETMASK) != NETWORK)

#endif /* DSR_H */
