From nobody Sat Nov 22 16:16:34 2025 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dDHJy4004z6HP6G for ; Sat, 22 Nov 2025 16:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dDHJy2S29z3Mrv for ; Sat, 22 Nov 2025 16:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763828194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KYbUEGKP0trYPexpoJBjCNsfAKIagT3qViYzcIWAj3M=; b=RjqK3XcrJ7TIxICagL8RxSID64hf6Q/qvuT1QsyVwGv8601s5wM6OGjEqvda+QX/D2jTWE WHGrGzKLRhAH3fYHKETOLpVw0CYGAaF8IwM8UAeJ3kwDj9vSdXgMeE9znuGzE/SqXBgOxf qI/oK6XZGlDF2S25Vj8TPDROgXXvlrKu0xs/6KdlDS5/kTaWNv+Lfp/9jTeSyzepfSdQow oMDiyCkI7eqEpo5EBS/Jm5U7M0Fm2VOG2WOfRhDUnNZOV5KshLiNC/E5lpZ6cfRnRB4Gku drcPchxiFl4U96ZktvZtIxrttKCSEU/Kwp6NO+2SoLZEzYdQv3sN/dytBydOzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763828194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KYbUEGKP0trYPexpoJBjCNsfAKIagT3qViYzcIWAj3M=; b=gadGzZASqoT4IsJ7p+vl2iTH7SucZHCdVRb2nZ7ewrQ4QF+SYkIbYtNrFndwbwtz5rUkNG tmpG41VHhg3R9CUrrdoMMEPjMGQhuNvDrQFzYdX/T+GWjcotjYvFBL0obuC50Vq6YMkbTS 59FXwzmkpn5fsHjvoL6L4uSA9czRV2oOPrG1BLKJwigIKckrcPEIXFKRVuAt6Z0ROVoLmN wxi9Q6HupsmMUswPNFv1NmUEYQy6HXwWRD7Njo91uBxO1WvGI0BWT4RqmqSZQ4FX6DHD1z MJfPxGjGaJZt/oV0ar4PGgIAduNEhADhUL/p7acXK9XE2/cu9jKmW3UHaNxjiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763828194; a=rsa-sha256; cv=none; b=taS538OVpNhqCfePvWBfPhkswtHyMmcrceGl86A2wAbffydwJ6uWVNhSkTVHIBdeyEMQFT ZBq0MzPveZynKGKXWyHHnvzHXXyP9m7Om/ThE3OdVGfT3mel0E5uVmjfVH5/Yn9B1jVhpi KJyjLm9no8TPMzRwCnaXZRCMuCzPA5Omigc2tKIuDcTfrTpOHplME47GyYoGhiK0YkOEIX m6rkComNpBelHGqPOxxRbx7qGt8ssOMUi/jyfzQfOgBz/YX8AHK1O3UCmVwWjN5NB3j76V n7qG95gMOoar4ZU/LYkhhGiYU0V+Dekh3zAN7wxN1nrhokho3EwOhI0yamxSBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dDHJy22F3z158F for ; Sat, 22 Nov 2025 16:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 376ff by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 22 Nov 2025 16:16:34 +0000 To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Jose Luis Duran Subject: git: 63ddb46c11 - main - handbook/sockets: Update time.nist.gov IP address List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-doc-all@freebsd.org Sender: owner-dev-commits-doc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 63ddb46c110beb2361a1e890e0435086892f6e60 Auto-Submitted: auto-generated Date: Sat, 22 Nov 2025 16:16:34 +0000 Message-Id: <6921e1e2.376ff.5b0af6d0@gitrepo.freebsd.org> The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/doc/commit/?id=63ddb46c110beb2361a1e890e0435086892f6e60 commit 63ddb46c110beb2361a1e890e0435086892f6e60 Author: Jose Luis Duran AuthorDate: 2025-10-30 18:49:30 +0000 Commit: Jose Luis Duran CommitDate: 2025-11-22 16:10:47 +0000 handbook/sockets: Update time.nist.gov IP address It has not been this IP address since 2012. % drill -x 192.43.244.18 ... this.has.not.been.ntp.server.time.nist.gov.since.2012. Update it to 132.163.96.1. Reviewed by: ziaee Pull Request: https://github.com/freebsd/freebsd-doc/pull/563 --- .../en/books/developers-handbook/sockets/_index.adoc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/documentation/content/en/books/developers-handbook/sockets/_index.adoc b/documentation/content/en/books/developers-handbook/sockets/_index.adoc index 95c8b7b814..49249aa3c7 100644 --- a/documentation/content/en/books/developers-handbook/sockets/_index.adoc +++ b/documentation/content/en/books/developers-handbook/sockets/_index.adoc @@ -383,7 +383,7 @@ Now, let us try to fill it out. Let us assume we are trying to write a client for the _daytime_ protocol, which simply states that its server will write a text string representing the current date and time to port 13. We want to use TCP/IP, so we need to specify `AF_INET` in the address family field. `AF_INET` is defined as `2`. -Let us use the IP address of `192.43.244.18`, which is the time server of US federal government (`time.nist.gov`). +Let us use the IP address of `132.163.96.1`, which is the time server of US federal government (`time.nist.gov`). .Specific example of sockaddr_in image::sainfill.png[] @@ -402,7 +402,7 @@ struct in_addr { In addition, `in_addr_t` is a 32-bit integer. -The `192.43.244.18` is just a convenient notation of expressing a 32-bit integer by listing all of its 8-bit bytes, starting with the _most significant_ one. +The `132.163.96.1` is just a convenient notation of expressing a 32-bit integer by listing all of its 8-bit bytes, starting with the _most significant_ one. So far, we have viewed `sockaddr` as an abstraction. Our computer does not store `short` integers as a single 16-bit entity, but as a sequence of 2 bytes. @@ -414,7 +414,7 @@ Suppose we coded something like this: .... sa.sin_family = AF_INET; sa.sin_port = 13; -sa.sin_addr.s_addr = (((((192 << 8) | 43) << 8) | 244) << 8) | 18; +sa.sin_addr.s_addr = (((((132 << 8) | 163) << 8) | 96) << 8) | 1; .... What would the result look like? @@ -485,7 +485,7 @@ One would be to _reverse_ the values in our code: .... sa.sin_family = AF_INET; sa.sin_port = 13 << 8; -sa.sin_addr.s_addr = (((((18 << 8) | 244) << 8) | 43) << 8) | 192; +sa.sin_addr.s_addr = (((((1 << 8) | 96) << 8) | 163) << 8) | 132; .... This will _trick_ our compiler into storing the data in the _network byte order_. @@ -546,7 +546,7 @@ Or it may outright _refuse_ any request for specific code. [[sockets-first-client]] ===== Our First Client -We now know enough to write a very simple client, one that will get current time from `192.43.244.18` and print it to [.filename]#stdout#. +We now know enough to write a very simple client, one that will get current time from `132.163.96.1` and print it to [.filename]#stdout#. [.programlisting] .... @@ -576,7 +576,7 @@ int main() { sa.sin_family = AF_INET; sa.sin_port = htons(13); - sa.sin_addr.s_addr = htonl((((((192 << 8) | 43) << 8) | 244) << 8) | 18); + sa.sin_addr.s_addr = htonl((((((132 << 8) | 163) << 8) | 96) << 8) | 1); if (connect(s, (struct sockaddr *)&sa, sizeof sa) < 0) { perror("connect"); close(s); @@ -1020,7 +1020,7 @@ int main(int argc, char *argv[]) { We now can type a domain name (or an IP address, it works both ways) on the command line, and the program will try to connect to its _daytime_ server. Otherwise, it will still default to `time.nist.gov`. -However, even in this case we will use `gethostbyname` rather than hard coding `192.43.244.18`. +However, even in this case we will use `gethostbyname` rather than hard coding `132.163.96.1`. That way, even if its IP address changes in the future, we will still find it. Since it takes virtually no time to get the time from your local server, you could run daytime twice in a row: