Obtaining a list of open sockets from "struct task_struct"

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

 



Hi all,

I am trying to understand more about kernel data structures and I
would like to know how to obtain a list of TCP/UDP sockets, starting
from a "struct task_struct" variable "task".

So far, I have understood the following:  Please correct me if I am wrong! :)

- An open file descriptor is represented by a "struct file *" in the
tasks's file table: task->files.fdt.fd
- The file tables are organised as a linked list
- The file table contains a structure fd_array, that is an array of
"struct file *", each representing an open file

But, almost all operations in the TCP code start from a "struct sock".
  Are the "struct file" and "struct sock" somehow connected?

Thanks,
-- 
Vimal

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux