gensio_get_type(3)
π gensio_get_type(3) β the vibe-check page for your gensio π
okay bestie, welcome to gensio_get_type(3), a page from the Library Functions Manual. this is the lil family of functions that just... tells you stuff about a gensio. no big dramatic actions, no connecting, no disconnecting β just pure information-gathering. it's giving "let me look at you and tell you what you are" energy. πβ¨
β¨ NAME β¨
gensio_get_type, gensio_get_child, gensio_is_client, gensio_is_reliable, gensio_is_packet, gensio_is_authenticated, gensio_is_encrypted, gensio_is_message, gensio_is_mux β return general information about a gensio. that's the whole job. intel. gossip. facts. π
π SYNOPSIS π
#include <gensio/gensio.h>
const char *gensio_get_type(struct gensio *io,
unsigned int depth);
struct gensio *gensio_get_child(struct gensio *io,
unsigned int depth);
bool gensio_is_client(struct gensio *io);
bool gensio_is_reliable(struct gensio *io);
bool gensio_is_packet(struct gensio *io);
bool gensio_is_authenticated(struct gensio *io);
bool gensio_is_encrypted(struct gensio *io);
bool gensio_is_message(struct gensio *io);
bool gensio_is_mux(struct gensio *io);
πΈ DESCRIPTION πΈ
okay so here's the whole friend group, one by one, no one gets skipped, periodt.
gensio_get_typeβ hands you back the type string for the gensio when depth is0, or for one of its children when depth is greater than0. and if you ask for a depth deeper than the number of children that actually exist? it returnsNULL. sad but honest. πgensio_get_childβ gives you the given child of the gensio. and again, if depth is greater than the number of children, you getNULL. no child, no vibes.gensio_is_clientβ returnstrueif the gensio is a client,falseif it's a server. that's it, that's the whole personality test. πgensio_is_reliableβ returnstrueif the gensio is reliable, meaning it won't lose data. serial devices are not considered reliable, and neither is UDP, no cap. pretty much everything else is, because they don't drop data and they're flow-controlled. so if you're on serial or UDP, bestie, guard your data with your life. π«Άgensio_is_packetβ returns whether the gensio is packet-oriented. in a packet-oriented gensio, if one side writes a chunk of data, when the other side does a read it will get the same chunk of data as a single unit β assuming its buffer sizes are set properly. key word: assuming. π₯gensio_is_authenticatedβ returnstrueif the remote end authenticated,falseif not. in the SSL case, this means that the remote certificate was received and verified (client and server, see thegensio(5)SSL section for details). for certauth server, this means that the authentication successfully authenticated the certauth client by either certificate or password. two paths, one slay. β¨gensio_is_encryptedβ returnstrueif the connection is encrypted,falseif not. simple. iconic. πgensio_is_messageβ returns whether the gensio is message-oriented. in a message-oriented gensio, a write can explicitly mark message boundaries, and those boundaries get delivered to the reader with those boundaries set. seegensio(5)for the details on how this actually works. π¦gensio_is_muxβ returnstrueif the gensio is capable of multiplexing, meaning it accepts agensio_alloc_channel()call. mux girls stay winning. π
β οΈ important lore, bestie: for the"gensio_is_xxx"type of requests, the property is usually inherited from the child. so if you run a telnet gensio on top of an SSL gensio, the telnet gensio will returntrueforgensio_is_encrypted, because SSL is encrypted. the encryption trickles up. it's giving nepotism but make it cryptography. π
π SEE ALSO π
aaaand that's the page!! π dated 27 Feb 2019, born in the Library Functions Manual, living rent-free in your terminal forever. go forth and interrogate your gensios, bestie β they can't lie to you, they can only return NULL. πβ¨ππ¦
π¦ where this page comes from
- alpine 3.22: gensio-doc 2.8.14-r0 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- alpine 3.23: gensio-doc 2.8.14-r0 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- alpine 3.24: gensio-doc 2.8.14-r0 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- arch rolling: gensio 3.0.4-1 Β· GPL
- debian trixie: libgensio-dev 2.8.13-7 Β· GPL-2.0-only
- epel 9: libgensio-devel 2.8.15-1.el9 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 43: libgensio-devel 2.8.15-5.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 43: libgensio-devel 2.8.15-5.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 43: libgensio-devel 3.0.4-1.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 43: libgensio-devel 3.0.4-1.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.2-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.2-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.4-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.4-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- nixos 26.05: gensio 3.0.2
- nixpkgs unstable: gensio 3.0.2
- opensuse-leap 16.0: gensio-devel 2.8.2-bp160.1.13 Β· Apache-2.0 AND GPL-2.0-only AND LGPL-2.1-only
- opensuse-leap 16.0: gensio-devel 2.8.2-bp160.1.13 Β· Apache-2.0 AND GPL-2.0-only AND LGPL-2.1-only
- opensuse-leap 16.0: gensio-devel 2.8.2-bp160.1.13 Β· Apache-2.0 AND GPL-2.0-only AND LGPL-2.1-only
- opensuse-leap 16.0: gensio-devel 2.8.2-bp160.1.13 Β· Apache-2.0 AND GPL-2.0-only AND LGPL-2.1-only
- ubuntu noble: libgensio-dev 2.8.2-6.1build1 Β· GPL-2.0-only
- ubuntu questing: libgensio-dev 2.8.13-7
- ubuntu resolute: libgensio-dev 3.0.0-1build1 Β· GPL-2.0-only
- ubuntu stonking: libgensio-dev 3.0.0-1ubuntu1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms