Free (GPLv2) TCP/IP stack developed by TASS Belgium
Dependents: lpc1768-picotcp-demo ZeroMQ_PicoTCP_Publisher_demo TCPSocket_HelloWorld_PicoTCP Pico_TCP_UDP_Test ... more
PicoTCP. Copyright (c) 2013 TASS Belgium NV.
Released under the GNU General Public License, version 2.
Different licensing models may exist, at the sole discretion of the Copyright holders.
Official homepage: http://www.picotcp.com
Bug tracker: https://github.com/tass-belgium/picotcp/issues
Development steps:
initial integration with mbed RTOSgeneric mbed Ethernet driverhigh performance NXP LPC1768 specific Ethernet driverMulti-threading support for mbed RTOSBerkeley sockets and integration with the New Socket APIFork of the apps running on top of the New Socket APIScheduling optimizations- Debugging/benchmarking/testing
Demo application (measuring TCP sender performance):
Import programlpc1768-picotcp-demo
A PicoTCP demo app testing the ethernet throughput on the lpc1768 mbed board.
modules/pico_icmp6.h@155:a70f34550c34, 2016-01-28 (annotated)
- Committer:
- tass
- Date:
- Thu Jan 28 15:12:00 2016 +0100
- Revision:
- 155:a70f34550c34
- Parent:
- 154:6c0e92a80c4a
Adding TCP flag for FIN.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tass picotcp@tass.be | 149:5f4cb161cec3 | 1 | /********************************************************************* |
tass | 152:a3d286bf94e5 | 2 | PicoTCP. Copyright (c) 2012-2015 Altran Intelligent Systems. Some rights reserved. |
tass picotcp@tass.be | 149:5f4cb161cec3 | 3 | See LICENSE and COPYING for usage. |
tass picotcp@tass.be | 149:5f4cb161cec3 | 4 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 5 | . |
tass picotcp@tass.be | 149:5f4cb161cec3 | 6 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 7 | *********************************************************************/ |
tass picotcp@tass.be | 149:5f4cb161cec3 | 8 | #ifndef _INCLUDE_PICO_ICMP6 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 9 | #define _INCLUDE_PICO_ICMP6 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 10 | #include "pico_addressing.h" |
tass picotcp@tass.be | 149:5f4cb161cec3 | 11 | #include "pico_protocol.h" |
tass | 152:a3d286bf94e5 | 12 | #include "pico_mld.h" |
tass picotcp@tass.be | 149:5f4cb161cec3 | 13 | /* ICMP header sizes */ |
tass picotcp@tass.be | 149:5f4cb161cec3 | 14 | #define PICO_ICMP6HDR_DRY_SIZE 4 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 15 | #define PICO_ICMP6HDR_ECHO_REQUEST_SIZE 8 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 16 | #define PICO_ICMP6HDR_DEST_UNREACH_SIZE 8 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 17 | #define PICO_ICMP6HDR_TIME_XCEEDED_SIZE 8 |
tass | 152:a3d286bf94e5 | 18 | #define PICO_ICMP6HDR_PARAM_PROBLEM_SIZE 8 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 19 | #define PICO_ICMP6HDR_NEIGH_SOL_SIZE 24 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 20 | #define PICO_ICMP6HDR_NEIGH_ADV_SIZE 24 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 21 | #define PICO_ICMP6HDR_ROUTER_SOL_SIZE 8 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 22 | #define PICO_ICMP6HDR_ROUTER_ADV_SIZE 16 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 23 | #define PICO_ICMP6HDR_REDIRECT_SIZE 40 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 24 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 25 | /* ICMP types */ |
tass picotcp@tass.be | 149:5f4cb161cec3 | 26 | #define PICO_ICMP6_DEST_UNREACH 1 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 27 | #define PICO_ICMP6_PKT_TOO_BIG 2 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 28 | #define PICO_ICMP6_TIME_EXCEEDED 3 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 29 | #define PICO_ICMP6_PARAM_PROBLEM 4 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 30 | #define PICO_ICMP6_ECHO_REQUEST 128 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 31 | #define PICO_ICMP6_ECHO_REPLY 129 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 32 | #define PICO_ICMP6_ROUTER_SOL 133 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 33 | #define PICO_ICMP6_ROUTER_ADV 134 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 34 | #define PICO_ICMP6_NEIGH_SOL 135 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 35 | #define PICO_ICMP6_NEIGH_ADV 136 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 36 | #define PICO_ICMP6_REDIRECT 137 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 37 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 38 | /* destination unreachable codes */ |
tass picotcp@tass.be | 149:5f4cb161cec3 | 39 | #define PICO_ICMP6_UNREACH_NOROUTE 0 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 40 | #define PICO_ICMP6_UNREACH_ADMIN 1 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 41 | #define PICO_ICMP6_UNREACH_SRCSCOPE 2 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 42 | #define PICO_ICMP6_UNREACH_ADDR 3 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 43 | #define PICO_ICMP6_UNREACH_PORT 4 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 44 | #define PICO_ICMP6_UNREACH_SRCFILTER 5 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 45 | #define PICO_ICMP6_UNREACH_REJROUTE 6 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 46 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 47 | /* time exceeded codes */ |
tass picotcp@tass.be | 149:5f4cb161cec3 | 48 | #define PICO_ICMP6_TIMXCEED_INTRANS 0 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 49 | #define PICO_ICMP6_TIMXCEED_REASS 1 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 50 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 51 | /* parameter problem codes */ |
tass picotcp@tass.be | 149:5f4cb161cec3 | 52 | #define PICO_ICMP6_PARAMPROB_HDRFIELD 0 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 53 | #define PICO_ICMP6_PARAMPROB_NXTHDR 1 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 54 | #define PICO_ICMP6_PARAMPROB_IPV6OPT 2 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 55 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 56 | /* ping error codes */ |
tass picotcp@tass.be | 149:5f4cb161cec3 | 57 | #define PICO_PING6_ERR_REPLIED 0 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 58 | #define PICO_PING6_ERR_TIMEOUT 1 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 59 | #define PICO_PING6_ERR_UNREACH 2 |
tass | 152:a3d286bf94e5 | 60 | #define PICO_PING6_ERR_ABORTED 3 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 61 | #define PICO_PING6_ERR_PENDING 0xFFFF |
tass picotcp@tass.be | 149:5f4cb161cec3 | 62 | |
tass | 152:a3d286bf94e5 | 63 | /* ND configuration */ |
tass | 152:a3d286bf94e5 | 64 | #define PICO_ND_MAX_FRAMES_QUEUED 4 /* max frames queued while awaiting address resolution */ |
tass | 152:a3d286bf94e5 | 65 | |
tass | 152:a3d286bf94e5 | 66 | /* ND RFC constants */ |
tass | 152:a3d286bf94e5 | 67 | #define PICO_ND_MAX_SOLICIT 3 |
tass | 152:a3d286bf94e5 | 68 | #define PICO_ND_MAX_NEIGHBOR_ADVERT 3 |
tass | 152:a3d286bf94e5 | 69 | #define PICO_ND_DELAY_INCOMPLETE 1000 /* msec */ |
tass | 152:a3d286bf94e5 | 70 | #define PICO_ND_DELAY_FIRST_PROBE_TIME 5000 /* msec */ |
tass | 152:a3d286bf94e5 | 71 | |
tass | 152:a3d286bf94e5 | 72 | /* neighbor discovery options */ |
tass | 152:a3d286bf94e5 | 73 | #define PICO_ND_OPT_LLADDR_SRC 1 |
tass | 152:a3d286bf94e5 | 74 | #define PICO_ND_OPT_LLADDR_TGT 2 |
tass | 152:a3d286bf94e5 | 75 | #define PICO_ND_OPT_PREFIX 3 |
tass | 152:a3d286bf94e5 | 76 | #define PICO_ND_OPT_REDIRECT 4 |
tass | 152:a3d286bf94e5 | 77 | #define PICO_ND_OPT_MTU 5 |
tass | 152:a3d286bf94e5 | 78 | #define PICO_ND_OPT_RDNSS 25 /* RFC 5006 */ |
tass | 152:a3d286bf94e5 | 79 | |
tass | 152:a3d286bf94e5 | 80 | /* ND advertisement flags */ |
tass | 152:a3d286bf94e5 | 81 | #define PICO_ND_ROUTER 0x80000000 |
tass | 152:a3d286bf94e5 | 82 | #define PICO_ND_SOLICITED 0x40000000 |
tass | 152:a3d286bf94e5 | 83 | #define PICO_ND_OVERRIDE 0x20000000 |
tass | 152:a3d286bf94e5 | 84 | #define IS_ROUTER(x) (long_be(x->msg.info.neigh_adv.rsor) & (PICO_ND_ROUTER)) /* router flag set? */ |
tass | 152:a3d286bf94e5 | 85 | #define IS_SOLICITED(x) (long_be(x->msg.info.neigh_adv.rsor) & (PICO_ND_SOLICITED)) /* solicited flag set? */ |
tass | 152:a3d286bf94e5 | 86 | #define IS_OVERRIDE(x) (long_be(x->msg.info.neigh_adv.rsor) & (PICO_ND_OVERRIDE)) /* override flag set? */ |
tass | 152:a3d286bf94e5 | 87 | |
tass | 152:a3d286bf94e5 | 88 | #define PICO_ND_PREFIX_LIFETIME_INF 0xFFFFFFFFu |
tass | 152:a3d286bf94e5 | 89 | /* #define PICO_ND_DESTINATION_LRU_TIME 600000u / * msecs (10min) * / */ |
tass | 152:a3d286bf94e5 | 90 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 91 | /* custom defines */ |
tass picotcp@tass.be | 149:5f4cb161cec3 | 92 | #define PICO_ICMP6_ND_UNICAST 0 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 93 | #define PICO_ICMP6_ND_ANYCAST 1 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 94 | #define PICO_ICMP6_ND_SOLICITED 2 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 95 | #define PICO_ICMP6_ND_DAD 3 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 96 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 97 | #define PICO_ICMP6_MAX_RTR_SOL_DELAY 1000 |
tass picotcp@tass.be | 149:5f4cb161cec3 | 98 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 99 | #define PICO_SIZE_ICMP6HDR ((sizeof(struct pico_icmp6_hdr))) |
tass | 152:a3d286bf94e5 | 100 | #define PICO_ICMP6_OPT_LLADDR_SIZE (8) |
tass picotcp@tass.be | 149:5f4cb161cec3 | 101 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 102 | extern struct pico_protocol pico_proto_icmp6; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 103 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 104 | PACKED_STRUCT_DEF pico_icmp6_hdr { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 105 | uint8_t type; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 106 | uint8_t code; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 107 | uint16_t crc; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 108 | |
tass | 152:a3d286bf94e5 | 109 | PACKED_UNION_DEF icmp6_msg_u { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 110 | /* error messages */ |
tass | 152:a3d286bf94e5 | 111 | PACKED_UNION_DEF icmp6_err_u { |
tass | 152:a3d286bf94e5 | 112 | PEDANTIC_STRUCT_DEF dest_unreach_s { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 113 | uint32_t unused; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 114 | } dest_unreach; |
tass | 152:a3d286bf94e5 | 115 | PEDANTIC_STRUCT_DEF pkt_too_big_s { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 116 | uint32_t mtu; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 117 | } pkt_too_big; |
tass | 152:a3d286bf94e5 | 118 | PEDANTIC_STRUCT_DEF time_exceeded_s { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 119 | uint32_t unused; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 120 | } time_exceeded; |
tass | 152:a3d286bf94e5 | 121 | PEDANTIC_STRUCT_DEF param_problem_s { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 122 | uint32_t ptr; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 123 | } param_problem; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 124 | } err; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 125 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 126 | /* informational messages */ |
tass | 152:a3d286bf94e5 | 127 | PACKED_UNION_DEF icmp6_info_u { |
tass | 152:a3d286bf94e5 | 128 | PEDANTIC_STRUCT_DEF echo_request_s { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 129 | uint16_t id; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 130 | uint16_t seq; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 131 | } echo_request; |
tass | 152:a3d286bf94e5 | 132 | PEDANTIC_STRUCT_DEF echo_reply_s { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 133 | uint16_t id; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 134 | uint16_t seq; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 135 | } echo_reply; |
tass | 152:a3d286bf94e5 | 136 | PEDANTIC_STRUCT_DEF router_sol_s { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 137 | uint32_t unused; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 138 | } router_sol; |
tass | 152:a3d286bf94e5 | 139 | PEDANTIC_STRUCT_DEF router_adv_s { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 140 | uint8_t hop; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 141 | uint8_t mor; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 142 | uint16_t life_time; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 143 | uint32_t reachable_time; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 144 | uint32_t retrans_time; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 145 | } router_adv; |
tass | 152:a3d286bf94e5 | 146 | PEDANTIC_STRUCT_DEF neigh_sol_s { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 147 | uint32_t unused; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 148 | struct pico_ip6 target; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 149 | } neigh_sol; |
tass | 152:a3d286bf94e5 | 150 | PEDANTIC_STRUCT_DEF neigh_adv_s { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 151 | uint32_t rsor; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 152 | struct pico_ip6 target; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 153 | } neigh_adv; |
tass | 152:a3d286bf94e5 | 154 | PEDANTIC_STRUCT_DEF redirect_s { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 155 | uint32_t reserved; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 156 | struct pico_ip6 target; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 157 | struct pico_ip6 dest; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 158 | } redirect; |
tass | 152:a3d286bf94e5 | 159 | PEDANTIC_STRUCT_DEF mld_s { |
tass | 152:a3d286bf94e5 | 160 | uint16_t max_resp_time; |
tass | 152:a3d286bf94e5 | 161 | uint16_t reserved; |
tass | 152:a3d286bf94e5 | 162 | struct pico_ip6 mmcast_group; |
tass | 152:a3d286bf94e5 | 163 | /*MLDv2*/ |
tass | 152:a3d286bf94e5 | 164 | uint8_t reserverd; // With S and QRV |
tass | 152:a3d286bf94e5 | 165 | uint8_t QQIC; |
tass | 152:a3d286bf94e5 | 166 | uint16_t nbr_src; |
tass | 152:a3d286bf94e5 | 167 | struct pico_ip6 src[0]; |
tass | 152:a3d286bf94e5 | 168 | } mld; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 169 | } info; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 170 | } msg; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 171 | }; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 172 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 173 | PACKED_STRUCT_DEF pico_icmp6_opt_lladdr |
tass picotcp@tass.be | 149:5f4cb161cec3 | 174 | { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 175 | uint8_t type; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 176 | uint8_t len; |
tass | 152:a3d286bf94e5 | 177 | PACKED_UNION_DEF icmp6_opt_hw_addr_u { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 178 | struct pico_eth mac; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 179 | } addr; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 180 | }; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 181 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 182 | PACKED_STRUCT_DEF pico_icmp6_opt_prefix |
tass picotcp@tass.be | 149:5f4cb161cec3 | 183 | { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 184 | uint8_t type; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 185 | uint8_t len; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 186 | uint8_t prefix_len; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 187 | uint8_t res : 6; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 188 | uint8_t aac : 1; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 189 | uint8_t onlink : 1; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 190 | uint32_t val_lifetime; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 191 | uint32_t pref_lifetime; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 192 | uint32_t reserved; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 193 | struct pico_ip6 prefix; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 194 | }; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 195 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 196 | PACKED_STRUCT_DEF pico_icmp6_opt_mtu |
tass picotcp@tass.be | 149:5f4cb161cec3 | 197 | { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 198 | uint8_t type; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 199 | uint8_t len; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 200 | uint16_t res; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 201 | uint32_t mtu; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 202 | }; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 203 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 204 | PACKED_STRUCT_DEF pico_icmp6_opt_redirect |
tass picotcp@tass.be | 149:5f4cb161cec3 | 205 | { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 206 | uint8_t type; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 207 | uint8_t len; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 208 | uint16_t res0; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 209 | uint32_t res1; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 210 | }; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 211 | |
tass | 152:a3d286bf94e5 | 212 | PACKED_STRUCT_DEF pico_icmp6_opt_rdnss |
tass | 152:a3d286bf94e5 | 213 | { |
tass | 152:a3d286bf94e5 | 214 | uint8_t type; |
tass | 152:a3d286bf94e5 | 215 | uint8_t len; |
tass | 152:a3d286bf94e5 | 216 | uint16_t res0; |
tass | 152:a3d286bf94e5 | 217 | uint32_t lifetime; |
tass | 154:6c0e92a80c4a | 218 | struct pico_ip6 *addr; |
tass | 152:a3d286bf94e5 | 219 | }; |
tass | 152:a3d286bf94e5 | 220 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 221 | PACKED_STRUCT_DEF pico_icmp6_opt_na |
tass picotcp@tass.be | 149:5f4cb161cec3 | 222 | { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 223 | uint8_t type; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 224 | uint8_t len; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 225 | }; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 226 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 227 | struct pico_icmp6_stats |
tass picotcp@tass.be | 149:5f4cb161cec3 | 228 | { |
tass picotcp@tass.be | 149:5f4cb161cec3 | 229 | unsigned long size; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 230 | unsigned long seq; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 231 | pico_time time; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 232 | unsigned long ttl; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 233 | int err; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 234 | struct pico_ip6 dst; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 235 | }; |
tass picotcp@tass.be | 149:5f4cb161cec3 | 236 | |
tass | 152:a3d286bf94e5 | 237 | int pico_icmp6_ping(char *dst, int count, int interval, int timeout, int size, void (*cb)(struct pico_icmp6_stats *), struct pico_device *dev); |
tass | 152:a3d286bf94e5 | 238 | int pico_icmp6_ping_abort(int id); |
tass picotcp@tass.be | 149:5f4cb161cec3 | 239 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 240 | int pico_icmp6_neighbor_solicitation(struct pico_device *dev, struct pico_ip6 *dst, uint8_t type); |
tass picotcp@tass.be | 149:5f4cb161cec3 | 241 | int pico_icmp6_neighbor_advertisement(struct pico_frame *f, struct pico_ip6 *target); |
tass picotcp@tass.be | 149:5f4cb161cec3 | 242 | int pico_icmp6_router_solicitation(struct pico_device *dev, struct pico_ip6 *src); |
tass picotcp@tass.be | 149:5f4cb161cec3 | 243 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 244 | int pico_icmp6_port_unreachable(struct pico_frame *f); |
tass picotcp@tass.be | 149:5f4cb161cec3 | 245 | int pico_icmp6_proto_unreachable(struct pico_frame *f); |
tass picotcp@tass.be | 149:5f4cb161cec3 | 246 | int pico_icmp6_dest_unreachable(struct pico_frame *f); |
tass picotcp@tass.be | 149:5f4cb161cec3 | 247 | int pico_icmp6_ttl_expired(struct pico_frame *f); |
tass picotcp@tass.be | 149:5f4cb161cec3 | 248 | int pico_icmp6_packet_filtered(struct pico_frame *f); |
tass | 152:a3d286bf94e5 | 249 | int pico_icmp6_parameter_problem(struct pico_frame *f, uint8_t problem, uint32_t ptr); |
tass | 152:a3d286bf94e5 | 250 | int pico_icmp6_pkt_too_big(struct pico_frame *f); |
tass | 152:a3d286bf94e5 | 251 | int pico_icmp6_frag_expired(struct pico_frame *f); |
tass picotcp@tass.be | 149:5f4cb161cec3 | 252 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 253 | uint16_t pico_icmp6_checksum(struct pico_frame *f); |
tass | 152:a3d286bf94e5 | 254 | int pico_icmp6_router_advertisement(struct pico_device *dev, struct pico_ip6 *dst); |
tass picotcp@tass.be | 149:5f4cb161cec3 | 255 | |
tass picotcp@tass.be | 149:5f4cb161cec3 | 256 | #endif |