| Daniel Drown | a45056e | 2012-03-23 10:42:54 -0500 | [diff] [blame] | 1 | /* | 
 | 2 |  * Copyright 2011 Daniel Drown | 
 | 3 |  * | 
 | 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 |  * dump.h - debug functions | 
 | 17 |  */ | 
 | 18 | #ifndef __DUMP_H__ | 
 | 19 | #define __DUMP_H__ | 
 | 20 |  | 
| junyulai | c4e591a | 2018-11-26 22:36:10 +0900 | [diff] [blame] | 21 | #include <netinet/icmp6.h> | 
 | 22 | #include <netinet/in.h> | 
 | 23 | #include <netinet/ip.h> | 
 | 24 | #include <netinet/ip6.h> | 
 | 25 | #include <netinet/ip_icmp.h> | 
 | 26 | #include <netinet/tcp.h> | 
 | 27 | #include <netinet/udp.h> | 
 | 28 |  | 
| Daniel Drown | a45056e | 2012-03-23 10:42:54 -0500 | [diff] [blame] | 29 | void dump_ip(struct iphdr *header); | 
 | 30 | void dump_icmp(struct icmphdr *icmp); | 
| junyulai | c4e591a | 2018-11-26 22:36:10 +0900 | [diff] [blame] | 31 | void dump_udp(const struct udphdr *udp, const struct iphdr *ip, const uint8_t *payload, | 
 | 32 |               size_t payload_size); | 
 | 33 | void dump_tcp(const struct tcphdr *tcp, const struct iphdr *ip, const uint8_t *payload, | 
| Rocco Yue | df33869 | 2020-10-19 19:59:38 +0800 | [diff] [blame] | 34 |               size_t payload_size, const uint8_t *options, size_t options_size); | 
| Daniel Drown | a45056e | 2012-03-23 10:42:54 -0500 | [diff] [blame] | 35 |  | 
 | 36 | void dump_ip6(struct ip6_hdr *header); | 
 | 37 | void dump_icmp6(struct icmp6_hdr *icmp6); | 
| junyulai | c4e591a | 2018-11-26 22:36:10 +0900 | [diff] [blame] | 38 | void dump_udp6(const struct udphdr *udp, const struct ip6_hdr *ip6, const uint8_t *payload, | 
 | 39 |                size_t payload_size); | 
 | 40 | void dump_tcp6(const struct tcphdr *tcp, const struct ip6_hdr *ip6, const uint8_t *payload, | 
| Rocco Yue | df33869 | 2020-10-19 19:59:38 +0800 | [diff] [blame] | 41 |                size_t payload_size, const uint8_t *options, size_t options_size); | 
| Daniel Drown | a45056e | 2012-03-23 10:42:54 -0500 | [diff] [blame] | 42 |  | 
| Brian Carlstrom | fcac410 | 2014-02-24 20:03:01 -0800 | [diff] [blame] | 43 | void logcat_hexdump(const char *info, const uint8_t *data, size_t len); | 
| Lorenzo Colitti | f913fe4 | 2013-04-08 18:30:55 +0900 | [diff] [blame] | 44 | void dump_iovec(const struct iovec *iov, int iov_len); | 
| Daniel Drown | a45056e | 2012-03-23 10:42:54 -0500 | [diff] [blame] | 45 |  | 
 | 46 | #endif /* __DUMP_H__ */ |