If you are coding on AmigaOS4 and don't require backwards compatabilty the easiest solution is to use the interface.
ie
definetly bsdsocket
ISocket->connect()
Otherwise it's being careful about how you order your includes.
Just adding
#include <proto/bsdsocket.h>
Should be enough in most cases as that wil pull in the inlines and those will replace the functions call with macros referenceing ISocket or SocketBase depending on the target (AmigaOS4 or 68k).
It's little easier to be certain with clib2 as there is a separate libnet.a so not linking against that will give erreors if you messed up your inlcudes.
Though that is not not quite what you want as that hostname is local to my SAM 440 on the rest of the network it's defeined as SAM in the various local hosts databases. Using fixed ips on my network so the router doesn't knw the hostnames of the machines.
As far as I know, any host on the network can define another host in its hosts table using any hostname it likes. It acts as sort of a local "DNS" on that host.
And there is nothing forcing you to give a hostname when you hook up to the LAN - at least not when you use a fixed IP address, and I think also not with DHCP.
So (if I'm correct) it doesn't even necessarily make sense to ask for "the name all hosts call a particular machine".
As far as I know, any host on the network can define another host in its hosts table using any hostname it likes. It acts as sort of a local "DNS" on that host.
True, but that's NOT useful, especially when your LAN has a router at its centre that does NOT allow you to set static IP addresses.
Quote:
Why do you need it?
To identify machines on the network in a human readable form in an environment where everyone has a dynamic IP address. The information is there (Avast's Wifi Inspector can read it); I just want to use it.
never come across routers that don't allow static ip addresses, but i know they exist.. but to change it to static ip, it must be set at the routers settings to make it work.. if that ruter isn't accessible because of dhcp rule, then you need too unplug the dhcp master ruter from it and then change settings.. probably need to reset it first
Sam460ex 2GB 120Gb SSD&1Tb HD7750 Envy24HT A-Eon Drv 2.10+Warp3D New Uboot Apollo v4 Standalone
Yes, that's what I'm trying to do. My original goal was to just get a usable hostname for the local machine (which AmigaOS doesn't report correctly). However, ultimately I want to be able to identify all machines on the network.
Avast's Wifi Inspector is able to do that,** so it's got to be possible.
Hans
** Probably with the exception of machines in "stealth mode" that don't even respond to pings.
Oops! I updated the version on the wrong partition. Running with the actual latest version, the "Network device name" is NOT the same as the hostname that's sent to the DHCP server.
especially when your LAN has a router at its centre that does NOT allow you to set static IP addresses.
The ip address is normally assigned sequentially, starting with first in the range where normally the last in range, is least likely to be assigned. In that case I use like *.*.*.254 or *.*.*.253 for static ip' etc. or can just pop a router or network bridge that do not suck in-between.
(NutsAboutAmiga)
Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps.
I've found that I have to ping another machine before it's listed by arp -a. However, only the router's name appears.
Ah yes that does appear to be the case. The arp table contains the primary host name the IP and the Mac address of the machines that have been connected to from the machine I run 'arp' on.
If I ping an address that doesn;t exist then I get an incomplete record in the table that disappears after a while.
I wonder if the hostname as presented to the router is the one you want to use in practice, if I copy and paste the hostname of my phone from the DHCP table on my router I can't use that as the domain name to ping it only it's address or domain name as defined in my hosts file.
So
ping all possible addresses in subnet read arp table discard incomplete entries ????? profit!