{"id":5825,"date":"2022-12-20T18:57:36","date_gmt":"2022-12-20T21:57:36","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/ipcalc-c-et\/"},"modified":"2022-12-20T18:57:36","modified_gmt":"2022-12-20T21:57:36","slug":"ipcalc-c-et","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/ipcalc-c-et\/","title":{"rendered":"ipcalc.c (et)"},"content":{"rendered":"<h1 align=\"center\">ipcalc.c<\/h1>\n<p> <a href=\"#NIMI\">NIMI<\/a><br \/> <a href=\"#KOKKUV\u00c3TE\">KOKKUV\u00c3TE<\/a><br \/> <a href=\"#\u00c3KSIKASJALIK KIRJELDUS\">\u00c3KSIKASJALIK KIRJELDUS<\/a><br \/> <a href=\"#FUNKTSIOONIDE DOKUMENTATSIOON\">FUNKTSIOONIDE DOKUMENTATSIOON<\/a><br \/> <a href=\"#AUTOR\">AUTOR<\/a> <\/p>\n<hr>\n<h2>NIMI <a name=\"NIMI\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">ipcalc.c \u2212 pakub utiliite IP aadressidega manipuleerimiseks.<\/p>\n<h2>KOKKUV\u00c3TE <a name=\"KOKKUV\u00c3TE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><tt>#include <ctype.h> <br \/> #include <popt.h> #include <stdio.h> <br \/> #include <stdlib.h> <br \/> #include <string.h> <br \/> #include <sys\/socket.h> <br \/> #include <netinet\/in.h> <br \/> #include <arpa\/inet.h> <br \/> #include <netdb.h><\/tt><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>M\u00c3\u00a4\u00c3\u00a4ratlused<\/b><\/p>\n<p style=\"margin-left:17%;\">#define <b>IPBITS<\/b> (sizeof(unsigned long int) bodies manpages.csv script_extrae_body.sh script.sh usr 8) <i><br \/> bittide arv IP aadressis.<\/i> <br \/> #define <b>IPBYTES<\/b> (sizeof(unsigned long int)) <i><br \/> baitide arv IP aadressis.<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Funktsioonid<\/b><\/p>\n<p style=\"margin-left:17%;\">unsigned long int <b>prefix2mask<\/b> (int prefix) <i><br \/> loob m\u00c3\u00a4\u00c3\u00a4ratud bittide arvuga v\u00c3\u00b5rgumaski.<\/i> <br \/> int <b>mask2prefix<\/b> (unsigned long int mask) <i><br \/> arvutab v\u00c3\u00b5rgumaskiga varjatud bittide arvu.<\/i> <br \/> unsigned long int <b>default_netmask<\/b> (unsigned long int addr) <i><br \/> hangib m\u00c3\u00a4\u00c3\u00a4ratud IP aadressiga seotud vaike\u2212(kanoonilise) v\u00c3\u00b5rgumaski.<\/i> <br \/> unsigned long int <b>calc_broadcast<\/b> (unsigned long int addr, int prefix) <i><br \/> arvutab antud IP aadressi ja prefiksi pikkuse p\u00c3\u00b5hjal \u00c3\u00bcldleviaadressi.<\/i> <br \/> unsigned long int <b>calc_network<\/b> (unsigned long int addr, int prefix) <i><br \/> arvutab m\u00c3\u00a4\u00c3\u00a4ratud aadressi ja prefiksi p\u00c3\u00b5hjal v\u00c3\u00b5rguaadressi.<\/i> <br \/> const char* <b>get_hostname<\/b> (unsigned long int addr) <i><br \/> hangib m\u00c3\u00a4\u00c3\u00a4ratud IP aadressiga seonduva masinanime.<\/i> <br \/> int <b>main<\/b> (int argc, const char **argv) <i><br \/> wrapper program for ipcalc functions.<\/i><\/p>\n<h2>\u00c3KSIKASJALIK KIRJELDUS <a name=\"\u00c3KSIKASJALIK KIRJELDUS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">pakub utiliite IP aadressidega manipuleerimiseks.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">ipcalc pakub utiliite ja k\u00c3\u00a4surea\u2212kasutajaliidese IP aadressidega manipuleerimiseks ning ip aadressi\/v\u00c3\u00b5rgumaski\/v\u00c3\u00b5rguaadressi\/prefiksi\/jne mitmesuguste aspektide arvutamiseks.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Functionality can be accessed from other languages from the library interface, documented here. To use ipcalc from the shell, read the ipcalc(1) manual page.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Parameetrite l\u00c3\u00a4hetamisel erinevatele funktsioonidele pange t\u00c3\u00a4hele, kas nad kasutavad masina baidij\u00c3\u00a4rjekorda v\u00c3\u00b5i v\u00c3\u00b5rgu baidij\u00c3\u00a4rjekorda. Enamik kasutab masina baidij\u00c3\u00a4rjekorda ja ka hangib sellesama, kuid on ka erandeid.<\/p>\n<h2>FUNKTSIOONIDE DOKUMENTATSIOON <a name=\"FUNKTSIOONIDE DOKUMENTATSIOON\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>unsigned long int calc_broadcast (unsigned long int addr, int prefix)<\/b> <br \/> arvutab antud IP aadressi ja prefiksi pikkuse puhul \u00c3\u00bcldleviaadressi.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Parameetrid:<\/b><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><i>addr<\/i><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"55%\">\n<p>IP aadress v\u00c3\u00b5rgu baidij\u00c3\u00a4rjekorras.<\/p>\n<\/td>\n<td width=\"23%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><i>prefix<\/i><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"55%\">\n<p>prefiksi pikkus.<\/p>\n<\/td>\n<td width=\"23%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Hangib:<\/b><\/p>\n<p style=\"margin-left:17%;\">arvutatud \u00c3\u00bcldleviaadressi v\u00c3\u00b5rgule v\u00c3\u00b5rgu baidij\u00c3\u00a4rjekorras.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>unsigned long int calc_network (unsigned long int addr, int prefix)<\/b> <br \/> arvutab m\u00c3\u00a4\u00c3\u00a4ratud aadressi ja prefiksi puhul v\u00c3\u00b5rguaadressi.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Parameetrid:<\/b><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p style=\"margin-top: 1em\"><i>addr<\/i><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"53%\">\n<p style=\"margin-top: 1em\">IP aadress v\u00c3\u00b5rgu baidij\u00c3\u00a4rjekorras<\/p>\n<\/td>\n<td width=\"25%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><i>prefix<\/i><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"53%\">\n<p>v\u00c3\u00b5rguprefiks<\/p>\n<\/td>\n<td width=\"25%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Hangib:<\/b><\/p>\n<p style=\"margin-left:17%;\">v\u00c3\u00b5rgu baasaadressi, millega addr on seotud, v\u00c3\u00b5rgu baidij\u00c3\u00a4rjekorras.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>unsigned long int default_netmask (unsigned long int addr)<\/b> <br \/> hangib m\u00c3\u00a4\u00c3\u00a4ratud IP aadressiga seotud vaike\u2212(kanoonilise) v\u00c3\u00b5rgumaski.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Kui Internet algselt loodi, jagati erinevad IP aadressid kolme v\u00c3\u00b5rguklassi: A, B ja C. See funktsioon hangib v\u00c3\u00b5rgumaski, mis on seotud m\u00c3\u00a4\u00c3\u00a4ratud IP aadressiga, defineerides, millisesse v\u00c3\u00b5rguklassi see langeb.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Parameetrid:<\/b><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"6%\">\n<p style=\"margin-top: 1em\"><i>addr<\/i><\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"55%\">\n<p style=\"margin-top: 1em\">IP aadress v\u00c3\u00b5rgu baidij\u00c3\u00a4rjekorras.<\/p>\n<\/td>\n<td width=\"23%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Hangib:<\/b><\/p>\n<p style=\"margin-left:17%;\">v\u00c3\u00b5rgumaski v\u00c3\u00b5rgu baidij\u00c3\u00a4rjekorras.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>const char bodies manpages.csv script_extrae_body.sh script.sh usr get_hostname (unsigned long int addr)<\/b> <br \/> hangib m\u00c3\u00a4\u00c3\u00a4ratud IP aadressiga seotud masinanime.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Parameetrid:<\/b><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"6%\">\n<p style=\"margin-top: 1em\"><i>addr<\/i><\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">IP aadress masinanime leidmiseks v\u00c3\u00b5rgu baidij\u00c3\u00a4rjekorras<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Hangib:<\/b><\/p>\n<p style=\"margin-left:17%;\">masinanime v\u00c3\u00b5i NULLi, kui seda ei saa m\u00c3\u00a4\u00c3\u00a4rata. Masinanimi on salvestatud staatilisse puhvrisse, mis v\u00c3\u00b5ib suvalisel ajal haihtuda, v\u00c3\u00a4ljakutsuja peab kopeerima andmed, kui ta vajab p\u00c3\u00bcsisalvestust.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>main (int argc, const char bodies manpages.csv script_extrae_body.sh script.sh usr argv)<\/b> <br \/> ipcalc funktsioonide rakendus.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">See on rakendus funktsioonidele, mida pakub ipcalc\u2212i teek. Seda v\u00c3\u00b5ib kasutada shelliskriptidelt v\u00c3\u00b5i otse k\u00c3\u00a4surealt.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">T\u00c3\u00a4psemat infot vaadake palun manuaalilehek\u00c3\u00bcljelt ipcalc(1).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>int mask2prefix (unsigned long int mask)<\/b> <br \/> arvutab v\u00c3\u00b5rgumaskiga varjatud bittide arvu.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This function calculates the significant bits in an IP address as specified by a netmask. Vaata ka <b>prefix2mask<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Parameetrid:<\/b><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"6%\">\n<p style=\"margin-top: 1em\"><i>mask<\/i><\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">on v\u00c3\u00b5rgumask, specified as an unsigned long integer in network byte order.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Hangib:<\/b><\/p>\n<p style=\"margin-left:17%;\">the number of significant bits.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>unsigned long int prefix2mask (int bits)<\/b> <br \/> loob m\u00c3\u00a4\u00c3\u00a4ratud bittide arvust v\u00c3\u00b5rgumaski.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This function converts a prefix length to a netmask. As CIDR (classless internet domain internet domain routing) has taken off, more an more IP addresses are being specified in the format address\/prefix (i.e. 192.168.2.3\/24, with a corresponding netmask 255.255.255.0). If you need to see what netmask corresponds to the prefix part of the address, this is the function. See also <b>mask2prefix<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Parameetrid:<\/b><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p style=\"margin-top: 1em\"><i>prefix<\/i><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"52%\">\n<p style=\"margin-top: 1em\">on bittide arv, millest mask luua.<\/p>\n<\/td>\n<td width=\"26%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Hangib:<\/b><\/p>\n<p style=\"margin-left:17%;\">v\u00c3\u00b5rgumaski v\u00c3\u00b5rgu baidij\u00c3\u00a4rjekorras.<\/p>\n<h2>AUTOR <a name=\"AUTOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Genereeritud automaatselt Doxygeni abil initscripts\u2212ile l\u00c3\u00a4htekoodist.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">T\u00c3\u00b5lge eesti keelde: Marek Laane 2002 <br \/> bald@online.ee<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>ipcalc.c NIMI KOKKUV\u00c3TE \u00c3KSIKASJALIK KIRJELDUS FUNKTSIOONIDE DOKUMENTATSIOON AUTOR NIMI ipcalc.c \u2212 pakub utiliite IP aadressidega manipuleerimiseks. KOKKUV\u00c3TE #include #include #include #include #include #include #include #include #include M\u00c3\u00a4\u00c3\u00a4ratlused #define IPBITS (sizeof(unsigned long int) bodies manpages.csv script_extrae_body.sh script.sh usr 8) bittide arv IP aadressis. #define IPBYTES (sizeof(unsigned long int)) baitide arv IP aadressis. Funktsioonid unsigned long int [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2536],"tags":[2538,2563,2537],"class_list":["post-5825","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-et","tag-ipcalc_c"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/5825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=5825"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/5825\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=5825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=5825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=5825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}