eRIC-linux Library
Classes | Macros | Typedefs | Functions
packet.h File Reference

Description of Packet structure. More...

#include "crc.h"
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Classes

struct  Packet
 

Macros

#define INVITE   "0000"
 

Typedefs

typedef struct Packet Packet
 

Functions

unsigned int CRC_calculate (Packet *data)
 
int CRC_verify (Packet data)
 
void serialize_Packet (Packet *data)
 
void free_packet (Packet *data)
 

Detailed Description

Description of Packet structure.

Definition in file packet.h.

Typedef Documentation

◆ Packet

typedef struct Packet Packet

A Packet structure. New Packets can be created using the packet_new function.

See also
packet_new

Function Documentation

◆ CRC_calculate()

unsigned int CRC_calculate ( Packet data)

Calculate CRC and attach to end of Packet structure.

Returns
8 byte CRC value.

Definition at line 3 of file packet.c.

◆ CRC_verify()

int CRC_verify ( Packet  data)

Verify CRC

Returns
-1 if CRC verification fails.

Definition at line 7 of file packet.c.

◆ free_packet()

void free_packet ( Packet data)

Cleans and destroys packet. Call when a packet has been sent or received.

Definition at line 16 of file packet.c.

◆ serialize_Packet()

void serialize_Packet ( Packet data)

Serializes a Packet for sending/receiving.