From: Robert Klemme Date: 2008-05-07T05:20:06+09:00 Subject: Re: Conversion mask in hex to bit mask On 06.05.2008 21:25, Todd Benson wrote: > On Tue, May 6, 2008 at 12:10 PM, Robert Klemme > wrote: >> On 06.05.2008 13:29, Marcin Tyman wrote: >> >>> The issue is: how to convert hex mask to bit mask? For instance: >>> >>> I have 0xffff0000 -> it can be represent by 255.255.0.0 or by string >>> of bits - 16 >>> >> Not sure what exactly you mean by this. Do you want to count 1's? > > I think Marcin wants to eventually convert/print out to shorthand the > representation of an IPV4 address, like how "192.168.1.9/24" means > "192.168.1.9 with netmask 255.255.255.0", /8 means a 255.0.0.0 mask, > etc. > > That was my interpretation anyway. Sounds reasonable. Marcin? robert