Assignment/sliding_window_dp_FINAL.c
static void send_ack_frame(int seq, int type, int link)
{
    FRAME f;
    size_t size;

    f.checksum = 0;
    f.src_node = nodeinfo.nodenumber;
    f.type = type;
    if(type == REJ)
        printf("Reject Transmitted, Sequence No: %d, From Node Number: %d, ", f.seq, f.src_node);
    else
        printf("Receive-Ready transmitted, Sequence No: %d, From Node Number: %d, ", f.seq, f.src_node);

    size = sizeof(FRAME);
    f.checksum = CNET_ccitt((unsigned char *) &f, (int)size);

    printf("Checksum: %d\n", f.checksum);

    CHECK(CNET_write_physical(link, (char *) &f, &size));
}
//This method is called when an acknowledgement frame is to be sent, whether it be
//REJ or RR
This method is called when an acknowledgement frame is to be sent, whether it be
REJ or RR
This method is called when an acknowledgement frame is to be sent whether it be REJ or RR
static void send_ack_frame(int seq, int type, int link)
{
    FRAME f;
    size_t size;
    f.checksum = 0;
    f.src_node = nodeinfo.nodenumber;
    f.type = type;
    if(type == REJ)
        printf("Reject Transmitted, Sequence No: %d, From Node Number: %d, ", f.seq, f.src_node);
    else
        printf("Receive-Ready transmitted, Sequence No: %d, From Node Number: %d, ", f.seq, f.src_node);
    size = sizeof(FRAME);
    f.checksum = CNET_ccitt((unsigned char *) &f, (int)size);
    printf("Checksum: %d\n", f.checksum);
    CHECK(CNET_write_physical(link, (char *) &f, &size));
}
static void send_ack_frame ( int seq , int type , int link ) { FRAME f ; size_t size ; f . checksum = 0 ; f . src_node = nodeinfo . nodenumber ; f . type = type ; if ( type == REJ ) printf ( " " , f . seq , f . src_node ) ; else printf ( " " , f . seq , f . src_node ) ; size = sizeof ( FRAME ) ; f . checksum = CNET_ccitt ( ( unsigned char * ) & f , ( int ) size ) ; printf ( " \n " , f . checksum ) ; CHECK ( CNET_write_physical ( link , ( char * ) & f , & size ) ) ; }
This method is called when an acknowledgement frame is to be sent, whether it be
REJ or RR
This method is called when an acknowledgement frame is to be sent whether it be REJ or RR