some standard old program to check os
sirc, checkos, ss(identify 12 types of OS)
queso, new and improve a bit.
the above program are about to test certain OS type, not exact detail such as version of OS. (nmap)
you better to learn about tcp.ip and fingererprints, then write your own...:-)
some code from ss:
if ((flagsfour & TH_RST) && (flagsfour & TH_ACK) && (winfour == 0) &&
(flagsthree & TH_ACK))
reportos(argv[2],argv[3],"Livingston Portmaster ComOS");
hope helps..