#include #include "prog.h" static struct distance_table { int costs[4][4]; } dt; /* students to write the following two routines, and maybe some others */ void rtinit1() { } void rtupdate1(struct rtpkt *rcvdpkt) { } void printdt1(struct distance_table *dtptr) { printf(" dest \n"); printf(" D1 | 0 2 3\n"); printf(" ----|-----------------\n"); printf(" 0| %3d %3d %3d\n",dtptr->costs[0][0], dtptr->costs[0][2], dtptr->costs[0][3]); printf("via 2| %3d %3d %3d\n",dtptr->costs[2][0], dtptr->costs[2][2], dtptr->costs[2][3]); } /* called when cost from 1 to linkid changes from current value to newcost*/ /* You can leave this routine empty if you're an undergrad. If you want */ /* to use this routine, you'll need to change the value of the LINKCHANGE */ /* constant definition in prog3.c from 0 to 1 */ void linkhandler1(int linkid, int newcost) { }