well...here u r.... ------------------------------------- struct ifreq ifrs[MAX_INTERFACES]; struct ifconf ifcnf; ifcnf.ifc_len = sizeof(ifrs); ifcnf.ifc_req = ifrs; ioctl(sd, SIOCGIFCONF, &ifcnf); ------------------------------------- and then... ------------------------------------- ( ifcnf.ifc_len / sizeof(struct ifreq) ); ------------------------------------- should get you the number of interfaces... :-) Warning:: Be careful about aliases also...i mean MAX_INTERFACES should consider that as well..... don't know whether there's any other way where without specifying MAX_INTERFACES should also do... !! :-) Avni -----Original Message----- From: linux-net-owner@vger.kernel.org [mailto:linux-net-owner@vger.kernel.org]On Behalf Of S Ramesh Sent: Monday, 4 March 2002 2:11 PM To: Net Subject: interface details Hi, I am doing to a protocol implementation and I want to know the number of interfaces exist in my box and its details when my code gets initialised. How can i acheive it. I saw the ifreq structure, but again when we give some interface name of ifindex we can get the details, but how to know the total number of interfaces exist in my box. Any pointers will be very muchappreciated. Thanks, Ramesh - : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html - : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html