2014-06-25 17:52:36 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* net/icmp/icmp.h
|
|
|
|
*
|
2021-02-19 12:45:37 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2014-06-25 17:52:36 +02:00
|
|
|
*
|
2021-02-19 12:45:37 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2014-06-25 17:52:36 +02:00
|
|
|
*
|
2021-02-19 12:45:37 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2014-06-25 17:52:36 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __NET_ICMP_ICMP_H
|
|
|
|
#define __NET_ICMP_ICMP_H
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
2017-10-23 22:27:31 +02:00
|
|
|
#include <sys/types.h>
|
2017-10-23 16:45:12 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <queue.h>
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
#include <nuttx/mm/iob.h>
|
2014-07-05 03:13:08 +02:00
|
|
|
#include <nuttx/net/ip.h>
|
2017-10-23 16:45:12 +02:00
|
|
|
#include <nuttx/net/netdev.h>
|
2014-07-05 03:13:08 +02:00
|
|
|
|
2018-11-09 18:25:57 +01:00
|
|
|
#if defined(CONFIG_NET_ICMP) && !defined(CONFIG_NET_ICMP_NO_STACK)
|
2014-06-25 17:52:36 +02:00
|
|
|
|
2017-10-23 16:45:12 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
2018-11-09 18:25:57 +01:00
|
|
|
#define NET_ICMP_HAVE_STACK 1
|
|
|
|
|
2017-10-23 16:45:12 +02:00
|
|
|
/* Allocate/free an ICMP data callback */
|
|
|
|
|
2019-03-19 16:43:32 +01:00
|
|
|
#define icmp_callback_alloc(dev, conn) \
|
net/devif/devif_callback.c: corrected the connection event list to work as FIFO instead of LIFO.
In case of enabled packet forwarding mode, packets were forwarded in a reverse order
because of LIFO behavior of the connection event list.
The issue exposed only during high network traffic. Thus the event list started to grow
that resulted in changing the order of packets inside of groups of several packets
like the following: 3, 2, 1, 6, 5, 4, 8, 7 etc.
Remarks concerning the connection event list implementation:
* Now the queue (list) is FIFO as it should be.
* The list is singly linked.
* The list has a head pointer (inside of outer net_driver_s structure),
and a tail pointer is added into outer net_driver_s structure.
* The list item is devif_callback_s structure.
It still has two pointers to two different list chains (*nxtconn and *nxtdev).
* As before the first argument (*dev) of the list functions can be NULL,
while the other argument (*list) is effective (not NULL).
* An extra (*tail) argument is added to devif_callback_alloc()
and devif_conn_callback_free() functions.
* devif_callback_alloc() time complexity is O(1) (i.e. O(n) to fill the whole list).
* devif_callback_free() time complexity is O(n) (i.e. O(n^2) to empty the whole list).
* devif_conn_event() time complexity is O(n).
2021-08-29 22:57:26 +02:00
|
|
|
devif_callback_alloc((dev), &(conn)->list, &(conn)->list_tail)
|
2019-03-19 16:43:32 +01:00
|
|
|
#define icmp_callback_free(dev, conn, cb) \
|
net/devif/devif_callback.c: corrected the connection event list to work as FIFO instead of LIFO.
In case of enabled packet forwarding mode, packets were forwarded in a reverse order
because of LIFO behavior of the connection event list.
The issue exposed only during high network traffic. Thus the event list started to grow
that resulted in changing the order of packets inside of groups of several packets
like the following: 3, 2, 1, 6, 5, 4, 8, 7 etc.
Remarks concerning the connection event list implementation:
* Now the queue (list) is FIFO as it should be.
* The list is singly linked.
* The list has a head pointer (inside of outer net_driver_s structure),
and a tail pointer is added into outer net_driver_s structure.
* The list item is devif_callback_s structure.
It still has two pointers to two different list chains (*nxtconn and *nxtdev).
* As before the first argument (*dev) of the list functions can be NULL,
while the other argument (*list) is effective (not NULL).
* An extra (*tail) argument is added to devif_callback_alloc()
and devif_conn_callback_free() functions.
* devif_callback_alloc() time complexity is O(1) (i.e. O(n) to fill the whole list).
* devif_callback_free() time complexity is O(n) (i.e. O(n^2) to empty the whole list).
* devif_conn_event() time complexity is O(n).
2021-08-29 22:57:26 +02:00
|
|
|
devif_conn_callback_free((dev), (cb), &(conn)->list, &(conn)->list_tail)
|
2017-10-23 16:45:12 +02:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public types
|
|
|
|
****************************************************************************/
|
|
|
|
|
2019-12-31 16:26:14 +01:00
|
|
|
struct socket; /* Forward reference */
|
|
|
|
struct sockaddr; /* Forward reference */
|
|
|
|
struct pollfd; /* Forward reference */
|
|
|
|
|
2017-10-23 16:45:12 +02:00
|
|
|
#ifdef CONFIG_NET_ICMP_SOCKET
|
|
|
|
/* Representation of a IPPROTO_ICMP socket connection */
|
|
|
|
|
2019-03-19 16:43:32 +01:00
|
|
|
struct devif_callback_s; /* Forward reference */
|
2017-10-23 16:45:12 +02:00
|
|
|
|
2019-12-31 16:26:14 +01:00
|
|
|
/* This is a container that holds the poll-related information */
|
|
|
|
|
|
|
|
struct icmp_poll_s
|
|
|
|
{
|
|
|
|
FAR struct socket *psock; /* IPPROTO_ICMP socket structure */
|
|
|
|
FAR struct pollfd *fds; /* Needed to handle poll events */
|
|
|
|
FAR struct devif_callback_s *cb; /* Needed to teardown the poll */
|
|
|
|
};
|
|
|
|
|
2017-10-23 16:45:12 +02:00
|
|
|
struct icmp_conn_s
|
|
|
|
{
|
2019-09-01 16:47:01 +02:00
|
|
|
/* Common prologue of all connection structures. */
|
|
|
|
|
|
|
|
dq_entry_t node; /* Supports a doubly linked list */
|
|
|
|
|
|
|
|
/* This is a list of ICMP callbacks. Each callback represents a thread
|
|
|
|
* that is stalled, waiting for a device-specific event.
|
|
|
|
*/
|
|
|
|
|
|
|
|
FAR struct devif_callback_s *list;
|
net/devif/devif_callback.c: corrected the connection event list to work as FIFO instead of LIFO.
In case of enabled packet forwarding mode, packets were forwarded in a reverse order
because of LIFO behavior of the connection event list.
The issue exposed only during high network traffic. Thus the event list started to grow
that resulted in changing the order of packets inside of groups of several packets
like the following: 3, 2, 1, 6, 5, 4, 8, 7 etc.
Remarks concerning the connection event list implementation:
* Now the queue (list) is FIFO as it should be.
* The list is singly linked.
* The list has a head pointer (inside of outer net_driver_s structure),
and a tail pointer is added into outer net_driver_s structure.
* The list item is devif_callback_s structure.
It still has two pointers to two different list chains (*nxtconn and *nxtdev).
* As before the first argument (*dev) of the list functions can be NULL,
while the other argument (*list) is effective (not NULL).
* An extra (*tail) argument is added to devif_callback_alloc()
and devif_conn_callback_free() functions.
* devif_callback_alloc() time complexity is O(1) (i.e. O(n) to fill the whole list).
* devif_callback_free() time complexity is O(n) (i.e. O(n^2) to empty the whole list).
* devif_conn_event() time complexity is O(n).
2021-08-29 22:57:26 +02:00
|
|
|
FAR struct devif_callback_s *list_tail;
|
2019-09-01 16:47:01 +02:00
|
|
|
|
|
|
|
/* ICMP-specific content follows */
|
|
|
|
|
2019-03-19 16:43:32 +01:00
|
|
|
uint16_t id; /* ICMP ECHO request ID */
|
|
|
|
uint8_t nreqs; /* Number of requests with no response received */
|
|
|
|
uint8_t crefs; /* Reference counts on this instance */
|
2017-10-23 16:45:12 +02:00
|
|
|
|
|
|
|
/* The device that the ICMP request was sent on */
|
|
|
|
|
|
|
|
FAR struct net_driver_s *dev; /* Needed to free the callback structure */
|
|
|
|
|
|
|
|
/* ICMP response read-ahead list. A singly linked list of type struct
|
|
|
|
* iob_qentry_s where the ICMP read-ahead data for the current ID is
|
|
|
|
* retained.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct iob_queue_s readahead; /* Read-ahead buffering */
|
2019-12-31 16:26:14 +01:00
|
|
|
|
|
|
|
/* The following is a list of poll structures of threads waiting for
|
|
|
|
* socket events.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct icmp_poll_s pollinfo[CONFIG_NET_ICMP_NPOLLWAITERS];
|
2017-10-23 16:45:12 +02:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2014-06-25 17:52:36 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
# define EXTERN extern "C"
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#else
|
|
|
|
# define EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
2017-10-23 16:45:12 +02:00
|
|
|
#ifdef CONFIG_NET_ICMP_SOCKET
|
|
|
|
/* PF_INET socket address family, IPPROTO_ICMP protocol interface */
|
|
|
|
|
|
|
|
EXTERN const struct sock_intf_s g_icmp_sockif;
|
|
|
|
#endif
|
|
|
|
|
2014-06-25 17:52:36 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
2017-10-23 16:45:12 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: icmp_input
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Handle incoming ICMP input
|
|
|
|
*
|
2018-03-13 16:52:27 +01:00
|
|
|
* Input Parameters:
|
2017-10-23 16:45:12 +02:00
|
|
|
* dev - The device driver structure containing the received ICMP
|
|
|
|
* packet
|
|
|
|
*
|
2018-02-01 17:00:02 +01:00
|
|
|
* Returned Value:
|
2017-10-23 16:45:12 +02:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Assumptions:
|
|
|
|
* The network is locked.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2014-06-25 17:52:36 +02:00
|
|
|
|
2014-06-28 00:48:12 +02:00
|
|
|
void icmp_input(FAR struct net_driver_s *dev);
|
2014-06-25 17:52:36 +02:00
|
|
|
|
2017-10-23 16:45:12 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: icmp_sock_initialize
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Initialize the IPPROTO_ICMP socket connection structures. Called once
|
|
|
|
* and only from the network initialization layer.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_NET_ICMP_SOCKET
|
|
|
|
void icmp_sock_initialize(void);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: icmp_alloc
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Allocate a new, uninitialized IPPROTO_ICMP socket connection structure.
|
|
|
|
* This is normally something done by the implementation of the socket()
|
|
|
|
* interface.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_NET_ICMP_SOCKET
|
|
|
|
FAR struct icmp_conn_s *icmp_alloc(void);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: icmp_free
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Free a IPPROTO_ICMP socket connection structure that is no longer in
|
|
|
|
* use. This should be done by the implementation of close().
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_NET_ICMP_SOCKET
|
|
|
|
void icmp_free(FAR struct icmp_conn_s *conn);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: icmp_active()
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Find a connection structure that is the appropriate connection to be
|
|
|
|
* used with the provided ECHO request ID.
|
|
|
|
*
|
|
|
|
* Assumptions:
|
|
|
|
* This function is called from network logic at with the network locked.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_NET_ICMP_SOCKET
|
|
|
|
FAR struct icmp_conn_s *icmp_active(uint16_t id);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: icmp_nextconn
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Traverse the list of allocated packet connections
|
|
|
|
*
|
|
|
|
* Assumptions:
|
|
|
|
* This function is called from network logic at with the network locked.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_NET_ICMP_SOCKET
|
|
|
|
FAR struct icmp_conn_s *icmp_nextconn(FAR struct icmp_conn_s *conn);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: icmp_findconn
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Find an ICMP connection structure that is expecting a ICMP ECHO response
|
|
|
|
* with this ID from this device
|
|
|
|
*
|
|
|
|
* Assumptions:
|
|
|
|
* This function is called from network logic at with the network locked.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_NET_ICMP_SOCKET
|
2018-08-26 23:28:02 +02:00
|
|
|
FAR struct icmp_conn_s *icmp_findconn(FAR struct net_driver_s *dev,
|
|
|
|
uint16_t id);
|
2017-10-23 16:45:12 +02:00
|
|
|
#endif
|
2014-06-25 17:52:36 +02:00
|
|
|
|
2017-10-23 16:45:12 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: icmp_poll
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Poll a device "connection" structure for availability of ICMP TX data
|
|
|
|
*
|
2018-03-13 16:52:27 +01:00
|
|
|
* Input Parameters:
|
2019-03-19 16:43:32 +01:00
|
|
|
* dev - The device driver structure to use in the send operation
|
|
|
|
* conn - A pointer to the ICMP connection structure
|
2017-10-23 16:45:12 +02:00
|
|
|
*
|
2018-02-01 17:00:02 +01:00
|
|
|
* Returned Value:
|
2017-10-23 16:45:12 +02:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Assumptions:
|
|
|
|
* The network is locked.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_NET_ICMP_SOCKET
|
2019-03-19 16:43:32 +01:00
|
|
|
void icmp_poll(FAR struct net_driver_s *dev, FAR struct icmp_conn_s *conn);
|
2017-10-23 16:45:12 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
2020-12-01 07:55:16 +01:00
|
|
|
* Name: icmp_sendmsg
|
2017-10-23 16:45:12 +02:00
|
|
|
*
|
|
|
|
* Description:
|
2020-12-01 07:55:16 +01:00
|
|
|
* Implements the sendmsg() operation for the case of the IPPROTO_ICMP
|
2017-10-23 22:27:31 +02:00
|
|
|
* socket. The 'buf' parameter points to a block of memory that includes
|
|
|
|
* an ICMP request header, followed by any payload that accompanies the
|
|
|
|
* request. The 'len' parameter includes both the size of the ICMP header
|
|
|
|
* and the following payload.
|
2017-10-23 16:45:12 +02:00
|
|
|
*
|
2017-10-23 22:27:31 +02:00
|
|
|
* Input Parameters:
|
2017-10-23 16:45:12 +02:00
|
|
|
* psock A pointer to a NuttX-specific, internal socket structure
|
2020-12-01 07:55:16 +01:00
|
|
|
* msg Message to send
|
2017-10-23 16:45:12 +02:00
|
|
|
* flags Send flags
|
|
|
|
*
|
|
|
|
* Returned Value:
|
2020-12-01 07:55:16 +01:00
|
|
|
* On success, returns the number of characters sent. On error, a negated
|
|
|
|
* errno value is returned (see sendmsg() for the list of appropriate error
|
2017-10-23 16:45:12 +02:00
|
|
|
* values.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_NET_ICMP_SOCKET
|
2020-12-01 07:55:16 +01:00
|
|
|
ssize_t icmp_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
|
|
|
|
int flags);
|
2017-10-23 16:45:12 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
2020-12-01 07:55:16 +01:00
|
|
|
* Name: icmp_recvmsg
|
2017-10-23 16:45:12 +02:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Implements the socket recvfrom interface for the case of the AF_INET
|
2020-12-01 07:55:16 +01:00
|
|
|
* data gram socket with the IPPROTO_ICMP protocol. icmp_recvmsg()
|
2017-10-23 22:27:31 +02:00
|
|
|
* receives ICMP ECHO replies for the a socket.
|
2017-10-23 16:45:12 +02:00
|
|
|
*
|
2020-12-01 07:55:16 +01:00
|
|
|
* If msg_name is not NULL, and the underlying protocol provides the source
|
|
|
|
* address, this source address is filled in. The argument 'msg_namelen' is
|
|
|
|
* initialized to the size of the buffer associated with msg_name, and
|
2017-10-23 16:45:12 +02:00
|
|
|
* modified on return to indicate the actual size of the address stored
|
|
|
|
* there.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* psock A pointer to a NuttX-specific, internal socket structure
|
2020-12-01 07:55:16 +01:00
|
|
|
* msg Buffer to receive the message
|
2017-10-23 16:45:12 +02:00
|
|
|
* flags Receive flags
|
|
|
|
*
|
|
|
|
* Returned Value:
|
2020-12-01 07:55:16 +01:00
|
|
|
* On success, returns the number of characters received. If no data is
|
2017-10-23 16:45:12 +02:00
|
|
|
* available to be received and the peer has performed an orderly shutdown,
|
2020-12-01 07:55:16 +01:00
|
|
|
* recvmsg() will return 0. Otherwise, on errors, a negated errno value is
|
|
|
|
* returned (see recvmsg() for the list of appropriate error values).
|
2017-10-23 16:45:12 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_NET_ICMP_SOCKET
|
2020-12-01 07:55:16 +01:00
|
|
|
ssize_t icmp_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
|
|
|
|
int flags);
|
2017-10-23 16:45:12 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: icmp_pollsetup
|
|
|
|
*
|
|
|
|
* Description:
|
2017-10-24 19:23:08 +02:00
|
|
|
* Setup to monitor events on one ICMP socket
|
2017-10-23 16:45:12 +02:00
|
|
|
*
|
|
|
|
* Input Parameters:
|
2017-10-24 19:23:08 +02:00
|
|
|
* psock - The IPPROTO_ICMP socket of interest
|
2017-10-23 16:45:12 +02:00
|
|
|
* fds - The structure describing the events to be monitored, OR NULL if
|
|
|
|
* this is a request to stop monitoring events.
|
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* 0: Success; Negated errno on failure
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2014-06-25 17:52:36 +02:00
|
|
|
|
2017-10-23 16:45:12 +02:00
|
|
|
#ifdef CONFIG_NET_ICMP_SOCKET
|
|
|
|
int icmp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds);
|
|
|
|
#endif
|
2014-06-25 17:52:36 +02:00
|
|
|
|
2017-10-23 16:45:12 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: icmp_pollteardown
|
|
|
|
*
|
|
|
|
* Description:
|
2017-10-24 19:23:08 +02:00
|
|
|
* Teardown monitoring of events on an ICMP socket
|
2017-10-23 16:45:12 +02:00
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* psock - The IPPROTO_ICMP socket of interest
|
|
|
|
* fds - The structure describing the events to be monitored, OR NULL if
|
|
|
|
* this is a request to stop monitoring events.
|
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* 0: Success; Negated errno on failure
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_NET_ICMP_SOCKET
|
|
|
|
int icmp_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds);
|
|
|
|
#endif
|
2014-06-25 17:52:36 +02:00
|
|
|
|
2021-11-25 15:03:33 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: icmp_reply
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Send an ICMP message in response to a situation
|
|
|
|
* RFC 1122: 3.2.2 MUST send at least the IP header and 8 bytes of header.
|
|
|
|
* MAY send more (we do).
|
|
|
|
* MUST NOT change this header information.
|
|
|
|
* MUST NOT reply to a multicast/broadcast IP address.
|
|
|
|
* MUST NOT reply to a multicast/broadcast MAC address.
|
|
|
|
* MUST reply to only the first fragment.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* dev - The device driver structure containing the received packet
|
|
|
|
* type - ICMP Message Type, eg. ICMP_DEST_UNREACHABLE
|
|
|
|
* code - ICMP Message Code, eg. ICMP_PORT_UNREACH
|
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
void icmp_reply(FAR struct net_driver_s *dev, int type, int code);
|
|
|
|
|
2014-06-25 17:52:36 +02:00
|
|
|
#undef EXTERN
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-11-09 18:25:57 +01:00
|
|
|
#endif /* CONFIG_NET_ICMP && !CONFIG_NET_ICMP_NO_STACK */
|
2014-06-25 17:52:36 +02:00
|
|
|
#endif /* __NET_ICMP_ICMP_H */
|