RTEMS CPU Kit with SuperCore
Macros | Functions
slcompress.c File Reference
#include <stdint.h>
#include <sys/param.h>
#include <sys/mbuf.h>
#include <sys/systm.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <net/slcompress.h>
Include dependency graph for slcompress.c:

Macros

#define INCR(counter)   ++comp->counter;
 
#define BCMP(p1, p2, n)   bcmp((void *)(p1), (void *)(p2), (int)(n))
 
#define BCOPY(p1, p2, n)   bcopy((void *)(p1), (void *)(p2), (int)(n))
 
#define ENCODE(n)
 
#define ENCODEZ(n)
 
#define DECODEL(f)
 
#define DECODES(f)
 
#define DECODEU(f)
 

Functions

void sl_compress_init (struct slcompress *comp, int max_state)
 
u_int sl_compress_tcp (struct mbuf *m, struct ip *ip, struct slcompress *comp, int compress_cid)
 
int sl_uncompress_tcp (u_char **bufp, int len, u_int type, struct slcompress *comp)
 
int sl_uncompress_tcp_core (u_char *buf, int buflen, int total_len, u_int type, struct slcompress *comp, u_char **hdrp, u_int *hlenp)
 

Macro Definition Documentation

◆ DECODEL

#define DECODEL (   f)
Value:
{ \
if (*cp == 0) {\
(f) = htonl(ntohl(f) + ((cp[1] << 8) | cp[2])); \
cp += 3; \
} else { \
(f) = htonl(ntohl(f) + (u_int32_t)*cp++); \
} \
}

◆ DECODES

#define DECODES (   f)
Value:
{ \
if (*cp == 0) {\
(f) = htons(ntohs(f) + ((cp[1] << 8) | cp[2])); \
cp += 3; \
} else { \
(f) = htons(ntohs(f) + (u_int32_t)*cp++); \
} \
}

◆ DECODEU

#define DECODEU (   f)
Value:
{ \
if (*cp == 0) {\
(f) = htons((cp[1] << 8) | cp[2]); \
cp += 3; \
} else { \
(f) = htons((u_int32_t)*cp++); \
} \
}

◆ ENCODE

#define ENCODE (   n)
Value:
{ \
if ((u_int16_t)(n) >= 256) { \
*cp++ = 0; \
cp[1] = (n); \
cp[0] = (n) >> 8; \
cp += 2; \
} else { \
*cp++ = (n); \
} \
}

◆ ENCODEZ

#define ENCODEZ (   n)
Value:
{ \
if ((u_int16_t)(n) >= 256 || (u_int16_t)(n) == 0) { \
*cp++ = 0; \
cp[1] = (n); \
cp[0] = (n) >> 8; \
cp += 2; \
} else { \
*cp++ = (n); \
} \
}