Jakub Grajciar | 7c5c40d | 2017-08-30 10:13:25 +0200 | [diff] [blame] | 1 | /* |
| 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 | |
Jakub Grajciar | 3744fc7 | 2018-03-29 13:15:10 +0200 | [diff] [blame^] | 21 | typedef enum |
| 22 | { |
| 23 | ICMPR_FLOW_MODE_ETH = 0, |
| 24 | ICMPR_FLOW_MODE_IP, |
| 25 | } icmpr_flow_mode_t; |
| 26 | |
Jakub Grajciar | 7c5c40d | 2017-08-30 10:13:25 +0200 | [diff] [blame] | 27 | int resolve_packet (void *in_pck, ssize_t in_size, void *out_pck, |
| 28 | uint32_t * out_size, uint8_t ip_addr[4]); |
| 29 | |
Jakub Grajciar | 3744fc7 | 2018-03-29 13:15:10 +0200 | [diff] [blame^] | 30 | /* resolve packet in place */ |
| 31 | int resolve_packet2 (void *pck, uint32_t * size, uint8_t ip_addr[4]); |
| 32 | |
| 33 | /* resolve packet in place and add eth encap */ |
| 34 | int resolve_packet3 (void **pck, uint32_t * size, uint8_t ip_addr[4]); |
| 35 | |
Jakub Grajciar | e4bb5bc | 2017-11-02 14:33:27 +0100 | [diff] [blame] | 36 | int generate_packet (void *pck, uint32_t * size, uint8_t saddr[4], |
| 37 | uint8_t daddr[4], uint8_t hw_daddr[6], uint32_t seq); |
| 38 | |
Jakub Grajciar | 3744fc7 | 2018-03-29 13:15:10 +0200 | [diff] [blame^] | 39 | int generate_packet2 (void *pck, uint32_t * size, uint8_t saddr[4], |
| 40 | uint8_t daddr[4], uint8_t hw_daddr[6], uint32_t seq, |
| 41 | icmpr_flow_mode_t); |
| 42 | |
Jakub Grajciar | 7c5c40d | 2017-08-30 10:13:25 +0200 | [diff] [blame] | 43 | int print_packet (void *pck); |
| 44 | |
| 45 | #endif /* _ICMP_PROTO_H_ */ |