Commit Graph

104 Commits

Author SHA1 Message Date
Minijackson
615ba73044 Rules to generate and install Markdown
Markdown can be generated from .pod and .dbd.pod files.
Markdown will be generated and installed by "make inc".

Co-authored-by: Timo Korhonen <timo.korhonen@ess.eu>
Co-authored-by: Andrew Johnson <anj@anl.gov>
2024-10-02 09:16:29 -05:00
Grzegorz Kowalski
5d9ffe15da caget: free PV value after printing 2024-09-04 10:02:49 -05:00
Grzegorz Kowalski
3ac8dcc3de caget: free memory allocated for PV array 2024-09-04 10:02:49 -05:00
Jure Varlec
466a9b565e Change comment style for SPDX tags in C files 2024-09-04 10:02:04 -05:00
Jure Varlec
c304b7db53 Add SPDX license tags to templates
Copyright information was gathered using `git log` with per-line history
tracking, which allows following the history of a file through renames.
2024-09-04 10:02:04 -05:00
457387ed38 fix warning when dbf_type_to_text is called with an unsigned type argument 2024-08-21 09:35:53 -05:00
Andrew Johnson
785237e41a Remove duplicate link libraries 2024-08-07 09:54:16 -05:00
Michael Davidsaver
87acb98d1e ca: remove hostname length limit when parsing address lists 2023-12-22 10:26:28 -08:00
Andrew Johnson
2e6fd505d2 Use epicsSnprintf() for old MSVC compilers 2023-12-14 11:31:36 -06:00
Andrew Johnson
5ecf7d18a8 Clean up Clang 15 sprintf() warnings in libcom and ca 2023-12-13 13:34:25 -06:00
Michael Davidsaver
a352865df9 print ANSI escapes to stderr
unconditionally print ANSI some escapes (to colorize errors)
to the stderr stream.
2023-11-07 15:53:22 -08:00
Ralph Lange
d691acc001 ca: init local variable in catime.c
found by static code analysis (cppcheck @ sonarqube)
2023-07-22 08:35:59 -07:00
Doug Murray
1d056c6fe4 Add support for CA tools timeout from environment variable EPICS_CLI_TIMEOUT 2023-07-22 08:24:22 -07:00
172597e0e6 avoid accessing dbr_text[type] when type is out of range 2023-03-10 10:56:58 +00:00
Andrew Johnson
c068fe3525 capr.pl: Fetch link fields as long strings 2022-12-28 12:43:38 -06:00
Torsten Bögershausen
a8e8d22c31 iocinf.cpp: Hostnames may be longer than 32 bytes
Found here at ESS:

(all in one line)
EPICS_CA_ADDR_LIST=averylonghostname.mylabnetwork.technicalnetwork.example.com
EPICS_CA_AUTO_ADDR_LIST=NO
caget somePVnam

leads to something like this:
CA.Client.Exception...............................................
    Warning: "Empty PV search address list"
    Source File: ../udpiiu.cpp line 403
    Current Time: Thu Jun 09 2022 10:10:47.804161447

Problem desription:
addAddrToChannelAccessAddressList() will collect what ever we specify in
EPICS_CA_ADDR_LIST for channel access.
That function will add IP-addresses to the search list.
hostnames are possible, but are ignored if longer than 32 bytes,
because buf is too short.

If a hostname can be resolved into an IP, that is fine,
if not that is "fine as well" (better say: silently ignored):
If, and only if, EPICS_CA_AUTO_ADDR_LIST=NO is given then the one
and only too long hostname will be ignored and lead to an
"Empty PV search address list".

If EPICS_CA_AUTO_ADDR_LIST=YES (or nothing) is specified, the search list
is not empty, and EPICS will search all broadcast addresses.
This will eventually lead into a timout.

Solution:
Increase the buf size in addAddrToChannelAccessAddressList() from 32 to 256

The maximum length for a hostname is 255:
https://www.ietf.org/rfc/rfc1034.txt

If we add one byte for the string terminating '\0', we need 256 bytes.

And yes, this patch neglets the fact that a user can specify HOSTNAME:PORT,
which may need another 6 bytes. To put it the other way around:
In this case the hostname length is limited to 250 bytes,
which is still long enough in practice.
2022-09-02 18:28:34 -07:00
Andrew Johnson
b88b35d117 Enhancements to the capr.pl script 2022-08-16 11:58:35 -05:00
Andrew Johnson
d82ab819ef Cap5 support for zero-length long strings 2022-07-13 13:24:54 -05:00
Andrew Johnson
571165df26 Stop Clang-12 warnings from Perl XS code 2022-07-04 15:55:18 -05:00
Minijackson
a722bb9289 treewide: add usage help to various iocsh functions 2022-06-20 08:09:42 -07:00
Andrew Johnson
e329fa3296 CA Client: Protect against epicsTime::strftime() throwing
libCa shouldn't cause an application to abort with an uncaught
exception on a machine that has timezone problems just because
we can't convert the current time into a string.
2022-04-24 12:50:40 -05:00
Andrew Johnson
6d3821adb8 Soft-links to capr.pl and makeBaseApp.pl scripts now work
The other Perl scripts that use FindBin for their lib path could
have the same changes applied, but these two scripts are the ones
normally run by hand so might get soft-linked by an installer.
Without this change these scripts don't actually work if run from
a soft-link instead of directly.
2022-04-18 20:46:48 -05:00
Michael Davidsaver
b0e2e8426f Quiet warning 2022-04-16 13:23:58 -07:00
Andrew Johnson
7cb80d5a17 Merge Dirk's fix_epicsInt8 branch into 7.0 2022-01-24 13:32:16 -06:00
Andrew Johnson
4bece4ad92 Merge Heinz & Andrew's rtems-osd-event branch into 7.0 2022-01-24 12:44:17 -06:00
Andrew Johnson
e4a81bb361 Document zero and NaN timeout values
Rename parameter timeOut => timeout everywhere
2022-01-04 17:16:59 -06:00
c5012d9f73 Make sure epicsInt8 is signed on all architectures 2021-12-17 09:42:04 +01:00
Michael Davidsaver
2256c979b0 ca: silence warning 2021-11-13 11:47:15 -08:00
Michael Davidsaver
b9899213d4 colorize errors and warnings
Use ERL_ERROR and ERL_WARNING

git grep -li 'errlogPrintf.*[" ]error' | xargs sed -i -E -e 's|(errlogPrintf.*[" ])(error)|\1" ERL_ERROR "|g'

git grep -li 'errlogPrintf.*[" ]warn' | xargs sed -i -E -e 's|(errlogPrintf.*[" ])(warn[a-zA-Z]*)|\1" ERL_WARNING "|g'
2021-10-18 08:45:13 -07:00
Torsten Bögershausen
420fb45fbc Fix several compilation errors for -DDEBUG
After Adding "-DDEBUG" to the compiler options some files don't
compile any more.
Fix the compilation errors.
2021-09-01 11:13:40 +02:00
Michael Davidsaver
e34b6c5c0c Fix spelling in comments
Should be non-functional, except for some error message strings.
2021-08-29 07:27:50 -07:00
Freddie Akeroyd
4dad8ca503 Use <osiSock.h> rather than <osdSock.h>
Fix compile issue building PCAS module, which just includes
<caProto.h> resulting in LIBCOM_API being undefined
2021-06-25 11:27:20 +01:00
Andrew Johnson
cb5f68994f Squish various compiler warnings
* CPP's defined() is UB outside of a #if line
* Use (void)! cast to prevent recent GCCs & glibc from warning
  about ignoring the return status from chdir()
2021-06-20 12:47:38 -05:00
Andrew Johnson
ac0693f2f2 Merge 7.0 into rtems5 2021-06-04 16:11:10 -05:00
Michael Davidsaver
08b741ed05 ca: fallback to repeater thread if unable to exec caRepeater
Silently fallback to in-process repeater thread on all targets.
Including on host targets when caRepeater executable is unavailable.
2021-05-19 11:07:53 -07:00
Michael Davidsaver
315fb3df69 init scripts use FINAL_LOCATION 2021-05-19 09:02:21 -07:00
Brendan Chandler
1c6b02b9be Merge remote-tracking branch 'origin/7.0' into rtems5 2021-03-25 18:41:15 -05:00
Andrew Johnson
e10b1d7660 Merge 3.15 branch into 7.0
Includes support for 'make inc'
2021-03-12 00:04:32 -06:00
Brendan Chandler
5c792687a6 Merge branch '7.0' into rtems5 2021-02-05 12:21:20 -06:00
Brendan Chandler
cd0e6a4f9a Make sure the definition of IPPORT_USERRESERVED is defined
caProto.h was using IPPORT_USERRESERVED but not including itself,
meaning there was an order dependency of header inclusion when using
this header.  Now there shouldn't be.

Also, RTEMS wasn't defining IPPORT_USERRESERVED, so that definition
has been added.
2021-02-05 10:42:02 -06:00
Andrew Johnson
78d685688c Add VALID_BUILDS support for "Command" 2021-02-02 16:06:42 -06:00
Michael Davidsaver
db2f7d8b92 use auto_ptr or unique_ptr 2020-11-18 10:54:44 -08:00
Andrew Johnson
a7bf59079f Merge Dirk Zimoch's fix_zero_size_arrays branch 2020-10-29 17:07:35 -05:00
Andrew Johnson
3c99391d93 Added SPDX License ID to all EPICS-original source files
In some cases the license-identification header was missing,
so I added that as well. Replaced the remaining headers that
specifically identified "Versions 3.13.7 and higher".

Makefiles and the build system were deliberately excluded.
2020-08-03 11:53:01 -05:00
Andrew Johnson
10d472202d Fix some ca/perl builds
Use the pre-expanded Perl configuration variables.
Conda builds of Perl need these (and a fix to the Perl
config files, see https://github.com/conda/conda/issues/8425
for details).
2020-07-21 15:17:37 -05:00
Andrew Johnson
f99bb637b9 ca: Minor cleanups in capr.pl 2020-07-20 18:22:37 -05:00
Andrew Johnson
c55a95fc98 ca: Support DBF_INT64 and DBF_UINT64 in capr.pl 2020-07-20 18:21:46 -05:00
Andrew Johnson
7d9746003b ca: Fix capr.pl to handle missing fields properly
When using an EPICS 7 softIoc.dbd file with a PV from an older version
of Base which didn't have all the fields, our attempts to read those
fields will time out, but the internal logic was buggy. Don't try to
print the values of timed out fields at all. The user will still see a
warning about connection timeouts at the top.
2020-07-20 18:20:45 -05:00
Ralph Lange
7d2e352f6a Merge changes from 3.15 branch into 7.0
- merged 3.15 branch up to bf7a1605

# Conflicts:
#	modules/database/src/ioc/db/dbChannel.c
2020-07-15 11:46:45 +02:00
a42197f0d6 allow to write empty arrays with caput 2020-06-09 10:57:05 +02:00