Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ip ignore as ipag #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

goetzpf
Copy link

@goetzpf goetzpf commented Dec 6, 2019

Pull Request for 2 features:

  • Define networks to be ignored by servers with environment variable
    EPICS_CAS_IGNORE_NET_LIST
  • Extend channel access security with IP access groups that define the IP
    address a client must have

This depends on similar patches to be applied to EPICS base.

Goetz Pfeiffer added 2 commits December 6, 2019 15:49
…nets.

An EPICS channel access server will ignore requests from IP addresses that are
from one of the IP subnets specified in EPICS_CAS_IGNORE_NET_LIST.

The subnet specifications in EPICS_CAS_IGNORE_NET_LIST must be separated with
spaces.

Three forms of subnet specifications are supported:

- CIDR notation, example: 192.168.12.0/24
- Address and mask notation, example: 192.168.12.0:255.255.255.0
- Single IP address, example: 192.168.12.10

Notes for the dependency from EPICS base:

This version of PCAS only supports EPICS_CAS_IGNORE_NET_LIST if it is compiled
against an EPICS base that supports this feature too. It is however, backwards
compatible and can be compiled against older versions of EPICS base. In this
case, EPICS_CAS_IGNORE_NET_LIST is not supported.

Notes for software that uses PCAS:

This patch adds a private element to casDGIntfIO defined in casDGIntfIO.h.
It shouldn't be necessary to change the source code of applications
that are compiled against PCAS, but they need to be recompiled.
Up to now, channel access security allowed to specify access rules for clients
based on user- and host names.

This patch adds IP access groups. Now access rules may contain the client's IP
address too. The IP access group, "IPAG", can be used together with host access
groups, "HAG" or can replace these.

Notes for the dependency from EPICS base:

This version of PCAS only supports IP access groups if it is compiled
against an EPICS base that supports this feature too. It is however, backwards
compatible and can be compiled against older versions of EPICS base. In this
case, IP access groups are not supported.

Notes for software that uses PCAS:

This patch changes the API of PCAS. In general, users of the library have to
provide the IP address of the client. These are the changes:

- In casChannelI.h, casChannelI::setOwner has an additional parameter
- In casPVI.h, casPVI::createChannel has an additional parameter
- In casStrmClient.h, class casStrmClient has a new private element
- In casdef.h,  casPV::createChannel has an additional parameter
- In casdef.h,  casChannelI::setOwner has an additional parameter

The changes are active when EPICS_HAS_AS_IPAG is defined, which is the case
when the EPICS base also supports IP access groups.
@mdavidsaver
Copy link
Contributor

From a quick glance. Where is the macro EPICS_HAS_AS_IPAG defined? Also, why is this needed? imo. having macro conditional arguments is quite ugly, and likely not acceptable in public/installed headers. With c++, usually default argument values, or an overloaded method are the way to add arguments while maintaining API compatibility.

@anjohnson
Copy link
Member

He's adding several EPICS_HAS_ macros to the generated epicsVersion.h file, see his changes to makeEpicsVersion.pl. However I see no reason why the macro EPICS_HAS_AS_IPAG or its equivalent couldn't be defined in asLib.h, or even use #ifdef S_asLib_noIPag but I wouldn't insist on that. For the C++ APIs here in PCAS that need an additional parameter I agree that using default arguments or overloaded methods would seem a better solution.

@goetzpf
Copy link
Author

goetzpf commented Dec 9, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants