Changeset View
Changeset View
Standalone View
Standalone View
sys/opencrypto/deflate.h
Show All 30 Lines | |||||
/* | /* | ||||
* Definition for the wrapper around the deflate compression | * Definition for the wrapper around the deflate compression | ||||
* algorithm used in /sys/crypto | * algorithm used in /sys/crypto | ||||
*/ | */ | ||||
#ifndef _CRYPTO_DEFLATE_H_ | #ifndef _CRYPTO_DEFLATE_H_ | ||||
#define _CRYPTO_DEFLATE_H_ | #define _CRYPTO_DEFLATE_H_ | ||||
#include <sys/zlib.h> | |||||
#define Z_METHOD 8 | #define Z_METHOD 8 | ||||
#define Z_MEMLEVEL 8 | #define Z_MEMLEVEL 8 | ||||
#define MINCOMP 2 /* won't be used, but must be defined */ | #define MINCOMP 2 /* won't be used, but must be defined */ | ||||
#define ZBUF 10 | #define ZBUF 10 | ||||
u_int32_t deflate_global(u_int8_t *, u_int32_t, int, u_int8_t **); | u_int32_t deflate_global(u_int8_t *, u_int32_t, int, u_int8_t **); | ||||
void *z_alloc(void *, u_int, u_int); | |||||
void z_free(void *, void *); | |||||
ota_j.email.ne.jp: i.e. z_alloc/z_free. | |||||
/* | /* | ||||
* We are going to use a combined allocation to hold the metadata | * We are going to use a combined allocation to hold the metadata | ||||
* from the struct immediately followed by the real application data. | * from the struct immediately followed by the real application data. | ||||
*/ | */ | ||||
struct deflate_buf { | struct deflate_buf { | ||||
struct deflate_buf *next; | struct deflate_buf *next; | ||||
uint32_t size; | uint32_t size; | ||||
uint8_t data[]; | uint8_t data[]; | ||||
}; | }; | ||||
#endif /* _CRYPTO_DEFLATE_H_ */ | #endif /* _CRYPTO_DEFLATE_H_ */ |
i.e. z_alloc/z_free.