Unix Kernel Logger

Overview

Unix Kernel Logger header file

Copyright (C) 2004-2022 OKTET Labs Ltd. More…

// global functions

int map_name_to_level(const char* name);
int te_get_host_addrs(const char* host_name, struct sockaddr_in* host_ipv4, bool* ipv4_found, struct sockaddr_in6* host_ipv6, bool* ipv6_found);
int log_serial(void* ready, int argc, char* argv[]);
void te_kernel_log_set_system_func(void* p);
int te_open_conserver(const char* conserver);

Detailed Documentation

Unix Kernel Logger header file

Copyright (C) 2004-2022 OKTET Labs Ltd. All rights reserved.

Global Functions

int map_name_to_level(const char* name)

Map Logger level name to the value

Parameters:

name

Name of the level

Returns:

Level number

int te_get_host_addrs(const char* host_name, struct sockaddr_in* host_ipv4, bool* ipv4_found, struct sockaddr_in6* host_ipv6, bool* ipv6_found)

Get addresses by host name.

Parameters:

host_name

Host name

host_ipv4

Here IPv4 address will be saved if not NULL

ipv4_found

Will be set to true if IPv4 address found

host_ipv6

Here IPv6 address will be saved if not NULL

ipv6_found

Will be set to true if IPv6 address found

Returns:

-1 on failue, 0 on success

int log_serial(void* ready, int argc, char* argv[])

Log kernel output via Logger component

Parameters:

ready

Parameter release semaphore

argc

Number of string arguments

argv

String arguments:

  • log user

  • log level

  • message interval

  • tty name (if it does not start with “/”, it is interpreted as a conserver connection designator)

  • sharing mode (opt)

void te_kernel_log_set_system_func(void* p)

Set function to be used as system(),

Parameters:

p

Function pointer

int te_open_conserver(const char* conserver)

Connect to conserver listening on a given port at localhost and authenticate to it.

Parameters:

conserver

A colon-separated string of the form: [(IP address or host name):]port:user:console (parenthesises are necessary only for IPv6 address)

Returns:

Connected socket (or -1 if failed)