str_to_port(3)

NAME
str_to_port() - a getservbyname frontend

SYNOPSIS
#include "fwfunc.h"

int str_to_port(char *portstr)

DESCRIPTION
The str_to_port function coverts character tcp port name to integer value in network byte order.

RETURN VALUES
The str_to_port function returns atoi of portstr if it is all-digit, tcp port number from getservbyname if it is not, and exits with fwtkcfgerr if the service is unknown.

SEE ALSO
getservbyname(3)

HISTORY
present in fwtk since v2