blob: 1371146cd40b9ea63453f090208fda5e481fa755 [file] [log] [blame]
Jakub Grajciare74c04f2021-01-04 11:28:33 +01001/*
2 *------------------------------------------------------------------
3 * Copyright (c) 2017 Cisco and/or its affiliates.
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:
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 *------------------------------------------------------------------
16 */
17
18#ifndef _ICMP_PROTO_H_
19#define _ICMP_PROTO_H_
20
21typedef enum
22{
23 ICMPR_FLOW_MODE_ETH = 0,
24 ICMPR_FLOW_MODE_IP,
25} icmpr_flow_mode_t;
26
Mohsin Kazmi8636a322022-07-18 11:21:05 +000027/* resolve packet in place */
28int resolve_packet (void *pck, uint32_t *size, uint8_t ip_addr[4],
Jakub Grajciare74c04f2021-01-04 11:28:33 +010029 uint8_t hw_addr[6]);
30
Jakub Grajciare74c04f2021-01-04 11:28:33 +010031/* resolve packet in place and add eth encap */
Mohsin Kazmi8636a322022-07-18 11:21:05 +000032int resolve_packet_with_encap (void **pck, uint32_t *size, uint8_t ip_addr[4]);
Jakub Grajciare74c04f2021-01-04 11:28:33 +010033
34int generate_packet (void *pck, uint32_t *size, uint8_t saddr[4],
35 uint8_t daddr[4], uint8_t hw_daddr[6], uint32_t seq);
36
37int generate_packet2 (void *pck, uint32_t *size, uint8_t saddr[4],
38 uint8_t daddr[4], uint8_t hw_daddr[6], uint32_t seq,
39 icmpr_flow_mode_t);
40
41int print_packet (void *pck);
42
43#endif /* _ICMP_PROTO_H_ */