From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3CF14A034C; Tue, 14 Dec 2021 18:42:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 26C1C40041; Tue, 14 Dec 2021 18:42:39 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 6A9FB4003C for ; Tue, 14 Dec 2021 18:42:38 +0100 (CET) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH 02/12] net: add function to pretty print IPv4 Date: Tue, 14 Dec 2021 18:42:35 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D86D70@smartserver.smartshare.dk> In-Reply-To: <20211214080841.3c028b13@hermes.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 02/12] net: add function to pretty print IPv4 Thread-Index: AdfxBOLR7efkdh9VTMChwlbIgND2cAAC61KQ References: <20211214141242.3383831-1-ronan.randles@intel.com> <20211214141242.3383831-3-ronan.randles@intel.com> <20211214080841.3c028b13@hermes.local> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Ronan Randles" , Cc: , "Stephen Hemminger" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Tuesday, 14 December 2021 17.09 >=20 > On Tue, 14 Dec 2021 14:12:32 +0000 > Ronan Randles wrote: >=20 > > This function accepts an uint32_t representation of an IP address = and > > produces a string representation stored in a char * buffer. = Realavent > > unit tests also included. > > > > Signed-off-by: Ronan Randles >=20 > Do we really have to reinvent getnameinfo()? > Is this for Windows? For general inspiration: We have an in-house to/from string library, where our xx_to_str() = functions return char * and can take a NULL pointer as the buffer = parameter to make it use a buffer from an small cyclic pool of string = buffers in the library. Probably not good from an academic standpoint, and not good for a = generic library, but we know how many of these strings are being used = simultaneously in our applications, so the pool is not overrun in = reality. And it makes the code using these functions much shorter and = readable. -Morten