Sam Gleske on 7 Jan 2013 09:56:39 -0800
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
[PLUG] Raising the dead: proc filesystem
|
- From: Sam Gleske <sam.mxracer@gmail.com>
- To: "Philadelphia Linux User's Group Discussion List" <plug@lists.phillylinux.org>
- Subject: [PLUG] Raising the dead: proc filesystem
- Date: Mon, 7 Jan 2013 12:56:14 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=1RZ9XttMpTzpioG7kgCtGeQz7pAtDNnq2740q98dh7Q=; b=blV5Kw3wZZH4ZCbmrY8fgR2Q5o4IU3A1/phHQ1iDYCVyYvQZzQbi58dbja+I8K5oi7 754sKKppImC9VRiM5PcgECmPpdPAdCxMRcg4Kx4NiQlKj4oDZH4tYZKL6bIufXGhYpxC v82FQVPcG14MNB5C3168VdbKg2AqKqg2xAW9RPpyZGdScRrXGLH1+y/nX9bTqq91xj5u uAV/FiMRyma+Rg6V4aSJi5GHceP/qcEOE/ag6kCRxIuQHNmGOr8dm2cXzlQ7/KmlSOBn dhDRMlM2vDIeDFy0WPYUZU0xWxMFpbVt2YWVAnZFhHE7Xv7g8WnPZIBJx0g5mkfq4qkG sZZQ==
- Reply-to: Philadelphia Linux User's Group Discussion List <plug@lists.phillylinux.org>
- Sender: plug-bounces@lists.phillylinux.org
Reference to an original thread "proc filesystem":
http://lists.netisland.net/archives/plug/plug-2002-12/msg00478.html
Has anyone found a decent way to do this outside of parsing ifconfig output? I've done it in a one liner here...
http://www.linuxquestions.org/questions/blog/sag47-492023/using-a-script-to-get-your-ip-address-35251/
Yet I've found that most times I'm able to reliably turn to the /proc filesystem for stuff like this. I'm just curious if anyone has found a decent way to do this since that thread was originally posted.
I wonder if parsing a combination of /proc/net/fib_trie and /proc/net/route would be useful in finding the IP address of the default route (which I would assume be the internet connected IP address). I found fib_trie by grep -irl my IP address through /proc. Here's some kernel documentation on fib_trie but there's nothing useful about using it for obtaining the IP address of the default route.
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=Documentation/networking/fib_trie.txt;h=0723db7f8495a1a0466ae06cd311c3e72ce24337;hb=HEAD
I look forward to discussing this.
SAM
___________________________________________________________________________
Philadelphia Linux Users Group -- http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug