socket associations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am trying to make associations between my own structures and those
of 'struct socket' as they are being passed in by the proto_ops
functions. But I don't see that any of the sockets have a unique id.
I've searched all throughout socket.c and file descriptors seem to be
only accessible in the syscalls and sockets stored in files. I've
found calls such as sockfd_lookup() which get me a socket w/ a fd, but
if there were a way to get a fd from passing a socket, I could then
use that to say "this incoming socket belongs to this data structure
on my linked list". Anyway's, once the protocol specific behaviour
(sock->ops) function has been called invoking my modules proto_ops
function ... I no longer have access to the fd and so therefore, I'm
not sure how to relate my other protocol data structures w/ that of
the socket.

Can anyone comment on the best way to handle socket associations and
how to identify a socket w/ a unique identifier (I'm just not seeing
anything uniquely specific).

Also, can anyone briefly explain what 'struct sock'.sk_socket is for?
--
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux