mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 06:39:01 +08:00
NET: Rename uip_callback_s to devif_callback_s
This commit is contained in:
@@ -109,7 +109,7 @@ struct socket
|
||||
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
|
||||
/* Callback instance for TCP send */
|
||||
|
||||
FAR struct uip_callback_s *s_sndcb;
|
||||
FAR struct devif_callback_s *s_sndcb;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ struct pkt_conn_s
|
||||
|
||||
/* Defines the list of packet callbacks */
|
||||
|
||||
struct uip_callback_s *list;
|
||||
struct devif_callback_s *list;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
*/
|
||||
|
||||
struct net_driver_s; /* Forward reference */
|
||||
struct uip_callback_s; /* Forward reference */
|
||||
struct devif_callback_s; /* Forward reference */
|
||||
struct tcp_backlog_s; /* Forward reference */
|
||||
|
||||
struct tcp_conn_s
|
||||
@@ -239,7 +239,7 @@ struct tcp_conn_s
|
||||
*
|
||||
* Data transfer events are retained in 'list'. Event handlers in 'list'
|
||||
* are called for events specified in the flags set within struct
|
||||
* uip_callback_s
|
||||
* devif_callback_s
|
||||
*
|
||||
* When an callback is executed from 'list', the input flags are normally
|
||||
* returned, however, the implementation may set one of the following:
|
||||
@@ -259,7 +259,7 @@ struct tcp_conn_s
|
||||
* dev->d_len should also be cleared).
|
||||
*/
|
||||
|
||||
FAR struct uip_callback_s *list;
|
||||
FAR struct devif_callback_s *list;
|
||||
|
||||
/* accept() is called when the TCP logic has created a connection */
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
/* Representation of a uIP UDP connection */
|
||||
|
||||
struct net_driver_s; /* Forward reference */
|
||||
struct uip_callback_s; /* Forward reference */
|
||||
struct devif_callback_s; /* Forward reference */
|
||||
struct udp_conn_s
|
||||
{
|
||||
dq_entry_t node; /* Supports a doubly linked list */
|
||||
@@ -82,7 +82,7 @@ struct udp_conn_s
|
||||
|
||||
/* Defines the list of UDP callbacks */
|
||||
|
||||
struct uip_callback_s *list;
|
||||
struct devif_callback_s *list;
|
||||
};
|
||||
|
||||
/* The UDP and IP headers */
|
||||
|
||||
@@ -218,11 +218,12 @@ struct net_iphdr_s
|
||||
*/
|
||||
|
||||
struct net_driver_s; /* Forward reference */
|
||||
struct uip_callback_s
|
||||
struct devif_callback_s
|
||||
{
|
||||
FAR struct uip_callback_s *flink;
|
||||
uint16_t (*event)(struct net_driver_s *dev, void *pvconn, void *pvpriv, uint16_t flags);
|
||||
void *priv;
|
||||
FAR struct devif_callback_s *flink;
|
||||
uint16_t (*event)(FAR struct net_driver_s *dev, FAR void *pvconn,
|
||||
FAR void *pvpriv, uint16_t flags);
|
||||
FAR void *priv;
|
||||
uint16_t flags;
|
||||
};
|
||||
|
||||
|
||||
+5
-5
@@ -82,7 +82,7 @@ extern uint8_t g_reassembly_timer;
|
||||
/* List of applications waiting for ICMP ECHO REPLY */
|
||||
|
||||
#if defined(CONFIG_NET_ICMP) && defined(CONFIG_NET_ICMP_PING)
|
||||
extern struct uip_callback_s *g_echocallback;
|
||||
extern struct devif_callback_s *g_echocallback;
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -141,7 +141,7 @@ void devif_callback_init(void);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct uip_callback_s *devif_callback_alloc(FAR struct uip_callback_s **list);
|
||||
FAR struct devif_callback_s *devif_callback_alloc(FAR struct devif_callback_s **list);
|
||||
|
||||
/****************************************************************************
|
||||
* Function: devif_callback_free
|
||||
@@ -156,8 +156,8 @@ FAR struct uip_callback_s *devif_callback_alloc(FAR struct uip_callback_s **list
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void devif_callback_free(FAR struct uip_callback_s *cb,
|
||||
FAR struct uip_callback_s **list);
|
||||
void devif_callback_free(FAR struct devif_callback_s *cb,
|
||||
FAR struct devif_callback_s **list);
|
||||
|
||||
/****************************************************************************
|
||||
* Function: devif_callback_execute
|
||||
@@ -173,7 +173,7 @@ void devif_callback_free(FAR struct uip_callback_s *cb,
|
||||
****************************************************************************/
|
||||
|
||||
uint16_t devif_callback_execute(FAR struct net_driver_s *dev, FAR void *pvconn,
|
||||
uint16_t flags, FAR struct uip_callback_s *list);
|
||||
uint16_t flags, FAR struct devif_callback_s *list);
|
||||
|
||||
/****************************************************************************
|
||||
* Send data on the current connection.
|
||||
|
||||
+11
-11
@@ -54,8 +54,8 @@
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static struct uip_callback_s g_cbprealloc[CONFIG_NET_NACTIVESOCKETS];
|
||||
static FAR struct uip_callback_s *g_cbfreelist = NULL;
|
||||
static struct devif_callback_s g_cbprealloc[CONFIG_NET_NACTIVESOCKETS];
|
||||
static FAR struct devif_callback_s *g_cbfreelist = NULL;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
@@ -101,9 +101,9 @@ void devif_callback_init(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct uip_callback_s *devif_callback_alloc(FAR struct uip_callback_s **list)
|
||||
FAR struct devif_callback_s *devif_callback_alloc(FAR struct devif_callback_s **list)
|
||||
{
|
||||
struct uip_callback_s *ret;
|
||||
FAR struct devif_callback_s *ret;
|
||||
net_lock_t save;
|
||||
|
||||
/* Check the head of the free list */
|
||||
@@ -115,7 +115,7 @@ FAR struct uip_callback_s *devif_callback_alloc(FAR struct uip_callback_s **list
|
||||
/* Remove the next instance from the head of the free list */
|
||||
|
||||
g_cbfreelist = ret->flink;
|
||||
memset(ret, 0, sizeof(struct uip_callback_s));
|
||||
memset(ret, 0, sizeof(struct devif_callback_s));
|
||||
|
||||
/* Add the newly allocated instance to the head of the specified list */
|
||||
|
||||
@@ -153,11 +153,11 @@ FAR struct uip_callback_s *devif_callback_alloc(FAR struct uip_callback_s **list
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void devif_callback_free(FAR struct uip_callback_s *cb,
|
||||
FAR struct uip_callback_s **list)
|
||||
void devif_callback_free(FAR struct devif_callback_s *cb,
|
||||
FAR struct devif_callback_s **list)
|
||||
{
|
||||
FAR struct uip_callback_s *prev;
|
||||
FAR struct uip_callback_s *curr;
|
||||
FAR struct devif_callback_s *prev;
|
||||
FAR struct devif_callback_s *curr;
|
||||
net_lock_t save;
|
||||
|
||||
if (cb)
|
||||
@@ -221,9 +221,9 @@ void devif_callback_free(FAR struct uip_callback_s *cb,
|
||||
****************************************************************************/
|
||||
|
||||
uint16_t devif_callback_execute(FAR struct net_driver_s *dev, void *pvconn,
|
||||
uint16_t flags, FAR struct uip_callback_s *list)
|
||||
uint16_t flags, FAR struct devif_callback_s *list)
|
||||
{
|
||||
FAR struct uip_callback_s *next;
|
||||
FAR struct devif_callback_s *next;
|
||||
net_lock_t save;
|
||||
|
||||
/* Loop for each callback in the list and while there are still events
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_ICMP_PING
|
||||
FAR struct uip_callback_s *g_echocallback = NULL;
|
||||
FAR struct devif_callback_s *g_echocallback = NULL;
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
|
||||
struct icmp_ping_s
|
||||
{
|
||||
FAR struct uip_callback_s *png_cb; /* Reference to callback instance */
|
||||
FAR struct devif_callback_s *png_cb; /* Reference to callback instance */
|
||||
|
||||
sem_t png_sem; /* Use to manage the wait for the response */
|
||||
uint32_t png_time; /* Start time for determining timeouts */
|
||||
|
||||
+6
-6
@@ -74,12 +74,12 @@
|
||||
|
||||
struct send_s
|
||||
{
|
||||
FAR struct socket *snd_sock; /* Points to the parent socket structure */
|
||||
FAR struct uip_callback_s *snd_cb; /* Reference to callback instance */
|
||||
sem_t snd_sem; /* Used to wake up the waiting thread */
|
||||
FAR const uint8_t *snd_buffer; /* Points to the buffer of data to send */
|
||||
size_t snd_buflen; /* Number of bytes in the buffer to send */
|
||||
ssize_t snd_sent; /* The number of bytes sent */
|
||||
FAR struct socket *snd_sock; /* Points to the parent socket structure */
|
||||
FAR struct devif_callback_s *snd_cb; /* Reference to callback instance */
|
||||
sem_t snd_sem; /* Used to wake up the waiting thread */
|
||||
FAR const uint8_t *snd_buffer; /* Points to the buffer of data to send */
|
||||
size_t snd_buflen; /* Number of bytes in the buffer to send */
|
||||
ssize_t snd_sent; /* The number of bytes sent */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -64,10 +64,10 @@
|
||||
#ifdef CONFIG_NET_TCP
|
||||
struct tcp_connect_s
|
||||
{
|
||||
FAR struct tcp_conn_s *tc_conn; /* Reference to TCP connection structure */
|
||||
FAR struct uip_callback_s *tc_cb; /* Reference to callback instance */
|
||||
sem_t tc_sem; /* Semaphore signals recv completion */
|
||||
int tc_result; /* OK on success, otherwise a negated errno. */
|
||||
FAR struct tcp_conn_s *tc_conn; /* Reference to TCP connection structure */
|
||||
FAR struct devif_callback_s *tc_cb; /* Reference to callback instance */
|
||||
sem_t tc_sem; /* Semaphore signals recv completion */
|
||||
int tc_result; /* OK on success, otherwise a negated errno. */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -74,13 +74,13 @@
|
||||
#ifdef CONFIG_NET_TCP
|
||||
struct tcp_close_s
|
||||
{
|
||||
FAR struct uip_callback_s *cl_cb; /* Reference to TCP callback instance */
|
||||
FAR struct devif_callback_s *cl_cb; /* Reference to TCP callback instance */
|
||||
#ifdef CONFIG_NET_SOLINGER
|
||||
FAR struct socket *cl_psock; /* Reference to the TCP socket */
|
||||
sem_t cl_sem; /* Signals disconnect completion */
|
||||
int cl_result; /* The result of the close */
|
||||
FAR struct socket *cl_psock; /* Reference to the TCP socket */
|
||||
sem_t cl_sem; /* Signals disconnect completion */
|
||||
int cl_result; /* The result of the close */
|
||||
#ifndef CONFIG_DISABLE_CLOCK
|
||||
uint32_t cl_start; /* Time close started (in ticks) */
|
||||
uint32_t cl_start; /* Time close started (in ticks) */
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -84,9 +84,9 @@
|
||||
|
||||
struct net_poll_s
|
||||
{
|
||||
FAR struct socket *psock; /* Needed to handle loss of connection */
|
||||
struct pollfd *fds; /* Needed to handle poll events */
|
||||
FAR struct uip_callback_s *cb; /* Needed to teardown the poll */
|
||||
FAR struct socket *psock; /* Needed to handle loss of connection */
|
||||
struct pollfd *fds; /* Needed to handle poll events */
|
||||
FAR struct devif_callback_s *cb; /* Needed to teardown the poll */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@@ -188,7 +188,7 @@ static inline int net_pollsetup(FAR struct socket *psock,
|
||||
{
|
||||
FAR struct tcp_conn_s *conn = psock->s_conn;
|
||||
FAR struct net_poll_s *info;
|
||||
FAR struct uip_callback_s *cb;
|
||||
FAR struct devif_callback_s *cb;
|
||||
net_lock_t flags;
|
||||
int ret;
|
||||
|
||||
|
||||
+11
-11
@@ -87,18 +87,18 @@
|
||||
|
||||
struct sendfile_s
|
||||
{
|
||||
FAR struct socket *snd_sock; /* Points to the parent socket structure */
|
||||
FAR struct uip_callback_s *snd_datacb; /* Data callback */
|
||||
FAR struct uip_callback_s *snd_ackcb; /* ACK callback */
|
||||
FAR struct file *snd_file; /* File structure of the input file */
|
||||
sem_t snd_sem; /* Used to wake up the waiting thread */
|
||||
off_t snd_foffset; /* Input file offset */
|
||||
size_t snd_flen; /* File length */
|
||||
ssize_t snd_sent; /* The number of bytes sent */
|
||||
uint32_t snd_isn; /* Initial sequence number */
|
||||
uint32_t snd_acked; /* The number of bytes acked */
|
||||
FAR struct socket *snd_sock; /* Points to the parent socket structure */
|
||||
FAR struct devif_callback_s *snd_datacb; /* Data callback */
|
||||
FAR struct devif_callback_s *snd_ackcb; /* ACK callback */
|
||||
FAR struct file *snd_file; /* File structure of the input file */
|
||||
sem_t snd_sem; /* Used to wake up the waiting thread */
|
||||
off_t snd_foffset; /* Input file offset */
|
||||
size_t snd_flen; /* File length */
|
||||
ssize_t snd_sent; /* The number of bytes sent */
|
||||
uint32_t snd_isn; /* Initial sequence number */
|
||||
uint32_t snd_acked; /* The number of bytes acked */
|
||||
#if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
||||
uint32_t snd_time; /* Last send time for determining timeout */
|
||||
uint32_t snd_time; /* Last send time for determining timeout */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
+10
-10
@@ -81,21 +81,21 @@
|
||||
#if defined(CONFIG_NET_UDP) || defined(CONFIG_NET_TCP)
|
||||
struct recvfrom_s
|
||||
{
|
||||
FAR struct socket *rf_sock; /* The parent socket structure */
|
||||
FAR struct socket *rf_sock; /* The parent socket structure */
|
||||
#if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
||||
uint32_t rf_starttime; /* rcv start time for determining timeout */
|
||||
uint32_t rf_starttime; /* rcv start time for determining timeout */
|
||||
#endif
|
||||
FAR struct uip_callback_s *rf_cb; /* Reference to callback instance */
|
||||
sem_t rf_sem; /* Semaphore signals recv completion */
|
||||
size_t rf_buflen; /* Length of receive buffer */
|
||||
uint8_t *rf_buffer; /* Pointer to receive buffer */
|
||||
FAR struct devif_callback_s *rf_cb; /* Reference to callback instance */
|
||||
sem_t rf_sem; /* Semaphore signals recv completion */
|
||||
size_t rf_buflen; /* Length of receive buffer */
|
||||
uint8_t *rf_buffer; /* Pointer to receive buffer */
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
FAR struct sockaddr_in6 *rf_from; /* Address of sender */
|
||||
FAR struct sockaddr_in6 *rf_from; /* Address of sender */
|
||||
#else
|
||||
FAR struct sockaddr_in *rf_from; /* Address of sender */
|
||||
FAR struct sockaddr_in *rf_from; /* Address of sender */
|
||||
#endif
|
||||
size_t rf_recvlen; /* The received length */
|
||||
int rf_result; /* Success:OK, failure:negated errno */
|
||||
size_t rf_recvlen; /* The received length */
|
||||
int rf_result; /* Success:OK, failure:negated errno */
|
||||
};
|
||||
#endif /* CONFIG_NET_UDP || CONFIG_NET_TCP */
|
||||
|
||||
|
||||
+7
-7
@@ -87,14 +87,14 @@
|
||||
struct sendto_s
|
||||
{
|
||||
#ifdef CONFIG_NET_SENDTO_TIMEOUT
|
||||
FAR struct socket *st_sock; /* Points to the parent socket structure */
|
||||
uint32_t st_time; /* Last send time for determining timeout */
|
||||
FAR struct socket *st_sock; /* Points to the parent socket structure */
|
||||
uint32_t st_time; /* Last send time for determining timeout */
|
||||
#endif
|
||||
FAR struct uip_callback_s *st_cb; /* Reference to callback instance */
|
||||
sem_t st_sem; /* Semaphore signals sendto completion */
|
||||
uint16_t st_buflen; /* Length of send buffer (error if <0) */
|
||||
const char *st_buffer; /* Pointer to send buffer */
|
||||
int st_sndlen; /* Result of the send (length sent or negated errno) */
|
||||
FAR struct devif_callback_s *st_cb; /* Reference to callback instance */
|
||||
sem_t st_sem; /* Semaphore signals sendto completion */
|
||||
uint16_t st_buflen; /* Length of send buffer (error if <0) */
|
||||
const char *st_buffer; /* Pointer to send buffer */
|
||||
int st_sndlen; /* Result of the send (length sent or negated errno) */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
+2
-2
@@ -316,8 +316,8 @@ FAR struct tcp_conn_s *tcp_alloc(void)
|
||||
|
||||
void tcp_free(FAR struct tcp_conn_s *conn)
|
||||
{
|
||||
FAR struct uip_callback_s *cb;
|
||||
FAR struct uip_callback_s *next;
|
||||
FAR struct devif_callback_s *cb;
|
||||
FAR struct devif_callback_s *next;
|
||||
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
|
||||
FAR struct tcp_wrbuffer_s *wrbuffer;
|
||||
#endif
|
||||
|
||||
@@ -81,19 +81,19 @@
|
||||
|
||||
struct send_s
|
||||
{
|
||||
FAR struct socket *snd_sock; /* Points to the parent socket structure */
|
||||
FAR struct uip_callback_s *snd_cb; /* Reference to callback instance */
|
||||
sem_t snd_sem; /* Used to wake up the waiting thread */
|
||||
FAR const uint8_t *snd_buffer; /* Points to the buffer of data to send */
|
||||
size_t snd_buflen; /* Number of bytes in the buffer to send */
|
||||
ssize_t snd_sent; /* The number of bytes sent */
|
||||
uint32_t snd_isn; /* Initial sequence number */
|
||||
uint32_t snd_acked; /* The number of bytes acked */
|
||||
FAR struct socket *snd_sock; /* Points to the parent socket structure */
|
||||
FAR struct devif_callback_s *snd_cb; /* Reference to callback instance */
|
||||
sem_t snd_sem; /* Used to wake up the waiting thread */
|
||||
FAR const uint8_t *snd_buffer; /* Points to the buffer of data to send */
|
||||
size_t snd_buflen; /* Number of bytes in the buffer to send */
|
||||
ssize_t snd_sent; /* The number of bytes sent */
|
||||
uint32_t snd_isn; /* Initial sequence number */
|
||||
uint32_t snd_acked; /* The number of bytes acked */
|
||||
#if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
||||
uint32_t snd_time; /* Last send time for determining timeout */
|
||||
uint32_t snd_time; /* Last send time for determining timeout */
|
||||
#endif
|
||||
#if defined(CONFIG_NET_TCP_SPLIT)
|
||||
bool snd_odd; /* True: Odd packet in pair transaction */
|
||||
bool snd_odd; /* True: Odd packet in pair transaction */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user