Skip to content

Instantly share code, notes, and snippets.

View akhilesh-kumar-verma's full-sized avatar

Akhilesh Kumar Verma akhilesh-kumar-verma

  • Delhi Technological University
  • Delhi, Delhi. India.
View GitHub Profile
#define MAX_PKT 1024 /* packet size in bytes */
typedef enum { false, true } boolean; /* boolean type */
typedef unsigned int seq_nr; /* sequence or ACK numbers */
typedef struct {
unsigned char data[MAX_PKT];
} packet; /* packet definition */
typedef enum { data, ack, nak } frame_kind; /* frame kind definition */