Skip to content

Commit

Permalink
Merge branch 'main' into pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
maryamtahhan authored Jun 20, 2024
2 parents 0bc0bd1 + 75ba078 commit ebcd521
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
14 changes: 7 additions & 7 deletions doc/guides/sample_app_ug/cnet_graph.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,13 @@ The channel callback types are shown below:
.. code-block:: c
/** Channel callback types */
typedef enum {
CHNL_UDP_RECV_TYPE, /**< Callback for receiving UDP packets */
CHNL_UDP_CLOSE_TYPE, /**< Callback for UDP close */
CHNL_TCP_ACCEPT_TYPE, /**< Callback type for accepting TCP connection */
CHNL_TCP_RECV_TYPE, /**< Callback for receiving TCP packets */
CHNL_TCP_CLOSE_TYPE, /**< Callback for TCP close */
CHNL_CALLBACK_TYPES /**< Maximum number of callback types */
typedef enum {
CHNL_UDP_RECV_TYPE, /**< Callback for receiving UDP packets */
CHNL_UDP_CLOSE_TYPE, /**< Callback for UDP close */
CHNL_TCP_ESTABLISHED_TYPE, /**< Callback for when TCP is established: `accept` or `connect` */
CHNL_TCP_RECV_TYPE, /**< Callback for receiving TCP packets */
CHNL_TCP_CLOSE_TYPE, /**< Callback for TCP close */
CHNL_CALLBACK_TYPES /**< Maximum number of callback types */
} chnl_type_t;
Packet Forwarding using Graph Walk
Expand Down
12 changes: 6 additions & 6 deletions lib/cnet/chnl/cnet_chnl.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ enum {

/** Channel callback types */
typedef enum {
CHNL_UDP_RECV_TYPE, /**< Callback for receiving UDP packets */
CHNL_UDP_CLOSE_TYPE, /**< Callback for UDP close */
CHNL_TCP_ACCEPT_TYPE, /**< Callback type for accepting TCP connection */
CHNL_TCP_RECV_TYPE, /**< Callback for receiving TCP packets */
CHNL_TCP_CLOSE_TYPE, /**< Callback for TCP close */
CHNL_CALLBACK_TYPES /**< Maximum number of callback types */
CHNL_UDP_RECV_TYPE, /**< Callback for receiving UDP packets */
CHNL_UDP_CLOSE_TYPE, /**< Callback for UDP close */
CHNL_TCP_ESTABLISHED_TYPE, /**< Callback for when TCP is established: `accept` or `connect` */
CHNL_TCP_RECV_TYPE, /**< Callback for receiving TCP packets */
CHNL_TCP_CLOSE_TYPE, /**< Callback for TCP close */
CHNL_CALLBACK_TYPES /**< Maximum number of callback types */
} chnl_type_t;

/**
Expand Down
4 changes: 3 additions & 1 deletion lib/cnet/tcp/cnet_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1389,8 +1389,10 @@ tcp_do_state_change(struct pcb_entry *pcb, int32_t new_state)
cnet_tcp_abort(pcb);
CNE_ERR("Failed to enqueue PCB to backlog queue\n");
}
pcb->ch->ch_callback(CHNL_TCP_ACCEPT_TYPE, tcb->ppcb->ch->ch_cd);
pcb->ch->ch_callback(CHNL_TCP_ESTABLISHED_TYPE, tcb->ppcb->ch->ch_cd);
}
} else {
pcb->ch->ch_callback(CHNL_TCP_ESTABLISHED_TYPE, pcb->ch->ch_cd);
}

tcb->idle = 0;
Expand Down

0 comments on commit ebcd521

Please sign in to comment.