vortex-5 / ddwrt-bwmon

An Individual Bandwidth Monitor For DD-WRT
171 stars 37 forks source link

Feature: Display IP and DNS after lease expired #53

Closed jshir closed 5 years ago

jshir commented 7 years ago

If I open the bandwidth stats and someone has downloaded a lot of data with a client a few days ago, but is no longer connected, the lease is expired and no longer available in dnsmasq.leases.

In this instance it would be useful for the data to be stored under bwmon/data somewhere so that you don't have just a MAC without any IP or name.

vortex-5 commented 7 years ago

hmm... seems like a good feature it sounds like you want some sort of hostname caching.

I don't have a timeline on this but the alternative solution is to just put the mac address with a name in the mac-names.js file so you can nick name them.

Most users come with devices where the dns names end up looking like android23213231 which is not that much more different than a mac address. There would be no point to save the ip address they were leased when the lease expires but I see the merit in trying to hold onto the hostname.

The only negative with holding onto the hostname from what I can tell is it's more string manipulation since you have to match the mac address with the host name on each loop cycle and make sure it's actually a new entry otherwise you'd end up with a cached mac names that has a lot of duplicates. The problem with that is the search time is O(n) meaning once you have a large list of cached entires since you're never expiring them you're going to be taking significant CPU cycles on the already limited router just to "cache if unique hostname" on that file.

Usually the way around this is to build a dictionary and to keep that in memory however when some routers only really have 32MB to work with to begin with it's probably not a great idea to eat up routing buffers with thie dictionary.

I'll evaluate the feasibility of this feature it'll probably be done and be optional I just don't have a timeline right now as I'm busy with other projects.