API Reference Manual  1.45.0
api/spec/comp.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2018 Linaro Limited
3  */
4 
11 #ifndef ODP_API_SPEC_COMP_H_
12 #define ODP_API_SPEC_COMP_H_
13 
14 #include <odp/visibility_begin.h>
15 
16 #include <odp/api/event_types.h>
17 #include <odp/api/packet_types.h>
18 #include <odp/api/queue_types.h>
19 #include <odp/api/std_types.h>
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
45 typedef enum {
52 
60 
64 typedef enum {
67 
71 
75 typedef enum {
78 
81 
85 
90 typedef enum {
93 
96 
99 
103 
107 typedef enum {
110 
113 
117 
121 typedef union odp_comp_hash_algos_t {
123  struct {
125  uint32_t none : 1;
126 
128  uint32_t sha1 : 1;
129 
131  uint32_t sha256 : 1;
132 
133  } bit;
134 
140  uint32_t all_bits;
142 
146 typedef union odp_comp_algos_t {
148  struct {
150  uint32_t null : 1;
151 
153  uint32_t deflate : 1;
154 
156  uint32_t zlib : 1;
157 
159  uint32_t lzs : 1;
160  } bit;
161 
166  uint32_t all_bits;
168 
172 typedef struct odp_comp_capability_t {
174  uint32_t max_sessions;
175 
178 
181 
184 
188 
194  uint32_t digest_len;
196 
205  uint32_t max_level;
206 
209 
224 
228 typedef enum odp_comp_huffman_code {
231 
234 
238 
243 typedef struct odp_comp_deflate_param {
260  uint32_t comp_level;
261 
265 
269 typedef union odp_comp_alg_param_t {
272 
274  struct {
277  } zlib;
279 
283 typedef struct odp_comp_session_param_t {
286 
294 
300 
306 
309 
325 
332 
336 typedef struct odp_comp_packet_result_t {
339 
342 
350 
357 
364 
377 
389 
403 
417 
427 
442 
455 
493 int odp_comp_op(const odp_packet_t pkt_in[], odp_packet_t pkt_out[],
494  int num_pkt, const odp_comp_packet_op_param_t param[]);
495 
543 int odp_comp_op_enq(const odp_packet_t pkt_in[], odp_packet_t pkt_out[],
544  int num_pkt, const odp_comp_packet_op_param_t param[]);
545 
562 
579 
589 
602 
607 #ifdef __cplusplus
608 }
609 #endif
610 
611 #include <odp/visibility_end.h>
612 #endif
613 
ODP event API type definitions.
ODP packet.
ODP queue.
Standard C language types and definitions for ODP.
struct odp_comp_alg_capability_t odp_comp_alg_capability_t
Compression algorithm capabilities.
union odp_comp_algos_t odp_comp_algos_t
Compression algorithms in a bit field structure.
int odp_comp_session_destroy(odp_comp_session_t session)
Compression session destroy.
odp_comp_session_t odp_comp_session_create(const odp_comp_session_param_t *param)
Compression session creation.
odp_comp_hash_alg_t
Compression hash algorithms.
Definition: api/spec/comp.h:75
struct odp_comp_packet_result_t odp_comp_packet_result_t
Compression packet operation result.
uint64_t odp_comp_session_to_u64(odp_comp_session_t hdl)
Get printable value for an odp_comp_session_t.
enum odp_comp_huffman_code odp_comp_huffman_code_t
Compression Huffman type.
odp_packet_t odp_comp_packet_from_event(odp_event_t event)
Convert compression processed packet event to packet handle.
odp_comp_huffman_code
Compression Huffman type.
int odp_comp_result(odp_comp_packet_result_t *result, odp_packet_t packet)
Get compression operation results from processed packet.
int odp_comp_op_enq(const odp_packet_t pkt_in[], odp_packet_t pkt_out[], int num_pkt, const odp_comp_packet_op_param_t param[])
Asynchronous packet compression operation.
struct odp_comp_packet_op_param_t odp_comp_packet_op_param_t
Compression per packet operation parameters.
int odp_comp_capability(odp_comp_capability_t *capa)
Query compression capabilities.
struct odp_comp_hash_alg_capability_t odp_comp_hash_alg_capability_t
Hash algorithm capabilities.
int odp_comp_alg_capability(odp_comp_alg_t comp, odp_comp_alg_capability_t *capa)
Query supported compression algorithm capabilities.
struct odp_comp_capability_t odp_comp_capability_t
Compression Interface Capabilities.
struct odp_comp_session_param_t odp_comp_session_param_t
Compression session creation parameters.
odp_comp_op_mode_t
Compression operation mode.
Definition: api/spec/comp.h:45
odp_comp_status_t
Compression operation status codes.
odp_event_t odp_comp_packet_to_event(odp_packet_t pkt)
Convert processed packet handle to event.
void odp_comp_session_param_init(odp_comp_session_param_t *param)
Initialize compression session parameters.
odp_comp_alg_t
Compression algorithms.
Definition: api/spec/comp.h:90
int odp_comp_hash_alg_capability(odp_comp_hash_alg_t hash, odp_comp_hash_alg_capability_t *capa)
Query supported hash algorithm capabilities.
union odp_comp_hash_algos_t odp_comp_hash_algos_t
Hash algorithms in a bit field structure.
union odp_comp_alg_param_t odp_comp_alg_param_t
Compression algorithm specific parameters.
struct odp_comp_deflate_param odp_comp_deflate_param_t
Compression DEFLATEe algorithm parameters.
int odp_comp_op(const odp_packet_t pkt_in[], odp_packet_t pkt_out[], int num_pkt, const odp_comp_packet_op_param_t param[])
Synchronous packet compression operation.
odp_comp_op_t
Compression operation type.
Definition: api/spec/comp.h:64
@ ODP_COMP_HASH_ALG_SHA256
SHA-2 hash algorithm 256-bit digest length.
Definition: api/spec/comp.h:83
@ ODP_COMP_HASH_ALG_NONE
No hash algorithm selected.
Definition: api/spec/comp.h:77
@ ODP_COMP_HASH_ALG_SHA1
SHA-1 hash algorithm.
Definition: api/spec/comp.h:80
@ ODP_COMP_HUFFMAN_DYNAMIC
Dynamic Huffman code.
@ ODP_COMP_HUFFMAN_FIXED
Fixed Huffman code.
@ ODP_COMP_HUFFMAN_DEFAULT
Default huffman code selected by implementation.
@ ODP_COMP_OP_MODE_ASYNC
Asynchronous Compression operation.
Definition: api/spec/comp.h:58
@ ODP_COMP_OP_MODE_SYNC
Synchronous Compression operation.
Definition: api/spec/comp.h:51
@ ODP_COMP_STATUS_OUT_OF_SPACE_TERM
Operation terminated due to insufficient output buffer.
@ ODP_COMP_STATUS_SUCCESS
Operation completed successfully.
@ ODP_COMP_STATUS_FAILURE
Operation failure.
@ ODP_COMP_ALG_NULL
No algorithm specified.
Definition: api/spec/comp.h:92
@ ODP_COMP_ALG_DEFLATE
DEFLATE - RFC1951.
Definition: api/spec/comp.h:95
@ ODP_COMP_ALG_ZLIB
ZLIB - RFC1950.
Definition: api/spec/comp.h:98
@ ODP_COMP_ALG_LZS
LZS.
@ ODP_COMP_OP_COMPRESS
Operation type - Compress.
Definition: api/spec/comp.h:66
@ ODP_COMP_OP_DECOMPRESS
Operation type - Decompress.
Definition: api/spec/comp.h:69
int odp_bool_t
Use odp boolean type to have it well-defined and known size, regardless which compiler is used as thi...
odp_support_t
ODP support.
uint32_t odp_percent_t
Percentage type Use odp_percent_t for specifying fields that are percentages.
Compression algorithm capabilities.
odp_comp_hash_algos_t hash_algo
Supported hash algorithms.
uint32_t max_level
Maximum compression level supported by implementation of this algorithm.
odp_percent_t compression_ratio
Compression ratio Optimal compression operation ratio for this algorithm.
Compression Interface Capabilities.
odp_support_t sync
Synchronous compression mode support (ODP_COMP_OP_MODE_SYNC)
uint32_t max_sessions
Maximum number of sessions.
odp_support_t async
Asynchronous compression mode support (ODP_COMP_OP_MODE_ASYNC)
odp_comp_hash_algos_t hash_algos
Supported hash algorithms.
odp_comp_algos_t comp_algos
Supported compression algorithms.
Compression DEFLATEe algorithm parameters.
odp_comp_huffman_code_t huffman_code
huffman code to use
uint32_t comp_level
Compression level.
Hash algorithm capabilities.
uint32_t digest_len
Digest length in bytes.
Compression per packet operation parameters.
odp_packet_data_range_t in_data_range
Input data range to process.
odp_packet_data_range_t out_data_range
Output packet data range.
odp_comp_session_t session
Session handle.
Compression packet operation result.
odp_packet_t pkt_in
Input packet handle.
odp_packet_data_range_t output_data_range
Output packet data range Specifies offset and length of data resulting from compression operation.
odp_comp_status_t status
Operation status code.
Compression session creation parameters.
odp_comp_alg_param_t alg_param
parameters specific to compression
odp_comp_op_t op
Compression operation type Compress vs Decompress.
odp_comp_op_mode_t mode
Compression operation mode.
odp_queue_t compl_queue
Destination queue for compression operations result.
odp_comp_hash_alg_t hash_algo
Hash algorithm.
odp_comp_alg_t comp_algo
Compression algorithm.
odp_bool_t packet_order
Session packet enqueue ordering Boolean to indicate if packet enqueue ordering is required per sessio...
Packet API data range specifier.
Compression algorithm specific parameters.
odp_comp_deflate_param_t deflate
deflate parameter
struct odp_comp_alg_param_t::@26 zlib
Struct for defining zlib algorithm parameters.
Compression algorithms in a bit field structure.
uint32_t null
ODP_COMP_ALG_NULL.
uint32_t lzs
ODP_COMP_ALG_LZS.
uint32_t zlib
ODP_COMP_ALG_ZLIB.
uint32_t all_bits
All bits of the bit field structure This field can be used to set/clear all flags,...
uint32_t deflate
ODP_COMP_ALG_DEFLATE.
struct odp_comp_algos_t::@25 bit
Compression algorithms.
Hash algorithms in a bit field structure.
uint32_t sha1
ODP_COMP_HASH_ALG_SHA1.
uint32_t sha256
ODP_COMP_HASH_ALG_SHA256.
struct odp_comp_hash_algos_t::@24 bit
hash algorithms
uint32_t all_bits
All bits of the bit field structure.
uint32_t none
ODP_COMP_HASH_ALG_NONE.