Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
You can find hostid command in sh-util-2.0-i386-1 package.
Download sh-util-2.0 source and will
find hostid.c in src directory.
You'll see that host id you can get with function:
int sethostid(long hostid);
and read man pages )))
No, you misunderstood me. The question I ask is where this hostid come from. In a workstation, the hostid is programmed by the manufacturer in a eeprom(or flassh) BIOS. Some EDA application get the ID from a dongle. NIC address and hard drive signature can be a source of hostid. What I ask here is how the Linux OS calculate to give us a hostid number.
may be this call is described in libc or glibc or others... I don't know, but can see, if you want. There you can find right way how to calculate default value for hostid. Next lines are taken from man page of gethostid:
"This normally resembles the Internet address for the local machine, as returned by gethostbyname(3), and thus
usually never needs to be set."
May be gethostid() or sethostid()
is a syscall to kernel, I don't
know, at this moment, but I told
you, that If you want, I can see
to set new hostid, you must have superuser privilegies...
If you can set the host id, how can the EDA protect they software. They are not stupid ! Remember the software in linux is protect by Globelstrotter Flexlm. The host id have to be a fix string, it's can't be modified easily
I can't understand why you can't change your MAC? or DISK Id, which is your volume serial, if you use Windows...
You can change host id easy, if the system is yours... but you can't make valid license easy!!!!
If you have a valid license you can adjust your PC to work with it... But how to make valid license?????
I did it for some tools... i.e. Xilinx foundation ISE 4.2i....
I copied and install the CDs... take valid license from my friends, who bought it and changed my MAC address... with simple i2c modifications....
// get real (default) hostid
id = gethostid();
printf("current hostid is: %x\n",id);
// set new hostid if is superuser
res = sethostid(0x11223344);
if (res == 0) printf("if result is zero - success! (%d) \n",res);
// check if it is changed....
id = gethostid();
printf("current hostid is: %x ;-PPPppppp\n",id);
after power-off and power-on will be restored default value.... value, which you will see in first running of the program, which i paste...
If your problem is to change it permamently, after power down, the right way is different ))
but have you needs to change it permanently, when you can change it every time, when you needs using this tool.
You can add it in /etc/rc.d/rc.local
and it will be executed each time when you reboot your system...
"permanentlly" changed hostid is stored it /etc/hostid...
So you haven't needs to change it every time, when you reboot
your system... next time, when you type hostid, it will be
read from /etc/hostid
To restore original hostid, just remove /etc/hostid