packet.h 2.03 KB
Newer Older
Kristin Wright's avatar
Kristin Wright committed
1
/* 
Mike Hibler's avatar
Mike Hibler committed
2
 * EMULAB-COPYRIGHT
Kristin Wright's avatar
Kristin Wright committed
3 4 5 6 7 8 9 10 11 12
 * Copyright (c) 2000 The University of Utah and the Flux Group.
 * All rights reserved.
 *
 * ---------------------------
 *
 * Filename: packet.h
 *   -- Author: Kristin Wright <kwright@cs.utah.edu> 
 *
 * ---------------------------
 *
Mike Hibler's avatar
Mike Hibler committed
13
 * $Id: packet.h,v 1.8 2004-06-17 18:17:01 mike Exp $
Kristin Wright's avatar
Kristin Wright committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
 */

#ifndef _TOPD_PACKET_H_
#define _TOPD_PACKET_H_

#include "discvr.h"

/*
 * Node IDs are the highest MAC address on the machine.
 * The easiest but not the most portable thing to
 * do is assume a 6-byte hardware address. This isn't
 * completely ridiculous as most of this tool's 
 * target platforms use ethernet. 
 * 
 * typedef u_char topd_nodeID_t[ETHADDRSIZ]; 
 */

/* 
 * Inquiry packet has only a unique Inquiry ID
 * comprised of [timestamp, sender-nodeID] pair. Timestamps
 * are struct timevals returned by gettimeofday().
 */
typedef struct topd_inqid {
37 38 39 40 41
	struct timeval     tdi_tv;
	u_int16_t          tdi_ttl;
	u_int16_t          tdi_factor;
	u_char             tdi_nodeID[ETHADDRSIZ];
	u_char			   tdi_p_nodeIF[ETHADDRSIZ];
42
	int				   lans_exist;                
Kristin Wright's avatar
Kristin Wright committed
43 44 45 46
} topd_inqid_t;

#define TOPD_INQ_SIZ ALIGN(sizeof(struct topd_inqid))

47 48 49 50 51
struct topd_inqnode {
        struct topd_inqnode *inqn_next;
        struct topd_inqid   *inqn_inq;
};

Kristin Wright's avatar
Kristin Wright committed
52 53 54 55 56 57 58 59 60 61 62
/*
 * Neighbor (reply) packets consist of 
 *
 *     [Neighbor ID, Route]
 *
 * pairs. Routes identify the interface through which
 * the node can reach the neighbor. These interfaces
 * are not necessarily local. Rather, they are 
 * interfaces belonging to the neighbor's parent.
 */
struct topd_nbor {
Kristin Wright's avatar
Kristin Wright committed
63 64 65 66
  u_char  tdnbor_pnode[ETHADDRSIZ]; /* path nodeID */
  u_char  tdnbor_pif[ETHADDRSIZ];   /* path if */
  u_char  tdnbor_dnode[ETHADDRSIZ]; /* dest nodeID */
  u_char  tdnbor_dif[ETHADDRSIZ];   /* dest if */
Kristin Wright's avatar
Kristin Wright committed
67 68 69 70 71 72 73 74 75 76 77
};

struct topd_nborlist {
  struct topd_nborlist *tdnbl_next;          /* next of these structures */
  u_int32_t            tdnbl_n;              /* number of neighbors in neighbor list */ 
  u_char               *tdnbl_nbors;         /* neighbor list */
};



#endif /* _TOPD_PACKET_H_ */