1UPSCLI_SPLITADDR(3)               NUT Manual               UPSCLI_SPLITADDR(3)
2
3
4

NAME

6       upscli_splitaddr - split a listening address into its components
7

SYNOPSIS

9       #include <upsclient.h>
10
11       int upscli_splitaddr(const char *buf, char **hostname,
12                                      int *port)
13

DESCRIPTION

15       The upscli_splitaddr() function takes a pointer to the raw UPS
16       definition buf and returns pointers to dynamically allocated memory in
17       upsname and hostname. It also copies the port number into port.
18

FORMATTING

20       A listening address definition is specified according to this format:
21
22           <hostname>[:<port>]
23
24       Definitions without an explicit port value receive the default value of
25       3493.
26

MEMORY USAGE

28       You must free(3) the pointer hostname when you are done with it to
29       avoid memory leaks.
30

RETURN VALUE

32       The upscli_splitaddr() function returns 0 on success, or -1 if an error
33       occurs.
34

SEE ALSO

36       upscli_fd(3), upscli_get(3), upscli_readline(3), upscli_sendline(3),
37       upscli_splitname(3), upscli_ssl(3), upscli_strerror(3),
38       upscli_upserror(3)
39
40
41
42Network UPS Tools                 09/15/2011               UPSCLI_SPLITADDR(3)
Impressum