MCPcopy Create free account
hub / github.com/F-Stack/f-stack / memif_msg_enq_disconnect

Function memif_msg_enq_disconnect

dpdk/drivers/net/memif/memif_socket.c:102–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102void
103memif_msg_enq_disconnect(struct memif_control_channel *cc, const char *reason,
104 int err_code)
105{
106 struct memif_msg_queue_elt *e;
107 struct pmd_internals *pmd;
108 memif_msg_disconnect_t *d;
109
110 if (cc == NULL) {
111 MIF_LOG(DEBUG, "Missing control channel.");
112 return;
113 }
114
115 e = memif_msg_enq(cc);
116 if (e == NULL) {
117 MIF_LOG(WARNING, "Failed to enqueue disconnect message.");
118 return;
119 }
120
121 d = &e->msg.disconnect;
122
123 e->msg.type = MEMIF_MSG_TYPE_DISCONNECT;
124 d->code = err_code;
125
126 if (reason != NULL) {
127 strlcpy((char *)d->string, reason, sizeof(d->string));
128 if (cc->dev != NULL) {
129 pmd = cc->dev->data->dev_private;
130 strlcpy(pmd->local_disc_string, reason,
131 sizeof(pmd->local_disc_string));
132 }
133 }
134}
135
136static int
137memif_msg_enq_hello(struct memif_control_channel *cc)

Callers 6

memif_dev_closeFunction · 0.85
memif_msg_receive_helloFunction · 0.85
memif_msg_receive_initFunction · 0.85
memif_msg_receiveFunction · 0.85

Calls 2

memif_msg_enqFunction · 0.85
strlcpyFunction · 0.50

Tested by

no test coverage detected