File: __pmcheckattribute.3

package info (click to toggle)
pcp 6.3.8-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 235,180 kB
  • sloc: ansic: 1,253,622; sh: 173,998; xml: 160,490; cpp: 83,331; python: 20,482; perl: 18,302; yacc: 6,886; makefile: 2,955; lex: 2,862; fortran: 60; java: 52
file content (66 lines) | stat: -rw-r--r-- 2,093 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
'\"macro stdmacro
.\"
.\" Copyright (c) 2024 Red Hat.
.\"
.\" This program is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License as published by the
.\" Free Software Foundation; either version 2 of the License, or (at your
.\" option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
.\" or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
.\" for more details.
.\"
.\"
.TH PMCHECKATTRIBUTE 3 "PCP" "Performance Co-Pilot"
.SH NAME
\f3__pmCheckAttribute\f1 \- check value for a client connection attribute
.SH "C SYNOPSIS"
.ft 3
#include "pmapi.h"
.br
#include "libpcp.h"
.sp
int __pmCheckAttribute(__pmAttrKey \fIattr\fP, const char * \fIvalue\fP);
.sp
cc ... \-lpcp
.ft 1
.SH CAVEAT
This documentation is intended for internal Performance Co-Pilot
(PCP) developer use.
.PP
These interfaces are not part of the PCP APIs that are guaranteed to
remain fixed across releases, and they may not work, or may provide
different semantics at some point in the future.
.SH DESCRIPTION
Connection attributes are exchanged between
.BR pmcd (1)
and
PCP client tools at the start of the protocol exchange.
They provide optional information relating to an individual
connection, such as the name of a specific container that is
under analysis by the client.
.PP
.B __pmCheckAttribute
verifies that the given attribute
.I attr
follows the expected syntax for that type of attribute.
This assists with the prevention of malicious content being
accepted by
.B pmcd
as these attributes may subsequently be used in parsers or
carried into structured output such as JSON format.
.SH RETURN VALUES
When presented with an unrecognised attribute or an invalid
.I value
for the specified attribute,
.B __pmCheckAttribute
returns a negative value suitable for reporting with
.BR pmErrStr (3).
Otherwise the return value is zero indicating success.
.SH SEE ALSO
.BR pmdbg (1),
.BR PMAPI (3)
and
.BR pmErrStr (3).