---
name: "gensio_get_type"
section: "3"
platform: "linux"
package: "gensio"
version: "3.0.4-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/gensio_get_type"
---

# gensio\_get\_type(3)

Return general information about a gensio

## 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

## 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

**gensio\_get\_type** return the type string for the gensio (if *depth* is 0) or one of its children *(depth \> 0).* Returns NULL if the depth is greater than the number of children.

**gensio\_get\_child** returns the given child of the gensio, returns NULL if the *depth* is greater than the number of children.

**gensio\_is\_client** returns true if the gensio a client or false if it is a server.

**gensio\_is\_reliable** return true if the genio is reliable (won't loose data).  Serial devices are not considered reliable, nor is UDP.  Pretty much everything else is, because they won't drop data and are flow-controlled.

**gensio\_is\_packet** returns if the genio is packet-oriented.  In a packet-oriented genio, 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 it's buffer sizes are set properly.

**gensio\_is\_authenticated** return 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 [gensio(5)](/gensio/5.md) SSL section for details).  For certauth server, this means that the authentication successfully authenticated the certauth client by either certificate or password.

**gensio\_is\_encrypted** returns true if the connection is encrypted, false if not.

**gensio\_is\_message** returns if the genio is message-oriented.  In a message-oriented genio, a write can explicitly mark message boundaries, these are delivered to the reader with those boundaries set.  See [gensio(5)](/gensio/5.md) for details on how this works.

**gensio\_is\_mux** return true if the genio is capable of multiplexing, meaning that it accepts an gensio\_alloc\_channel() call.

Note that for the "gensio\_is\_xxx" type of requests, the properly 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.

## SEE ALSO

[gensio\_err(3)](/gensio_err/3.md), [gensio(5)](/gensio/5.md), [gensio\_os\_funcs(3)](/gensio_os_funcs/3.md)
