Created
September 23, 2017 05:46
-
-
Save AjayKrP/863ba9c3f57665a6caa95ce12f28848f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Data structure for packet in our GBN implementation | |
* Type indicates what kind of packet it is | |
* 0 - request | |
* 1 - ACK | |
* 2 - data | |
* 3 - teardown | |
* If type == data, then seq_no denotes the current packet's sequence number | |
* Length is the length of the data field | |
* Data carries the request or actual data; empty if type == ACK | |
*/ | |
#define DATA_SIZE 128 | |
struct packet | |
{ | |
int type; | |
int seq_no; | |
int length; | |
char data[DATA_SIZE]; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment