985 |
{ |
{ |
986 |
pcb->callback_arg = arg; |
pcb->callback_arg = arg; |
987 |
} |
} |
988 |
|
#if LWIP_CALLBACK_API |
989 |
/*-----------------------------------------------------------------------------------*/ |
/*-----------------------------------------------------------------------------------*/ |
990 |
/* |
/* |
991 |
* tcp_recv(): |
* tcp_recv(): |
995 |
* |
* |
996 |
*/ |
*/ |
997 |
/*-----------------------------------------------------------------------------------*/ |
/*-----------------------------------------------------------------------------------*/ |
|
#if LWIP_CALLBACK_API |
|
998 |
void |
void |
999 |
tcp_recv(struct tcp_pcb *pcb, |
tcp_recv(struct tcp_pcb *pcb, |
1000 |
err_t (* recv)(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err)) |
err_t (* recv)(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err)) |
1001 |
{ |
{ |
1002 |
pcb->recv = recv; |
pcb->recv = recv; |
1003 |
} |
} |
|
#endif /* LWIP_CALLBACK_API */ |
|
1004 |
/*-----------------------------------------------------------------------------------*/ |
/*-----------------------------------------------------------------------------------*/ |
1005 |
/* |
/* |
1006 |
* tcp_sent(): |
* tcp_sent(): |
1010 |
* |
* |
1011 |
*/ |
*/ |
1012 |
/*-----------------------------------------------------------------------------------*/ |
/*-----------------------------------------------------------------------------------*/ |
|
#if LWIP_CALLBACK_API |
|
1013 |
void |
void |
1014 |
tcp_sent(struct tcp_pcb *pcb, |
tcp_sent(struct tcp_pcb *pcb, |
1015 |
err_t (* sent)(void *arg, struct tcp_pcb *tpcb, u16_t len)) |
err_t (* sent)(void *arg, struct tcp_pcb *tpcb, u16_t len)) |
1016 |
{ |
{ |
1017 |
pcb->sent = sent; |
pcb->sent = sent; |
1018 |
} |
} |
|
#endif /* LWIP_CALLBACK_API */ |
|
1019 |
/*-----------------------------------------------------------------------------------*/ |
/*-----------------------------------------------------------------------------------*/ |
1020 |
/* |
/* |
1021 |
* tcp_err(): |
* tcp_err(): |
1025 |
* |
* |
1026 |
*/ |
*/ |
1027 |
/*-----------------------------------------------------------------------------------*/ |
/*-----------------------------------------------------------------------------------*/ |
|
#if LWIP_CALLBACK_API |
|
1028 |
void |
void |
1029 |
tcp_err(struct tcp_pcb *pcb, |
tcp_err(struct tcp_pcb *pcb, |
1030 |
void (* errf)(void *arg, err_t err)) |
void (* errf)(void *arg, err_t err)) |
1031 |
{ |
{ |
1032 |
pcb->errf = errf; |
pcb->errf = errf; |
1033 |
} |
} |
1034 |
|
/*-----------------------------------------------------------------------------------*/ |
1035 |
|
/* |
1036 |
|
* tcp_accept(): |
1037 |
|
* |
1038 |
|
* Used for specifying the function that should be called when a |
1039 |
|
* LISTENing connection has been connected to another host. |
1040 |
|
* |
1041 |
|
*/ |
1042 |
|
/*-----------------------------------------------------------------------------------*/ |
1043 |
|
void |
1044 |
|
tcp_accept(struct tcp_pcb *pcb, |
1045 |
|
err_t (* accept)(void *arg, struct tcp_pcb *newpcb, err_t err)) |
1046 |
|
{ |
1047 |
|
((struct tcp_pcb_listen *)pcb)->accept = accept; |
1048 |
|
} |
1049 |
#endif /* LWIP_CALLBACK_API */ |
#endif /* LWIP_CALLBACK_API */ |
1050 |
|
|
1051 |
/*-----------------------------------------------------------------------------------*/ |
/*-----------------------------------------------------------------------------------*/ |
1052 |
/* |
/* |
1053 |
* tcp_poll(): |
* tcp_poll(): |
1069 |
} |
} |
1070 |
/*-----------------------------------------------------------------------------------*/ |
/*-----------------------------------------------------------------------------------*/ |
1071 |
/* |
/* |
|
* tcp_accept(): |
|
|
* |
|
|
* Used for specifying the function that should be called when a |
|
|
* LISTENing connection has been connected to another host. |
|
|
* |
|
|
*/ |
|
|
/*-----------------------------------------------------------------------------------*/ |
|
|
#if LWIP_CALLBACK_API |
|
|
void |
|
|
tcp_accept(struct tcp_pcb *pcb, |
|
|
err_t (* accept)(void *arg, struct tcp_pcb *newpcb, err_t err)) |
|
|
{ |
|
|
((struct tcp_pcb_listen *)pcb)->accept = accept; |
|
|
} |
|
|
#endif /* LWIP_CALLBACK_API */ |
|
|
/*-----------------------------------------------------------------------------------*/ |
|
|
/* |
|
1072 |
* tcp_pcb_purge(): |
* tcp_pcb_purge(): |
1073 |
* |
* |
1074 |
* Purges a TCP PCB. Removes any buffered data and frees the buffer memory. |
* Purges a TCP PCB. Removes any buffered data and frees the buffer memory. |