2 // Copyright (c) 2010-2017 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 #ifndef _HANDLE_GEN_H_
18 #define _HANDLE_GEN_H_
23 } __attribute__((packed));
25 static void unique_id_init(struct unique_id *unique_id, uint8_t generator_id, uint32_t packet_id)
27 unique_id->generator_id = generator_id;
28 unique_id->packet_id = packet_id;
31 static void unique_id_get(struct unique_id *unique_id, uint8_t *generator_id, uint32_t *packet_id)
33 *generator_id = unique_id->generator_id;
34 *packet_id = unique_id->packet_id;
39 void task_gen_set_pkt_count(struct task_base *tbase, uint32_t count);
40 int task_gen_set_pkt_size(struct task_base *tbase, uint32_t pkt_size);
41 void task_gen_set_rate(struct task_base *tbase, uint64_t bps);
42 void task_gen_reset_randoms(struct task_base *tbase);
43 void task_gen_reset_values(struct task_base *tbase);
44 int task_gen_set_value(struct task_base *tbase, uint32_t value, uint32_t offset, uint32_t len);
45 int task_gen_add_rand(struct task_base *tbase, const char *rand_str, uint32_t offset, uint32_t rand_id);
47 uint32_t task_gen_get_n_randoms(struct task_base *tbase);
48 uint32_t task_gen_get_n_values(struct task_base *tbase);
50 #endif /* _HANDLE_GEN_H_ */