How to find the ip of ...

hi,
i want to know how can i get the ip of the hosts that are directly connected to my computer. for example in picture 1, host A is directly connected to the hosts C, E and B. if i'm working on host A, i want to know how can i get the ip of C,E and B that are directly connected to my host(host A), as you know there are also other hosts in my subnet, like D, F, H and G, but i dont want their ips, because they are not directly connected to my host.

picture 1

thanks in advance.

An ethernet subnet acts like a bus, you don't see "more direct" or "less direct" connections.

I'm not sure how you got a topology like that from a single subnet. Are some of those nodes switches?

it's not exactly the topology that i wanna use! i've drown this picture to show what i want, there are no switches, all the hosts have an ip.
in fact, i want the ips of the hosts that can be used as gateway ip in my host, tell me something, can host H be my gateway? or can i add to my route table another subnet and define host H as the gateway for reaching to that subnet?

still requires some clarification

what kind of clarification do you need?
tnx for answer.

If they're not connected with switches, then what makes the tree shape?

Is it all the same subnet? If not, which subnets are which?

You don't get logical structure inside a subnet. Don't mistake physical structure for logical structure.

This might be a confusion of terms. Maybe list IP addresses for machines and we'll see what you mean by structure.

you'e right, maybe i said it in a bad way, in fact all the devices in the picture are hosts, but if there is more than one connection for a host, it means that there is a switch connected to the host. i didn't drew the switches in the picture, there is only one subnet, all the hosts in the picture belong to the same subnet. if what i say is wrong then i might need more information about subnets.

A subnet acts like a logical bus. As far as the machines are concerned, they're all hooked to one long wire which connects to every machine. No hosts are more or less direct than any other; handling the direction of traffic etc. becomes the switches' jobs. The switches handle this by comparing MAC addresses.

If you have advanced enough switches you may be able to pull the network organization from the switch itself, but unless it's an expensive switch that's unlikely.

If a big bus isn't the organization you want, you have to start using routers and break things into more subnets. (Router in the routing sense, not router in the linksys sense. You probably don't want NAT by the sounds of it.)