struct vsock_sock { /* sk must be the first member. */ struct sock sk; conststruct vsock_transport *transport; struct sockaddr_vm local_addr; struct sockaddr_vm remote_addr; /* Links for the global tables of bound and connected sockets. */ struct list_head bound_table; struct list_head connected_table; /* Accessed without the socket lock held. This means it can never be * modified outsided of socket create or destruct.
*/ bool trusted; bool cached_peer_allow_dgram; /* Dgram communication allowed to * cached peer?
*/
u32 cached_peer; /* Context ID of last dgram destination check. */ conststruct cred *owner; /* Rest are SOCK_STREAM only. */ long connect_timeout; /* Listening socket that this came from. */ struct sock *listener; /* Used for pending list and accept queue during connection handshake. * The listening socket is the head for both lists. Sockets created * for connection requests are placed in the pending list until they * are connected, at which point they are put in the accept queue list * so they can be accepted in accept(). If accept() cannot accept the * connection, it is marked as rejected so the cleanup function knows * to clean up the socket.
*/ struct list_head pending_links; struct list_head accept_queue; bool rejected; struct delayed_work connect_work; struct delayed_work pending_work; struct delayed_work close_work; bool close_work_scheduled;
u32 peer_shutdown; bool sent_request; bool ignore_connecting_rst;
/* Transport features flags */ /* Transport provides host->guest communication */ #define VSOCK_TRANSPORT_F_H2G 0x00000001 /* Transport provides guest->host communication */ #define VSOCK_TRANSPORT_F_G2H 0x00000002 /* Transport provides DGRAM communication */ #define VSOCK_TRANSPORT_F_DGRAM 0x00000004 /* Transport provides local (loopback) communication */ #define VSOCK_TRANSPORT_F_LOCAL 0x00000008
int vsock_core_register(conststruct vsock_transport *t, int features); void vsock_core_unregister(conststruct vsock_transport *t);
/* The transport may downcast this to access transport-specific functions */ conststruct vsock_transport *vsock_core_get_transport(struct vsock_sock *vsk);
/**** UTILS ****/
/* vsock_table_lock must be held */ staticinlinebool __vsock_in_bound_table(struct vsock_sock *vsk)
{ return !list_empty(&vsk->bound_table);
}
/* vsock_table_lock must be held */ staticinlinebool __vsock_in_connected_table(struct vsock_sock *vsk)
{ return !list_empty(&vsk->connected_table);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.