1#ifndef P2P_TRANSMITTER_PACKET_H
2#define P2P_TRANSMITTER_PACKET_H
16 struct Byte* previous;
void freePacket(Packet *p)
Free the memory reserved for the packet and all contained bytes.
Definition packet.c:140
Packet * createRetransmitPacket(uint8_t identifier)
Creates a Packet requesting that the peer retransmit the cached Packet with the specified identifier.
Definition packet.c:36
Packet * byteToPacket(Byte *b)
Creates a Packet structure containing the provided Byte.
Definition packet.c:67
Packet * toPacket(char *s)
Converts a char* string to a Packet containing one Byte per char.
Definition packet.c:42
void printByte(Byte *b)
Sending and retransmitting.
Definition packet.c:108
bool getPacketRT(Packet *p)
Checks the header field to determine if the specified Packet ID should be retransmitted.
Definition packet.c:82
void packetAppendByte(Packet *p, Byte *b)
Creates a Packet to be stored within the PacketCache.
Definition packet.c:91
void setPacketID(Packet *p, uint8_t id)
Sets the Packet Identifier within the header field.
Definition packet.c:86
Byte * toByte(char c)
Converts a character to a Byte struct (linked list node)
Definition packet.c:8
void printPacket(Packet *p)
Display the bytes contained within the packet and their ASCII representation.
Definition packet.c:116
uint8_t getPacketID(Packet *p)
Extracts the Packet Identifier from the header field.
Definition packet.c:77
Packet * createPacket()
Creates a reserved, empty Packet struct instance.
Definition packet.c:21
bool parity
Boolean used for even parity implementation.
Definition packet.h:34
Byte * lastByte
The last Byte contained within the Linked List, used for reverse traversal.
Definition packet.h:31
int length
Number of contained Bytes within the Packet. This value is not reliable and must be updated in any cu...
Definition packet.h:22
uint8_t header
4-bit Packet header
Definition packet.h:26
Byte * firstByte
The first Byte contained within the Linked List, used for forward traversal.
Definition packet.h:29