/usr/share/gtk-doc/html/gnet/gnet-inetaddr.html is in libgnet-dev 2.0.8-2.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>InetAddr</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
<link rel="start" href="index.html" title="GNet Network Library Reference Manual">
<link rel="up" href="libgnet-reference.html" title="GNet Library Reference">
<link rel="prev" href="gnet-gnet.html" title="GNet">
<link rel="next" href="gnet-tcp.html" title="TCP">
<meta name="generator" content="GTK-Doc V1.8 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="gnet-overview.html" title="GNet Overview">
<link rel="chapter" href="gnet-developers.html" title="GNet for developers">
<link rel="chapter" href="gnet-examples.html" title="GNet Examples">
<link rel="chapter" href="libgnet-reference.html" title="GNet Library Reference">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gnet-gnet.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="libgnet-reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GNet Network Library Reference Manual</th>
<td><a accesskey="n" href="gnet-tcp.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id325791" class="shortcut">Top</a>
 | 
<a href="#id327916" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="gnet-inetaddr"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id325791"></a><span class="refentrytitle">InetAddr</span>
</h2>
<p>InetAddr — Internet Address</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
#include <gnet.h>
<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>;
<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* <a href="gnet-inetaddr.html#gnet-inetaddr-new">gnet_inetaddr_new</a> (const gchar *hostname,
gint port);
typedef <a href="gnet-inetaddr.html#GInetAddrNewAsyncID">GInetAddrNewAsyncID</a>;
void (<a href="gnet-inetaddr.html#GInetAddrNewAsyncFunc">*GInetAddrNewAsyncFunc</a>) (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr,
gpointer data);
<a href="gnet-inetaddr.html#GInetAddrNewAsyncID">GInetAddrNewAsyncID</a> <a href="gnet-inetaddr.html#gnet-inetaddr-new-async">gnet_inetaddr_new_async</a> (const gchar *hostname,
gint port,
<a href="gnet-inetaddr.html#GInetAddrNewAsyncFunc">GInetAddrNewAsyncFunc</a> func,
gpointer data);
<a href="gnet-inetaddr.html#GInetAddrNewAsyncID">GInetAddrNewAsyncID</a> <a href="gnet-inetaddr.html#gnet-inetaddr-new-async-full">gnet_inetaddr_new_async_full</a> (const gchar *hostname,
gint port,
<a href="gnet-inetaddr.html#GInetAddrNewAsyncFunc">GInetAddrNewAsyncFunc</a> func,
gpointer data,
GDestroyNotify notify,
GMainContext *context,
gint priority);
void <a href="gnet-inetaddr.html#gnet-inetaddr-new-async-cancel">gnet_inetaddr_new_async_cancel</a> (<a href="gnet-inetaddr.html#GInetAddrNewAsyncID">GInetAddrNewAsyncID</a> id);
GList* <a href="gnet-inetaddr.html#gnet-inetaddr-new-list">gnet_inetaddr_new_list</a> (const gchar *hostname,
gint port);
void <a href="gnet-inetaddr.html#gnet-inetaddr-delete-list">gnet_inetaddr_delete_list</a> (GList *list);
typedef <a href="gnet-inetaddr.html#GInetAddrNewListAsyncID">GInetAddrNewListAsyncID</a>;
void (<a href="gnet-inetaddr.html#GInetAddrNewListAsyncFunc">*GInetAddrNewListAsyncFunc</a>) (GList *list,
gpointer data);
<a href="gnet-inetaddr.html#GInetAddrNewListAsyncID">GInetAddrNewListAsyncID</a> <a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async">gnet_inetaddr_new_list_async</a> (const gchar *hostname,
gint port,
<a href="gnet-inetaddr.html#GInetAddrNewListAsyncFunc">GInetAddrNewListAsyncFunc</a> func,
gpointer data);
<a href="gnet-inetaddr.html#GInetAddrNewListAsyncID">GInetAddrNewListAsyncID</a> <a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async-full">gnet_inetaddr_new_list_async_full</a>
(const gchar *hostname,
gint port,
<a href="gnet-inetaddr.html#GInetAddrNewListAsyncFunc">GInetAddrNewListAsyncFunc</a> func,
gpointer data,
GDestroyNotify notify,
GMainContext *context,
gint priority);
void <a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async-cancel">gnet_inetaddr_new_list_async_cancel</a> (<a href="gnet-inetaddr.html#GInetAddrNewListAsyncID">GInetAddrNewListAsyncID</a> id);
<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* <a href="gnet-inetaddr.html#gnet-inetaddr-new-nonblock">gnet_inetaddr_new_nonblock</a> (const gchar *hostname,
gint port);
<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* <a href="gnet-inetaddr.html#gnet-inetaddr-new-bytes">gnet_inetaddr_new_bytes</a> (const gchar *bytes,
const guint length);
<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* <a href="gnet-inetaddr.html#gnet-inetaddr-clone">gnet_inetaddr_clone</a> (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
void <a href="gnet-inetaddr.html#gnet-inetaddr-delete">gnet_inetaddr_delete</a> (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
void <a href="gnet-inetaddr.html#gnet-inetaddr-ref">gnet_inetaddr_ref</a> (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
void <a href="gnet-inetaddr.html#gnet-inetaddr-unref">gnet_inetaddr_unref</a> (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
gchar* <a href="gnet-inetaddr.html#gnet-inetaddr-get-name">gnet_inetaddr_get_name</a> (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
gchar* <a href="gnet-inetaddr.html#gnet-inetaddr-get-name-nonblock">gnet_inetaddr_get_name_nonblock</a> (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
typedef <a href="gnet-inetaddr.html#GInetAddrGetNameAsyncID">GInetAddrGetNameAsyncID</a>;
void (<a href="gnet-inetaddr.html#GInetAddrGetNameAsyncFunc">*GInetAddrGetNameAsyncFunc</a>) (gchar *hostname,
gpointer data);
<a href="gnet-inetaddr.html#GInetAddrGetNameAsyncID">GInetAddrGetNameAsyncID</a> <a href="gnet-inetaddr.html#gnet-inetaddr-get-name-async">gnet_inetaddr_get_name_async</a> (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr,
<a href="gnet-inetaddr.html#GInetAddrGetNameAsyncFunc">GInetAddrGetNameAsyncFunc</a> func,
gpointer data);
<a href="gnet-inetaddr.html#GInetAddrGetNameAsyncID">GInetAddrGetNameAsyncID</a> <a href="gnet-inetaddr.html#gnet-inetaddr-get-name-async-full">gnet_inetaddr_get_name_async_full</a>
(<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr,
<a href="gnet-inetaddr.html#GInetAddrGetNameAsyncFunc">GInetAddrGetNameAsyncFunc</a> func,
gpointer data,
GDestroyNotify notify,
GMainContext *context,
gint priority);
void <a href="gnet-inetaddr.html#gnet-inetaddr-get-name-async-cancel">gnet_inetaddr_get_name_async_cancel</a> (<a href="gnet-inetaddr.html#GInetAddrGetNameAsyncID">GInetAddrGetNameAsyncID</a> id);
#define <a href="gnet-inetaddr.html#GNET-INETADDR-MAX-LEN:CAPS">GNET_INETADDR_MAX_LEN</a>
gint <a href="gnet-inetaddr.html#gnet-inetaddr-get-length">gnet_inetaddr_get_length</a> (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
void <a href="gnet-inetaddr.html#gnet-inetaddr-get-bytes">gnet_inetaddr_get_bytes</a> (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr,
gchar *buffer);
void <a href="gnet-inetaddr.html#gnet-inetaddr-set-bytes">gnet_inetaddr_set_bytes</a> (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr,
const gchar *bytes,
gint length);
gchar* <a href="gnet-inetaddr.html#gnet-inetaddr-get-canonical-name">gnet_inetaddr_get_canonical_name</a> (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
gint <a href="gnet-inetaddr.html#gnet-inetaddr-get-port">gnet_inetaddr_get_port</a> (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
void <a href="gnet-inetaddr.html#gnet-inetaddr-set-port">gnet_inetaddr_set_port</a> (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr,
gint port);
gboolean <a href="gnet-inetaddr.html#gnet-inetaddr-is-canonical">gnet_inetaddr_is_canonical</a> (const gchar *hostname);
gboolean <a href="gnet-inetaddr.html#gnet-inetaddr-is-internet">gnet_inetaddr_is_internet</a> (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
gboolean <a href="gnet-inetaddr.html#gnet-inetaddr-is-private">gnet_inetaddr_is_private</a> (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
gboolean <a href="gnet-inetaddr.html#gnet-inetaddr-is-reserved">gnet_inetaddr_is_reserved</a> (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
gboolean <a href="gnet-inetaddr.html#gnet-inetaddr-is-loopback">gnet_inetaddr_is_loopback</a> (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
gboolean <a href="gnet-inetaddr.html#gnet-inetaddr-is-multicast">gnet_inetaddr_is_multicast</a> (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
gboolean <a href="gnet-inetaddr.html#gnet-inetaddr-is-broadcast">gnet_inetaddr_is_broadcast</a> (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
gboolean <a href="gnet-inetaddr.html#gnet-inetaddr-is-ipv4">gnet_inetaddr_is_ipv4</a> (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
gboolean <a href="gnet-inetaddr.html#gnet-inetaddr-is-ipv6">gnet_inetaddr_is_ipv6</a> (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
guint <a href="gnet-inetaddr.html#gnet-inetaddr-hash">gnet_inetaddr_hash</a> (gconstpointer p);
gboolean <a href="gnet-inetaddr.html#gnet-inetaddr-equal">gnet_inetaddr_equal</a> (gconstpointer p1,
gconstpointer p2);
gboolean <a href="gnet-inetaddr.html#gnet-inetaddr-noport-equal">gnet_inetaddr_noport_equal</a> (gconstpointer p1,
gconstpointer p2);
gchar* <a href="gnet-inetaddr.html#gnet-inetaddr-get-host-name">gnet_inetaddr_get_host_name</a> (void);
<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* <a href="gnet-inetaddr.html#gnet-inetaddr-get-host-addr">gnet_inetaddr_get_host_addr</a> (void);
<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* <a href="gnet-inetaddr.html#gnet-inetaddr-autodetect-internet-interface">gnet_inetaddr_autodetect_internet_interface</a>
(void);
<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* <a href="gnet-inetaddr.html#gnet-inetaddr-get-interface-to">gnet_inetaddr_get_interface_to</a> (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);
<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* <a href="gnet-inetaddr.html#gnet-inetaddr-get-internet-interface">gnet_inetaddr_get_internet_interface</a>
(void);
gboolean <a href="gnet-inetaddr.html#gnet-inetaddr-is-internet-domainname">gnet_inetaddr_is_internet_domainname</a>
(const gchar *name);
GList* <a href="gnet-inetaddr.html#gnet-inetaddr-list-interfaces">gnet_inetaddr_list_interfaces</a> (void);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id327916"></a><h2>Description</h2>
<p>
A <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> represents an internet address. This module provides
functions for making DNS and reverse DNS lookups (blocking and
asynchronously) and for working with <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>'s.
</p>
<p>
Create a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> by calling <a href="gnet-inetaddr.html#gnet-inetaddr-new"><code class="function">gnet_inetaddr_new()</code></a>. This function
will perform a DNS lookup and creates a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> representing the
address. This function blocks. The function
<a href="gnet-inetaddr.html#gnet-inetaddr-new-async"><code class="function">gnet_inetaddr_new_async()</code></a> performs the lookup asynchronously and calls
a callback with the <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> when the lookup completes. An
asynchronous lookup can be canceled by calling
<a href="gnet-inetaddr.html#gnet-inetaddr-new-async-cancel"><code class="function">gnet_inetaddr_new_async_cancel()</code></a>.
</p>
<p>
Technically a DNS lookup can map a name to several addresses. Use
<a href="gnet-inetaddr.html#gnet-inetaddr-new-list"><code class="function">gnet_inetaddr_new_list()</code></a> or <a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async"><code class="function">gnet_inetaddr_new_list_async()</code></a> to get this
list. Use <a href="gnet-inetaddr.html#gnet-inetaddr-delete-list"><code class="function">gnet_inetaddr_delete_list()</code></a> to delete the list.
</p>
<p>
This module can also make reverse DNS lookups (i.e., map an address to
a hostname). Call <a href="gnet-inetaddr.html#gnet-inetaddr-get-name"><code class="function">gnet_inetaddr_get_name()</code></a> to get the hostname from
an address. This function blocks. Its asynchronous counterpart is
<code class="function">gnet_inetadr_get_name_async()</code>. To get the canonical name, or dotted
decimal address, call <a href="gnet-inetaddr.html#gnet-inetaddr-get-canonical-name"><code class="function">gnet_inetaddr_get_canonical_name()</code></a>.
</p>
<p>
To get the host's address, call <code class="function">gnet_inetaddr_gethostaddr()</code>. This
creates a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> by performing a DNS lookup on the host's name.
To get the list of all the host's interfaces, call
<a href="gnet-inetaddr.html#gnet-inetaddr-list-interfaces"><code class="function">gnet_inetaddr_list_interfaces()</code></a>. The function
<a href="gnet-inetaddr.html#gnet-inetaddr-autodetect-internet-interface"><code class="function">gnet_inetaddr_autodetect_internet_interface()</code></a> uses this function and
heuristics to find an interface connected to the internet. This can
be used to automatically configure peer-to-peer applications.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id328128"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id328138"></a><h3>
<a name="GInetAddr"></a>GInetAddr</h3>
<a class="indexterm" name="id328150"></a><pre class="programlisting">typedef struct _GInetAddr GInetAddr;</pre>
<p>
GInetAddr is an internet address.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id328169"></a><h3>
<a name="gnet-inetaddr-new"></a>gnet_inetaddr_new ()</h3>
<a class="indexterm" name="id328181"></a><pre class="programlisting"><a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* gnet_inetaddr_new (const gchar *hostname,
gint port);</pre>
<p>
Creates a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> from a host name and port. This function
makes a DNS lookup on the host name so it may block. The host
name may resolve to multiple addresses. If this occurs, the first
address in the list is returned. Use <a href="gnet-inetaddr.html#gnet-inetaddr-new-list"><code class="function">gnet_inetaddr_new_list()</code></a> to
get the complete list.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>hostname</code></em> :</span></td>
<td> host name
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>port</code></em> :</span></td>
<td> port number (0 if the port doesn't matter)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a new <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>; NULL on error.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id328290"></a><h3>
<a name="GInetAddrNewAsyncID"></a>GInetAddrNewAsyncID</h3>
<a class="indexterm" name="id328302"></a><pre class="programlisting">typedef struct _GInetAddrNewState * GInetAddrNewAsyncID;
</pre>
<p>
ID of an asynchronous GInetAddr creation/lookup started with
<a href="gnet-inetaddr.html#gnet-inetaddr-new-async"><code class="function">gnet_inetaddr_new_async()</code></a>. The creation can be canceled by
calling <a href="gnet-inetaddr.html#gnet-inetaddr-new-async-cancel"><code class="function">gnet_inetaddr_new_async_cancel()</code></a> with the ID.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id328342"></a><h3>
<a name="GInetAddrNewAsyncFunc"></a>GInetAddrNewAsyncFunc ()</h3>
<a class="indexterm" name="id328354"></a><pre class="programlisting">void (*GInetAddrNewAsyncFunc) (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr,
gpointer data);</pre>
<p>
Callback for <a href="gnet-inetaddr.html#gnet-inetaddr-new-async"><code class="function">gnet_inetaddr_new_async()</code></a>. Callee owns the address.
The address will be NULL if the lookup failed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> InetAddr that was looked up (callee owned)
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>data</code></em> :</span></td>
<td> User data
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id328435"></a><h3>
<a name="gnet-inetaddr-new-async"></a>gnet_inetaddr_new_async ()</h3>
<a class="indexterm" name="id328447"></a><pre class="programlisting"><a href="gnet-inetaddr.html#GInetAddrNewAsyncID">GInetAddrNewAsyncID</a> gnet_inetaddr_new_async (const gchar *hostname,
gint port,
<a href="gnet-inetaddr.html#GInetAddrNewAsyncFunc">GInetAddrNewAsyncFunc</a> func,
gpointer data);</pre>
<p>
Asynchronously creates a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> from a host name and port.
The callback is called once the <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> is created or an error
occurs during lookup. The callback will not be called during the
call to this function.
</p>
<p>
See <a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async"><code class="function">gnet_inetaddr_new_list_async()</code></a> for implementation notes.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>hostname</code></em> :</span></td>
<td> host name
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>port</code></em> :</span></td>
<td> port number (0 if the port doesn't matter)
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>func</code></em> :</span></td>
<td> callback function
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>data</code></em> :</span></td>
<td> data to pass to <em class="parameter"><code>func</code></em> on the callback
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the ID of the lookup; NULL on failure. The ID can be used
with <a href="gnet-inetaddr.html#gnet-inetaddr-new-async-cancel"><code class="function">gnet_inetaddr_new_async_cancel()</code></a> to cancel the lookup.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id328619"></a><h3>
<a name="gnet-inetaddr-new-async-full"></a>gnet_inetaddr_new_async_full ()</h3>
<a class="indexterm" name="id328634"></a><pre class="programlisting"><a href="gnet-inetaddr.html#GInetAddrNewAsyncID">GInetAddrNewAsyncID</a> gnet_inetaddr_new_async_full (const gchar *hostname,
gint port,
<a href="gnet-inetaddr.html#GInetAddrNewAsyncFunc">GInetAddrNewAsyncFunc</a> func,
gpointer data,
GDestroyNotify notify,
GMainContext *context,
gint priority);</pre>
<p>
Asynchronously creates a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> from a host name and port.
The callback is called once the <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> is created or an error
occurs during lookup. The callback will not be called during the
call to this function.
</p>
<p>
See <a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async"><code class="function">gnet_inetaddr_new_list_async()</code></a> for implementation notes.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>hostname</code></em> :</span></td>
<td> host name
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>port</code></em> :</span></td>
<td> port number (0 if the port doesn't matter)
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>func</code></em> :</span></td>
<td> callback function
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>data</code></em> :</span></td>
<td> data to pass to <em class="parameter"><code>func</code></em> on the callback, or NULL
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>notify</code></em> :</span></td>
<td> function to call to free <em class="parameter"><code>data</code></em>, or NULL
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>context</code></em> :</span></td>
<td> the <span class="type">GMainContext</span> to use for notifications, or NULL for the
default GLib main context. If in doubt, pass NULL.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>priority</code></em> :</span></td>
<td> the priority with which to schedule notifications in the
main context, e.g. <span class="type">G_PRIORITY_DEFAULT</span> or <span class="type">G_PRIORITY_HIGH</span>.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the ID of the lookup; NULL on failure. The ID can be used
with <a href="gnet-inetaddr.html#gnet-inetaddr-new-async-cancel"><code class="function">gnet_inetaddr_new_async_cancel()</code></a> to cancel the lookup.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.0.8
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id328909"></a><h3>
<a name="gnet-inetaddr-new-async-cancel"></a>gnet_inetaddr_new_async_cancel ()</h3>
<a class="indexterm" name="id328921"></a><pre class="programlisting">void gnet_inetaddr_new_async_cancel (<a href="gnet-inetaddr.html#GInetAddrNewAsyncID">GInetAddrNewAsyncID</a> id);</pre>
<p>
Cancels an asynchronous <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> creation that was started with
<a href="gnet-inetaddr.html#gnet-inetaddr-new-async"><code class="function">gnet_inetaddr_new_async()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><em class="parameter"><code>id</code></em> :</span></td>
<td> ID of the lookup
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id328989"></a><h3>
<a name="gnet-inetaddr-new-list"></a>gnet_inetaddr_new_list ()</h3>
<a class="indexterm" name="id329001"></a><pre class="programlisting">GList* gnet_inetaddr_new_list (const gchar *hostname,
gint port);</pre>
<p>
Creates a GList of <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>'s from a host name and port. This
function makes a DNS lookup on the host name so it may block.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>hostname</code></em> :</span></td>
<td> host name
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>port</code></em> :</span></td>
<td> port number (0 if the port doesn't matter)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a GList of <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> structures or NULL on error.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id329098"></a><h3>
<a name="gnet-inetaddr-delete-list"></a>gnet_inetaddr_delete_list ()</h3>
<a class="indexterm" name="id329111"></a><pre class="programlisting">void gnet_inetaddr_delete_list (GList *list);</pre>
<p>
Deletes a GList of <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>'s.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><em class="parameter"><code>list</code></em> :</span></td>
<td> GList of <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>'s
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id329176"></a><h3>
<a name="GInetAddrNewListAsyncID"></a>GInetAddrNewListAsyncID</h3>
<a class="indexterm" name="id329188"></a><pre class="programlisting">typedef struct _GInetAddrNewListState * GInetAddrNewListAsyncID;
</pre>
<p>
ID of an asynchronous GInetAddr list creation/lookup started with
<a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async"><code class="function">gnet_inetaddr_new_list_async()</code></a>. The creation can be canceled by
calling <a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async-cancel"><code class="function">gnet_inetaddr_new_list_async_cancel()</code></a> with the ID.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id329228"></a><h3>
<a name="GInetAddrNewListAsyncFunc"></a>GInetAddrNewListAsyncFunc ()</h3>
<a class="indexterm" name="id329240"></a><pre class="programlisting">void (*GInetAddrNewListAsyncFunc) (GList *list,
gpointer data);</pre>
<p>
Callback for <a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async"><code class="function">gnet_inetaddr_new_list_async()</code></a>. Callee owns the
list of GInetAddrs. The list is NULL if the lookup failed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>list</code></em> :</span></td>
<td> List of GInetAddr's (callee owned)
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>data</code></em> :</span></td>
<td> User data
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id329322"></a><h3>
<a name="gnet-inetaddr-new-list-async"></a>gnet_inetaddr_new_list_async ()</h3>
<a class="indexterm" name="id329334"></a><pre class="programlisting"><a href="gnet-inetaddr.html#GInetAddrNewListAsyncID">GInetAddrNewListAsyncID</a> gnet_inetaddr_new_list_async (const gchar *hostname,
gint port,
<a href="gnet-inetaddr.html#GInetAddrNewListAsyncFunc">GInetAddrNewListAsyncFunc</a> func,
gpointer data);</pre>
<p>
Asynchronously creates a GList of <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>'s from a host name
and port. The callback is called once the list is created or an
error occurs during lookup. The callback will not be called
during the call to <a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async"><code class="function">gnet_inetaddr_new_list_async()</code></a>. The list
passed in the callback is callee owned (meaning that it is your
responsibility to free the list and each <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> in the list).
</p>
<p>
If you need to lookup hundreds of addresses, we recommend calling
g_main_iteration(FALSE) between calls. This will help prevent an
explosion of threads.
</p>
<p>
If you need a more robust library for Unix, look at <a href="http://www.gnu.org/software/adns/adns.html" target="_top">GNU ADNS</a>.
GNU ADNS is under the GNU GPL. This library does not use threads
or processes.
</p>
<p>
The Windows version is molded after the Unix GThread version.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>hostname</code></em> :</span></td>
<td> host name
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>port</code></em> :</span></td>
<td> port number (0 if the port doesn't matter)
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>func</code></em> :</span></td>
<td> callback function
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>data</code></em> :</span></td>
<td> data to pass to <em class="parameter"><code>func</code></em> on the callback
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the ID of the lookup; NULL on failure. The ID can be
used with <a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async-cancel"><code class="function">gnet_inetaddr_new_list_async_cancel()</code></a> to cancel the
lookup.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id329523"></a><h3>
<a name="gnet-inetaddr-new-list-async-full"></a>gnet_inetaddr_new_list_async_full ()</h3>
<a class="indexterm" name="id329538"></a><pre class="programlisting"><a href="gnet-inetaddr.html#GInetAddrNewListAsyncID">GInetAddrNewListAsyncID</a> gnet_inetaddr_new_list_async_full
(const gchar *hostname,
gint port,
<a href="gnet-inetaddr.html#GInetAddrNewListAsyncFunc">GInetAddrNewListAsyncFunc</a> func,
gpointer data,
GDestroyNotify notify,
GMainContext *context,
gint priority);</pre>
<p>
Asynchronously creates a GList of <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>'s from a host name
and port. The callback is called once the list is created or an
error occurs during lookup. The callback will not be called
during the call to <a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async"><code class="function">gnet_inetaddr_new_list_async()</code></a>. The list
passed in the callback is callee owned (meaning that it is your
responsibility to free the list and each <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> in the list).
</p>
<p>
If you need to lookup hundreds of addresses, we recommend calling
g_main_iteration(FALSE) between calls. This will help prevent an
explosion of threads.
</p>
<p>
If you need a more robust library for Unix, look at <a href="http://www.gnu.org/software/adns/adns.html" target="_top">GNU ADNS</a>.
GNU ADNS is under the GNU GPL. This library does not use threads
or processes.
</p>
<p>
The Windows version is molded after the Unix GThread version.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>hostname</code></em> :</span></td>
<td> host name
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>port</code></em> :</span></td>
<td> port number (0 if the port doesn't matter)
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>func</code></em> :</span></td>
<td> callback function
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>data</code></em> :</span></td>
<td> data to pass to <em class="parameter"><code>func</code></em> on the callback, or NULL
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>notify</code></em> :</span></td>
<td> function to call to free <em class="parameter"><code>data</code></em>, or NULL
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>context</code></em> :</span></td>
<td> the <span class="type">GMainContext</span> to use for notifications, or NULL for the
default GLib main context. If in doubt, pass NULL.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>priority</code></em> :</span></td>
<td> the priority with which to schedule notifications in the
main context, e.g. <span class="type">G_PRIORITY_DEFAULT</span> or <span class="type">G_PRIORITY_HIGH</span>.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the ID of the lookup; NULL on failure. The ID can be
used with <a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async-cancel"><code class="function">gnet_inetaddr_new_list_async_cancel()</code></a> to cancel the
lookup.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.0.8
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id329828"></a><h3>
<a name="gnet-inetaddr-new-list-async-cancel"></a>gnet_inetaddr_new_list_async_cancel ()</h3>
<a class="indexterm" name="id329841"></a><pre class="programlisting">void gnet_inetaddr_new_list_async_cancel (<a href="gnet-inetaddr.html#GInetAddrNewListAsyncID">GInetAddrNewListAsyncID</a> id);</pre>
<p>
Cancels an asynchronous <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> list creation that was started
with <a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async"><code class="function">gnet_inetaddr_new_list_async()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><em class="parameter"><code>id</code></em> :</span></td>
<td> ID of the lookup
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id329908"></a><h3>
<a name="gnet-inetaddr-new-nonblock"></a>gnet_inetaddr_new_nonblock ()</h3>
<a class="indexterm" name="id329921"></a><pre class="programlisting"><a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* gnet_inetaddr_new_nonblock (const gchar *hostname,
gint port);</pre>
<p>
Creates a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> from a host name and port without blocking.
This function does not make a DNS lookup and will fail if creating
the address would require a DNS lookup.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>hostname</code></em> :</span></td>
<td> host name
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>port</code></em> :</span></td>
<td> port number (0 if the port doesn't matter)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a new <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>, or NULL if there was a failure or the
function would block.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id330019"></a><h3>
<a name="gnet-inetaddr-new-bytes"></a>gnet_inetaddr_new_bytes ()</h3>
<a class="indexterm" name="id330031"></a><pre class="programlisting"><a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* gnet_inetaddr_new_bytes (const gchar *bytes,
const guint length);</pre>
<p>
Creates a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> from raw bytes. The bytes should be in
network byte order (big endian). There should be 4 bytes if it's
an IPv4 address and 16 bytees if it's an IPv6 address. The port
is set to 0.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>bytes</code></em> :</span></td>
<td> address in raw bytes
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>length</code></em> :</span></td>
<td> length of <em class="parameter"><code>bytes</code></em> (4 if IPv4, 16 if IPv6)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a new <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>, or NULL if there was a failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id330136"></a><h3>
<a name="gnet-inetaddr-clone"></a>gnet_inetaddr_clone ()</h3>
<a class="indexterm" name="id330148"></a><pre class="programlisting"><a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* gnet_inetaddr_clone (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Copies a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a copy of <em class="parameter"><code>inetaddr</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id330228"></a><h3>
<a name="gnet-inetaddr-delete"></a>gnet_inetaddr_delete ()</h3>
<a class="indexterm" name="id330240"></a><pre class="programlisting">void gnet_inetaddr_delete (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Deletes a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id330304"></a><h3>
<a name="gnet-inetaddr-ref"></a>gnet_inetaddr_ref ()</h3>
<a class="indexterm" name="id330316"></a><pre class="programlisting">void gnet_inetaddr_ref (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Adds a reference to a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id330381"></a><h3>
<a name="gnet-inetaddr-unref"></a>gnet_inetaddr_unref ()</h3>
<a class="indexterm" name="id330393"></a><pre class="programlisting">void gnet_inetaddr_unref (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Removes a reference from a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>. A <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> is deleted
when the reference count reaches 0.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id330466"></a><h3>
<a name="gnet-inetaddr-get-name"></a>gnet_inetaddr_get_name ()</h3>
<a class="indexterm" name="id330478"></a><pre class="programlisting">gchar* gnet_inetaddr_get_name (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Gets the host name for a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>. This functions makes a
reverse DNS lookup on the address so it may block. The canonical
name is returned if the address has no host name.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the host name for the <em class="parameter"><code>inetaddr</code></em>; NULL on error.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id330560"></a><h3>
<a name="gnet-inetaddr-get-name-nonblock"></a>gnet_inetaddr_get_name_nonblock ()</h3>
<a class="indexterm" name="id330572"></a><pre class="programlisting">gchar* gnet_inetaddr_get_name_nonblock (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Gets the host name for a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>. This function does not make
a reverse DNS lookup and will fail if getting the name would
require a reverse DNS lookup.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the host name for the <em class="parameter"><code>inetaddr</code></em>, or NULL if there was an
error or it would require blocking.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id330655"></a><h3>
<a name="GInetAddrGetNameAsyncID"></a>GInetAddrGetNameAsyncID</h3>
<a class="indexterm" name="id330667"></a><pre class="programlisting">typedef struct _GInetAddrReverseAsyncState * GInetAddrGetNameAsyncID;
</pre>
<p>
ID of an asynchronous InetAddr name lookup started with
<a href="gnet-inetaddr.html#gnet-inetaddr-get-name-async"><code class="function">gnet_inetaddr_get_name_async()</code></a>. The lookup can be canceled by
calling <a href="gnet-inetaddr.html#gnet-inetaddr-get-name-async-cancel"><code class="function">gnet_inetaddr_get_name_async_cancel()</code></a> with the ID.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id330707"></a><h3>
<a name="GInetAddrGetNameAsyncFunc"></a>GInetAddrGetNameAsyncFunc ()</h3>
<a class="indexterm" name="id330720"></a><pre class="programlisting">void (*GInetAddrGetNameAsyncFunc) (gchar *hostname,
gpointer data);</pre>
<p>
Callback for <a href="gnet-inetaddr.html#gnet-inetaddr-get-name-async"><code class="function">gnet_inetaddr_get_name_async()</code></a>. Callee (that is: you) owns
the name. Free it with <code class="function">g_free()</code> when no longer needed. The name will be
NULL if the lookup failed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>hostname</code></em> :</span></td>
<td> Canonical name of the address (callee owned), NULL on failure
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>data</code></em> :</span></td>
<td> User data
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id330813"></a><h3>
<a name="gnet-inetaddr-get-name-async"></a>gnet_inetaddr_get_name_async ()</h3>
<a class="indexterm" name="id330826"></a><pre class="programlisting"><a href="gnet-inetaddr.html#GInetAddrGetNameAsyncID">GInetAddrGetNameAsyncID</a> gnet_inetaddr_get_name_async (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr,
<a href="gnet-inetaddr.html#GInetAddrGetNameAsyncFunc">GInetAddrGetNameAsyncFunc</a> func,
gpointer data);</pre>
<p>
Asynchronously gets the host name for a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>. The callback
is called once the reverse DNS lookup is complete. The call back
will not be called during the call to this function.
</p>
<p>
See <a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async"><code class="function">gnet_inetaddr_new_list_async()</code></a> for implementation notes.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>func</code></em> :</span></td>
<td> callback function
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>data</code></em> :</span></td>
<td> data to pass to <em class="parameter"><code>func</code></em> on the callback
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the ID of the lookup; NULL on failure. The ID can be
used with <a href="gnet-inetaddr.html#gnet-inetaddr-get-name-async-cancel"><code class="function">gnet_inetaddr_get_name_async_cancel()</code></a> to cancel the
lookup.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id330976"></a><h3>
<a name="gnet-inetaddr-get-name-async-full"></a>gnet_inetaddr_get_name_async_full ()</h3>
<a class="indexterm" name="id330991"></a><pre class="programlisting"><a href="gnet-inetaddr.html#GInetAddrGetNameAsyncID">GInetAddrGetNameAsyncID</a> gnet_inetaddr_get_name_async_full
(<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr,
<a href="gnet-inetaddr.html#GInetAddrGetNameAsyncFunc">GInetAddrGetNameAsyncFunc</a> func,
gpointer data,
GDestroyNotify notify,
GMainContext *context,
gint priority);</pre>
<p>
Asynchronously gets the host name for a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>. The callback
is called once the reverse DNS lookup is complete. The callback
will not be called during the call to this function.
</p>
<p>
See <a href="gnet-inetaddr.html#gnet-inetaddr-new-list-async-full"><code class="function">gnet_inetaddr_new_list_async_full()</code></a> for implementation notes.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>func</code></em> :</span></td>
<td> callback function
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>data</code></em> :</span></td>
<td> data to pass to <em class="parameter"><code>func</code></em> on the callback
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>notify</code></em> :</span></td>
<td> function to call to free <em class="parameter"><code>data</code></em>, or NULL
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>context</code></em> :</span></td>
<td> the <span class="type">GMainContext</span> to use for notifications, or NULL for the
default GLib main context. If in doubt, pass NULL.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>priority</code></em> :</span></td>
<td> the priority with which to schedule notifications in the
main context, e.g. <span class="type">G_PRIORITY_DEFAULT</span> or <span class="type">G_PRIORITY_HIGH</span>.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the ID of the lookup; NULL on failure. The ID can be
used with <a href="gnet-inetaddr.html#gnet-inetaddr-get-name-async-cancel"><code class="function">gnet_inetaddr_get_name_async_cancel()</code></a> to cancel the
lookup.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.0.8
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id331243"></a><h3>
<a name="gnet-inetaddr-get-name-async-cancel"></a>gnet_inetaddr_get_name_async_cancel ()</h3>
<a class="indexterm" name="id331255"></a><pre class="programlisting">void gnet_inetaddr_get_name_async_cancel (<a href="gnet-inetaddr.html#GInetAddrGetNameAsyncID">GInetAddrGetNameAsyncID</a> id);</pre>
<p>
Cancels an asynchronous name lookup that was started with
<a href="gnet-inetaddr.html#gnet-inetaddr-get-name-async"><code class="function">gnet_inetaddr_get_name_async()</code></a>. This function should only be
called from the application's main thread, ie. the thread in which
context the callback delivering the result would be called (In a
GTK+/GUI application this would be your normal GUI thread).</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><em class="parameter"><code>id</code></em> :</span></td>
<td> ID of the lookup
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id331317"></a><h3>
<a name="GNET-INETADDR-MAX-LEN:CAPS"></a>GNET_INETADDR_MAX_LEN</h3>
<a class="indexterm" name="id331330"></a><pre class="programlisting">#define GNET_INETADDR_MAX_LEN 16
</pre>
<p>
Maximum length of a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>'s address in bytes. This can be
used to allocate a buffer large enough for
<a href="gnet-inetaddr.html#gnet-inetaddr-get-bytes"><code class="function">gnet_inetaddr_get_bytes()</code></a>.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id331367"></a><h3>
<a name="gnet-inetaddr-get-length"></a>gnet_inetaddr_get_length ()</h3>
<a class="indexterm" name="id331379"></a><pre class="programlisting">gint gnet_inetaddr_get_length (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Get the length of a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>'s address in bytes. An IPv4
address is 4 bytes long. An IPv6 address is 16 bytes long.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the length in bytes.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id331455"></a><h3>
<a name="gnet-inetaddr-get-bytes"></a>gnet_inetaddr_get_bytes ()</h3>
<a class="indexterm" name="id331467"></a><pre class="programlisting">void gnet_inetaddr_get_bytes (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr,
gchar *buffer);</pre>
<p>
Get a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>'s address as bytes. <em class="parameter"><code>buffer</code></em> should be 4 bytes
long for an IPv4 address or 16 bytes long for an IPv6 address.
Use <a href="gnet-inetaddr.html#GNET-INETADDR-MAX-LEN:CAPS"><code class="literal">GNET_INETADDR_MAX_LEN</code></a> when allocating a static buffer and
<a href="gnet-inetaddr.html#gnet-inetaddr-get-length"><code class="function">gnet_inetaddr_get_length()</code></a> when allocating a dynamic buffer.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>buffer</code></em> :</span></td>
<td> buffer to store address in
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id331581"></a><h3>
<a name="gnet-inetaddr-set-bytes"></a>gnet_inetaddr_set_bytes ()</h3>
<a class="indexterm" name="id331594"></a><pre class="programlisting">void gnet_inetaddr_set_bytes (<a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr,
const gchar *bytes,
gint length);</pre>
<p>
Sets the address of a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> from bytes. <em class="parameter"><code>buffer</code></em> will be
4 bytes long for an IPv4 address and 16 bytes long for an IPv6
address.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>bytes</code></em> :</span></td>
<td> address in raw bytes
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>length</code></em> :</span></td>
<td> length of <em class="parameter"><code>bytes</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id331713"></a><h3>
<a name="gnet-inetaddr-get-canonical-name"></a>gnet_inetaddr_get_canonical_name ()</h3>
<a class="indexterm" name="id331725"></a><pre class="programlisting">gchar* gnet_inetaddr_get_canonical_name (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Gets the canonical name of a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>. An IPv4 canonical name
is a dotted decimal name (e.g., 141.213.8.59). An IPv6 canonical
name is a semicoloned hexidecimal name (e.g., 23:de:ad:be:ef).</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the canonical name; NULL on error.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id331802"></a><h3>
<a name="gnet-inetaddr-get-port"></a>gnet_inetaddr_get_port ()</h3>
<a class="indexterm" name="id331814"></a><pre class="programlisting">gint gnet_inetaddr_get_port (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Gets the port number of a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the port number.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id331889"></a><h3>
<a name="gnet-inetaddr-set-port"></a>gnet_inetaddr_set_port ()</h3>
<a class="indexterm" name="id331902"></a><pre class="programlisting">void gnet_inetaddr_set_port (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr,
gint port);</pre>
<p>
Set the port number of a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>port</code></em> :</span></td>
<td> new port number
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id331987"></a><h3>
<a name="gnet-inetaddr-is-canonical"></a>gnet_inetaddr_is_canonical ()</h3>
<a class="indexterm" name="id332000"></a><pre class="programlisting">gboolean gnet_inetaddr_is_canonical (const gchar *hostname);</pre>
<p>
Checks if the host name is in canonical form.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>hostname</code></em> :</span></td>
<td> host name
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> TRUE if <em class="parameter"><code>name</code></em> is canonical; FALSE otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id332066"></a><h3>
<a name="gnet-inetaddr-is-internet"></a>gnet_inetaddr_is_internet ()</h3>
<a class="indexterm" name="id332078"></a><pre class="programlisting">gboolean gnet_inetaddr_is_internet (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Checks if a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> is a sensible internet address. This mean
it is not private, reserved, loopback, multicast, or broadcast.
</p>
<p>
Note that private and loopback address are often valid addresses,
so this should only be used to check for general internet
connectivity. That is, if the address passes, it is reachable on
the internet.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> TRUE if the address is an internet address; FALSE
otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id332160"></a><h3>
<a name="gnet-inetaddr-is-private"></a>gnet_inetaddr_is_private ()</h3>
<a class="indexterm" name="id332172"></a><pre class="programlisting">gboolean gnet_inetaddr_is_private (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Checks if a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> is an address reserved for private
networks. For IPv4, this includes:
</p>
<p>
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
</p>
<p>
(from RFC 1918. See also draft-manning-dsua-02.txt)
</p>
<p>
For IPv6, this includes link local addresses (fe80::/64) and site
local addresses (fec0::/64).</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> TRUE if <em class="parameter"><code>inetaddr</code></em> is private; FALSE otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id332267"></a><h3>
<a name="gnet-inetaddr-is-reserved"></a>gnet_inetaddr_is_reserved ()</h3>
<a class="indexterm" name="id332279"></a><pre class="programlisting">gboolean gnet_inetaddr_is_reserved (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Checks if a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> is reserved for some purpose. This
excludes addresses reserved for private networks.
</p>
<p>
For IPv4, we check for:
0.0.0.0/16 (top 16 bits are 0's)
Class E (top 5 bits are 11110)
</p>
<p>
For IPv6, we check for the 00000000 prefix.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> TRUE if <em class="parameter"><code>inetaddr</code></em> is reserved; FALSE otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id332369"></a><h3>
<a name="gnet-inetaddr-is-loopback"></a>gnet_inetaddr_is_loopback ()</h3>
<a class="indexterm" name="id332382"></a><pre class="programlisting">gboolean gnet_inetaddr_is_loopback (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Checks if a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> is a loopback address. The IPv4 loopback
addresses have the prefix 127.0.0.1/24. The IPv6 loopback address
is ::1.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> TRUE if <em class="parameter"><code>inetaddr</code></em> is a loopback address; FALSE otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id332464"></a><h3>
<a name="gnet-inetaddr-is-multicast"></a>gnet_inetaddr_is_multicast ()</h3>
<a class="indexterm" name="id332476"></a><pre class="programlisting">gboolean gnet_inetaddr_is_multicast (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Checks if a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> is a multicast address. IPv4 multicast
addresses are in the range 224.0.0.0 to 239.255.255.255 (ie, the
top four bits are 1110). IPv6 multicast addresses have the prefix
FF.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> TRUE if <em class="parameter"><code>inetaddr</code></em> is a multicast address; FALSE
otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id332559"></a><h3>
<a name="gnet-inetaddr-is-broadcast"></a>gnet_inetaddr_is_broadcast ()</h3>
<a class="indexterm" name="id332571"></a><pre class="programlisting">gboolean gnet_inetaddr_is_broadcast (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Checks if a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> is a broadcast address. The broadcast
address is 255.255.255.255. (Network broadcast addresses are
network dependent.)</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> TRUE if <em class="parameter"><code>inetaddr</code></em> is a broadcast address; FALSE
otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id332654"></a><h3>
<a name="gnet-inetaddr-is-ipv4"></a>gnet_inetaddr_is_ipv4 ()</h3>
<a class="indexterm" name="id332666"></a><pre class="programlisting">gboolean gnet_inetaddr_is_ipv4 (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Checks if a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> is an IPv4 address.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> TRUE if <em class="parameter"><code>inetaddr</code></em> is an IPv4 address; FALSE otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id332747"></a><h3>
<a name="gnet-inetaddr-is-ipv6"></a>gnet_inetaddr_is_ipv6 ()</h3>
<a class="indexterm" name="id332759"></a><pre class="programlisting">gboolean gnet_inetaddr_is_ipv6 (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Check if a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> is an IPv6 address.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> TRUE if <em class="parameter"><code>inetaddr</code></em> is an IPv6 address; FALSE otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id332840"></a><h3>
<a name="gnet-inetaddr-hash"></a>gnet_inetaddr_hash ()</h3>
<a class="indexterm" name="id332852"></a><pre class="programlisting">guint gnet_inetaddr_hash (gconstpointer p);</pre>
<p>
Creates a hash code for a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> for use with GHashTable.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>p</code></em> :</span></td>
<td> Pointer to an <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the hash code for <em class="parameter"><code>p</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id332933"></a><h3>
<a name="gnet-inetaddr-equal"></a>gnet_inetaddr_equal ()</h3>
<a class="indexterm" name="id332945"></a><pre class="programlisting">gboolean gnet_inetaddr_equal (gconstpointer p1,
gconstpointer p2);</pre>
<p>
Compares two <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>'s for equality. IPv4 and IPv6 addresses
are always unequal.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>p1</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>p2</code></em> :</span></td>
<td> another <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> TRUE if they are equal; FALSE otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id333050"></a><h3>
<a name="gnet-inetaddr-noport-equal"></a>gnet_inetaddr_noport_equal ()</h3>
<a class="indexterm" name="id333062"></a><pre class="programlisting">gboolean gnet_inetaddr_noport_equal (gconstpointer p1,
gconstpointer p2);</pre>
<p>
Compares two <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>'s for equality, but does not compare the
port numbers.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>p1</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>p2</code></em> :</span></td>
<td> another <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> TRUE if they are equal; FALSE otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id333166"></a><h3>
<a name="gnet-inetaddr-get-host-name"></a>gnet_inetaddr_get_host_name ()</h3>
<a class="indexterm" name="id333178"></a><pre class="programlisting">gchar* gnet_inetaddr_get_host_name (void);</pre>
<p>
Gets the host's name.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the name of the host; NULL on error.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id333218"></a><h3>
<a name="gnet-inetaddr-get-host-addr"></a>gnet_inetaddr_get_host_addr ()</h3>
<a class="indexterm" name="id333230"></a><pre class="programlisting"><a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* gnet_inetaddr_get_host_addr (void);</pre>
<p>
Get the host's address.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the address of the host; NULL on error.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id333269"></a><h3>
<a name="gnet-inetaddr-autodetect-internet-interface"></a>gnet_inetaddr_autodetect_internet_interface ()</h3>
<a class="indexterm" name="id333282"></a><pre class="programlisting"><a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* gnet_inetaddr_autodetect_internet_interface
(void);</pre>
<p>
Finds an interface likely to be connected to the internet. This
function can be used to automatically configure peer-to-peer
applications. The function relies on heuristics and does not
always work correctly, especially if the host is behind a NAT.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> an address of an internet interface; NULL if it couldn't
find one or on error.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id333324"></a><h3>
<a name="gnet-inetaddr-get-interface-to"></a>gnet_inetaddr_get_interface_to ()</h3>
<a class="indexterm" name="id333337"></a><pre class="programlisting"><a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* gnet_inetaddr_get_interface_to (const <a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a> *inetaddr);</pre>
<p>
Figures out which local interface would be used to send a packet
to <em class="parameter"><code>inetaddr</code></em>. This works on some systems, but not others. We
recommend using <a href="gnet-inetaddr.html#gnet-inetaddr-autodetect-internet-interface"><code class="function">gnet_inetaddr_autodetect_internet_interface()</code></a> to
find an Internet interface since it's more likely to work.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>inetaddr</code></em> :</span></td>
<td> a <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the address of an interface used to route packets to
<em class="parameter"><code>inetaddr</code></em>; NULL if there is no such interface or the system does
not support this check.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id333429"></a><h3>
<a name="gnet-inetaddr-get-internet-interface"></a>gnet_inetaddr_get_internet_interface ()</h3>
<a class="indexterm" name="id333442"></a><pre class="programlisting"><a href="gnet-inetaddr.html#GInetAddr">GInetAddr</a>* gnet_inetaddr_get_internet_interface
(void);</pre>
<p>
Finds an internet interface. This function finds the first
interface that is an internet address. IPv6 policy is followed.
</p>
<p>
This function does not work on some systems. We recommend using
<a href="gnet-inetaddr.html#gnet-inetaddr-autodetect-internet-interface"><code class="function">gnet_inetaddr_autodetect_internet_interface()</code></a>, which performs
additional checks.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the address of an internet interface; NULL if no internet
interfaces or on error.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id333498"></a><h3>
<a name="gnet-inetaddr-is-internet-domainname"></a>gnet_inetaddr_is_internet_domainname ()</h3>
<a class="indexterm" name="id333510"></a><pre class="programlisting">gboolean gnet_inetaddr_is_internet_domainname
(const gchar *name);</pre>
<p>
Checks if a name is a sensible internet domain name. This
function uses heuristics. It does not use DNS and will not block.
For example, "localhost" and "10.10.23.42" are not sensible
internet domain names. (10.10.23.42 is a network address, but not
accessible to the internet at large.)</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>name</code></em> :</span></td>
<td> name
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> TRUE if <em class="parameter"><code>name</code></em> is a sensible Internet domain name; FALSE
otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id333579"></a><h3>
<a name="gnet-inetaddr-list-interfaces"></a>gnet_inetaddr_list_interfaces ()</h3>
<a class="indexterm" name="id333592"></a><pre class="programlisting">GList* gnet_inetaddr_list_interfaces (void);</pre>
<p>
Gets a list of <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a> interfaces's on this host. This list
includes all "up" Internet interfaces and the loopback interface,
if it exists.
</p>
<p>
On Windows if you do not have IPv6 installed then this function
will return up to 10 interfaces.
</p>
<p>
This function may not work on some systems.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> A list of <a href="gnet-inetaddr.html#GInetAddr"><span class="type">GInetAddr</span></a>'s representing available interfaces.
The caller should delete the list and the addresses.
</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>
|