On Fri, 24 Oct 2003 14:26:12 +0000 (UTC), Frank Sweetser
<(E-Mail Removed)> wrote:
>Humboldt <(E-Mail Removed)> wrote:
>> Hi,
>>
>> I'm trying to write an application (function) in php, which returns
>> true/false if a given network includes a single host. The network
>> adress is given as 243.8.23.11/24 (or whatever) and the host
>> 243.8.23.22 (without netmask). If I would have a netmask for the host,
>> it would be easy to find out, because ip of host (binary) AND netmask
>> (binary) give out the belonging network.
>
>Huh? The netmask is an attribute of the IP configuration of the subnet. All
>machines on that subnet must have the same netmask, or else they're
>misconfigured and probably won't work quite right. You already say that you
>have the mask, so you can just use that.
It's not my network. I'm working on a php-programm, a grafical
interface for a firewallsystem on which a lot of other networks and
hosts are attached directly or not.
So, when configuring, the user has to enter some values, as for
example the adress of a network. There is also a form for individual
hosts, which have different rules. And to find out, when entering a
new network, I want to check of this network does include or not the
already entered single host. For example.
That I can calculate all that is clear, but a user should not do that,
so I'm looking for a formula that calculates it for me. Ok?
I hope you now understand what I'm looking for ;-)
Thanks
SvT
|