Lines Matching refs:pkt
40 struct vmci_transport_packet *pkt);
44 struct vmci_transport_packet *pkt);
47 struct vmci_transport_packet *pkt);
50 struct vmci_transport_packet *pkt);
53 struct vmci_transport_packet *pkt);
55 struct vmci_transport_packet *pkt);
65 struct vmci_transport_packet pkt; member
112 vmci_transport_packet_init(struct vmci_transport_packet *pkt, in vmci_transport_packet_init() argument
125 pkt->dg.src = vmci_make_handle(VMADDR_CID_ANY, in vmci_transport_packet_init()
127 pkt->dg.dst = vmci_make_handle(dst->svm_cid, in vmci_transport_packet_init()
129 pkt->dg.payload_size = sizeof(*pkt) - sizeof(pkt->dg); in vmci_transport_packet_init()
130 pkt->version = VMCI_TRANSPORT_PACKET_VERSION; in vmci_transport_packet_init()
131 pkt->type = type; in vmci_transport_packet_init()
132 pkt->src_port = src->svm_port; in vmci_transport_packet_init()
133 pkt->dst_port = dst->svm_port; in vmci_transport_packet_init()
134 memset(&pkt->proto, 0, sizeof(pkt->proto)); in vmci_transport_packet_init()
135 memset(&pkt->_reserved2, 0, sizeof(pkt->_reserved2)); in vmci_transport_packet_init()
137 switch (pkt->type) { in vmci_transport_packet_init()
139 pkt->u.size = 0; in vmci_transport_packet_init()
144 pkt->u.size = size; in vmci_transport_packet_init()
149 pkt->u.handle = handle; in vmci_transport_packet_init()
155 pkt->u.size = 0; in vmci_transport_packet_init()
159 pkt->u.mode = mode; in vmci_transport_packet_init()
164 memcpy(&pkt->u.wait, wait, sizeof(pkt->u.wait)); in vmci_transport_packet_init()
169 pkt->u.size = size; in vmci_transport_packet_init()
170 pkt->proto = proto; in vmci_transport_packet_init()
176 vmci_transport_packet_get_addresses(struct vmci_transport_packet *pkt, in vmci_transport_packet_get_addresses() argument
180 vsock_addr_init(local, pkt->dg.dst.context, pkt->dst_port); in vmci_transport_packet_get_addresses()
181 vsock_addr_init(remote, pkt->dg.src.context, pkt->src_port); in vmci_transport_packet_get_addresses()
185 __vmci_transport_send_control_pkt(struct vmci_transport_packet *pkt, in __vmci_transport_send_control_pkt() argument
198 vmci_transport_packet_init(pkt, src, dst, type, size, mode, wait, in __vmci_transport_send_control_pkt()
200 err = vmci_datagram_send(&pkt->dg); in __vmci_transport_send_control_pkt()
208 vmci_transport_reply_control_pkt_fast(struct vmci_transport_packet *pkt, in vmci_transport_reply_control_pkt_fast() argument
218 if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST) { in vmci_transport_reply_control_pkt_fast()
221 vmci_transport_packet_get_addresses(pkt, &src, &dst); in vmci_transport_reply_control_pkt_fast()
244 static struct vmci_transport_packet pkt; in vmci_transport_send_control_pkt_bh() local
246 return __vmci_transport_send_control_pkt(&pkt, src, dst, type, in vmci_transport_send_control_pkt_bh()
262 struct vmci_transport_packet *pkt; in vmci_transport_alloc_send_control_pkt() local
265 pkt = kmalloc(sizeof(*pkt), GFP_KERNEL); in vmci_transport_alloc_send_control_pkt()
266 if (!pkt) in vmci_transport_alloc_send_control_pkt()
269 err = __vmci_transport_send_control_pkt(pkt, src, dst, type, size, in vmci_transport_alloc_send_control_pkt()
272 kfree(pkt); in vmci_transport_alloc_send_control_pkt()
304 struct vmci_transport_packet *pkt) in vmci_transport_send_reset_bh() argument
306 if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST) in vmci_transport_send_reset_bh()
315 struct vmci_transport_packet *pkt) in vmci_transport_send_reset() argument
321 if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST) in vmci_transport_send_reset()
332 vsock_addr_init(&dst, pkt->dg.src.context, in vmci_transport_send_reset()
333 pkt->src_port); in vmci_transport_send_reset()
380 static int vmci_transport_reply_reset(struct vmci_transport_packet *pkt) in vmci_transport_reply_reset() argument
383 pkt, in vmci_transport_reply_reset()
480 struct vmci_transport_packet *pkt) in vmci_transport_get_pending() argument
487 vsock_addr_init(&src, pkt->dg.src.context, pkt->src_port); in vmci_transport_get_pending()
494 pkt->dst_port == vpending->local_addr.svm_port) { in vmci_transport_get_pending()
676 struct vmci_transport_packet *pkt; in vmci_transport_recv_stream_cb() local
693 if (VMCI_DG_SIZE(dg) < sizeof(*pkt)) in vmci_transport_recv_stream_cb()
697 pkt = (struct vmci_transport_packet *)dg; in vmci_transport_recv_stream_cb()
703 vsock_addr_init(&src, pkt->dg.src.context, pkt->src_port); in vmci_transport_recv_stream_cb()
704 vsock_addr_init(&dst, pkt->dg.dst.context, pkt->dst_port); in vmci_transport_recv_stream_cb()
719 if (vmci_transport_send_reset_bh(&dst, &src, pkt) < 0) in vmci_transport_recv_stream_cb()
731 if (pkt->type >= VMCI_TRANSPORT_PACKET_TYPE_MAX) { in vmci_transport_recv_stream_cb()
747 if (!vmci_transport_allow_dgram(vsk, pkt->dg.src.context)) { in vmci_transport_recv_stream_cb()
765 sk, pkt, true, &dst, &src, in vmci_transport_recv_stream_cb()
776 if (vmci_transport_send_reset_bh(&dst, &src, pkt) < 0) in vmci_transport_recv_stream_cb()
784 memcpy(&recv_pkt_info->pkt, pkt, sizeof(recv_pkt_info->pkt)); in vmci_transport_recv_stream_cb()
894 struct vmci_transport_packet *pkt; in vmci_transport_recv_pkt_work() local
900 pkt = &recv_pkt_info->pkt; in vmci_transport_recv_pkt_work()
905 vsock_sk(sk)->local_addr.svm_cid = pkt->dg.dst.context; in vmci_transport_recv_pkt_work()
909 vmci_transport_recv_listen(sk, pkt); in vmci_transport_recv_pkt_work()
916 vmci_transport_recv_connecting_client(sk, pkt); in vmci_transport_recv_pkt_work()
919 vmci_transport_recv_connected(sk, pkt); in vmci_transport_recv_pkt_work()
928 vmci_transport_send_reset(sk, pkt); in vmci_transport_recv_pkt_work()
941 struct vmci_transport_packet *pkt) in vmci_transport_recv_listen() argument
959 pending = vmci_transport_get_pending(sk, pkt); in vmci_transport_recv_listen()
964 vsock_sk(pending)->local_addr.svm_cid = pkt->dg.dst.context; in vmci_transport_recv_listen()
970 pkt); in vmci_transport_recv_listen()
973 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_listen()
990 if (!(pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST || in vmci_transport_recv_listen()
991 pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST2)) { in vmci_transport_recv_listen()
992 vmci_transport_reply_reset(pkt); in vmci_transport_recv_listen()
996 if (pkt->u.size == 0) { in vmci_transport_recv_listen()
997 vmci_transport_reply_reset(pkt); in vmci_transport_recv_listen()
1006 vmci_transport_reply_reset(pkt); in vmci_transport_recv_listen()
1012 vmci_transport_send_reset(sk, pkt); in vmci_transport_recv_listen()
1018 vsock_addr_init(&vpending->local_addr, pkt->dg.dst.context, in vmci_transport_recv_listen()
1019 pkt->dst_port); in vmci_transport_recv_listen()
1020 vsock_addr_init(&vpending->remote_addr, pkt->dg.src.context, in vmci_transport_recv_listen()
1021 pkt->src_port); in vmci_transport_recv_listen()
1028 vmci_transport_send_reset(sk, pkt); in vmci_transport_recv_listen()
1036 if (pkt->u.size >= vpending->buffer_min_size && in vmci_transport_recv_listen()
1037 pkt->u.size <= vpending->buffer_max_size) { in vmci_transport_recv_listen()
1038 qp_size = pkt->u.size; in vmci_transport_recv_listen()
1049 if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST) in vmci_transport_recv_listen()
1051 else if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST2) in vmci_transport_recv_listen()
1067 int proto_int = pkt->proto; in vmci_transport_recv_listen()
1097 vmci_transport_send_reset(sk, pkt); in vmci_transport_recv_listen()
1134 struct vmci_transport_packet *pkt) in vmci_transport_recv_connecting_server() argument
1148 switch (pkt->type) { in vmci_transport_recv_connecting_server()
1150 if (vmci_handle_is_invalid(pkt->u.handle)) { in vmci_transport_recv_connecting_server()
1151 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_connecting_server()
1159 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_connecting_server()
1161 err = pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST ? 0 : -EINVAL; in vmci_transport_recv_connecting_server()
1180 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_connecting_server()
1189 handle = pkt->u.handle; in vmci_transport_recv_connecting_server()
1204 pkt->dg.src.context, in vmci_transport_recv_connecting_server()
1210 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_connecting_server()
1243 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_connecting_server()
1280 struct vmci_transport_packet *pkt) in vmci_transport_recv_connecting_client() argument
1288 switch (pkt->type) { in vmci_transport_recv_connecting_client()
1290 if (vmci_handle_is_invalid(pkt->u.handle) || in vmci_transport_recv_connecting_client()
1291 !vmci_handle_is_equal(pkt->u.handle, in vmci_transport_recv_connecting_client()
1311 if (pkt->u.size == 0 in vmci_transport_recv_connecting_client()
1312 || pkt->dg.src.context != vsk->remote_addr.svm_cid in vmci_transport_recv_connecting_client()
1313 || pkt->src_port != vsk->remote_addr.svm_port in vmci_transport_recv_connecting_client()
1325 err = vmci_transport_recv_connecting_client_negotiate(sk, pkt); in vmci_transport_recv_connecting_client()
1333 err = vmci_transport_recv_connecting_client_invalid(sk, pkt); in vmci_transport_recv_connecting_client()
1369 vmci_transport_send_reset(sk, pkt); in vmci_transport_recv_connecting_client()
1379 struct vmci_transport_packet *pkt) in vmci_transport_recv_connecting_client_negotiate() argument
1403 if (pkt->u.size < vsk->buffer_min_size || in vmci_transport_recv_connecting_client_negotiate()
1404 pkt->u.size > vsk->buffer_max_size) { in vmci_transport_recv_connecting_client_negotiate()
1412 vsk->local_addr.svm_cid = pkt->dg.dst.context; in vmci_transport_recv_connecting_client_negotiate()
1421 if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE) in vmci_transport_recv_connecting_client_negotiate()
1423 else if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE2) in vmci_transport_recv_connecting_client_negotiate()
1431 version = pkt->proto; in vmci_transport_recv_connecting_client_negotiate()
1459 pkt->u.size, in vmci_transport_recv_connecting_client_negotiate()
1460 pkt->u.size, in vmci_transport_recv_connecting_client_negotiate()
1480 pkt->u.size; in vmci_transport_recv_connecting_client_negotiate()
1500 struct vmci_transport_packet *pkt) in vmci_transport_recv_connecting_client_invalid() argument
1521 struct vmci_transport_packet *pkt) in vmci_transport_recv_connected() argument
1534 switch (pkt->type) { in vmci_transport_recv_connected()
1536 if (pkt->u.mode) { in vmci_transport_recv_connected()
1539 vsk->peer_shutdown |= pkt->u.mode; in vmci_transport_recv_connected()
1566 sk, pkt, false, NULL, NULL, in vmci_transport_recv_connected()