gensio_get_type(3)

πŸ“¦
version 3.0.4 Β· 2 versions
  • 3.0.4 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 2.6.2 Β· debian bookworm, ubuntu jammy
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 is 0, or for one of its children when depth is greater than 0. and if you ask for a depth deeper than the number of children that actually exist? it returns NULL. 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 get NULL. no child, no vibes.
  • gensio_is_client β€” returns true if the gensio is a client, false if it's a server. that's it, that's the whole personality test. πŸ‘‘
  • gensio_is_reliable β€” returns true if 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 β€” returns true if the remote end authenticated, false if not. in the SSL case, this means that the remote certificate was received and verified (client and server, see the gensio(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 β€” returns true if the connection is encrypted, false if 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. see gensio(5) for the details on how this actually works. πŸ¦‹
  • gensio_is_mux β€” returns true if the gensio is capable of multiplexing, meaning it accepts a gensio_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 return true for gensio_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