Assignment/sliding_window_dp_FINAL.c
static void middle_man_send(FRAME f, int dest){
    size_t size;
    int link;

    size = FRAME_SIZE(f);
    link = routing_table[nodeinfo.nodenumber][dest]; //get the link from the routing table
    f.checksum = CNET_ccitt((unsigned char *) &f, (int)size);

    printf("\n\nIn Middle Man Node Number: %d\n", nodeinfo.nodenumber);
    printf("\tTransmitting FRAME through Link: %d\n", link);
    printf("\tFRAME transmitted, From Node Number: %d, Sequence No: %d, Checksum: %d\n", nodeinfo.nodenumber, f.seq, f.checksum);
    printf("Exiting Middle Man Node Number: %d\n", nodeinfo.nodenumber);

    CHECK(CNET_write_physical(link, (char *) &f, &size));
}
//This method is called when a node has received a frame but it doesn't belong to it
This method is called when a node has received a frame but it doesn't belong to it
This method is called when a node has received a frame but it doesn ' t belong to it
static void middle_man_send(FRAME f, int dest){
    size_t size;
    int link;
    size = FRAME_SIZE(f);
    link = routing_table[nodeinfo.nodenumber][dest]; 
    f.checksum = CNET_ccitt((unsigned char *) &f, (int)size);
    printf("\n\nIn Middle Man Node Number: %d\n", nodeinfo.nodenumber);
    printf("\tTransmitting FRAME through Link: %d\n", link);
    printf("\tFRAME transmitted, From Node Number: %d, Sequence No: %d, Checksum: %d\n", nodeinfo.nodenumber, f.seq, f.checksum);
    printf("Exiting Middle Man Node Number: %d\n", nodeinfo.nodenumber);
    CHECK(CNET_write_physical(link, (char *) &f, &size));
}
static void middle_man_send ( FRAME f , int dest ) { size_t size ; int link ; size = FRAME_SIZE ( f ) ; link = routing_table [ nodeinfo . nodenumber ] [ dest ] ; f . checksum = CNET_ccitt ( ( unsigned char * ) & f , ( int ) size ) ; printf ( " \n \n \n " , nodeinfo . nodenumber ) ; printf ( " \t \n " , link ) ; printf ( " \t \n " , nodeinfo . nodenumber , f . seq , f . checksum ) ; printf ( " \n " , nodeinfo . nodenumber ) ; CHECK ( CNET_write_physical ( link , ( char * ) & f , & size ) ) ; }
This method is called when a node has received a frame but it doesn't belong to it
This method is called when a node has received a frame but it doesn ' t belong to it
//get the link from the routing table