Commit Graph

77 Commits

Author SHA1 Message Date
Michael Davidsaver
1ea70a302b ignore protocol minor version 0
The change from 0 -> 1 included incompatible changes
to CMD_BEACON and several others.

Ignore any UDP messages (beacon or search),
and disconnect any TCP peers, with version==0.
2019-05-21 08:51:01 -07:00
Michael Davidsaver
ecee708d3a redo hexDump
ludicrously inefficient (cf. toHex() ), and inflexible.
2019-05-21 08:51:00 -07:00
Michael Davidsaver
75befddf46 minor 2019-05-20 17:48:10 -07:00
Michael Davidsaver
3a2a3ac148 remove unused getSocketReceiveBufferSize() 2019-05-20 17:48:10 -07:00
Michael Davidsaver
0084b6e60a de-virt Transport::getRevision()
Makes clear that this is/was only for TCP,
and eliminate redundant storage.  Also apply
locking to this storage.

Use header version directly in search handler.
Correct as only UDP search is actually used atm.
2019-05-20 17:48:10 -07:00
Michael Davidsaver
32ba2f32d0 avoid deprecated ByteBuffer::getArray()
use identical, but not overloaded, getBuffer()
2019-05-19 14:09:38 -07:00
Michael Davidsaver
736e0c169a Merge branch 'auth'
* auth:
  fix osdGetRoles
  oops
  Add showauth executable
  getgrouplist() on OSX has different sig.
  auth fix mingw static
  fix search PeerInfo
  PeerInfo in pva/server.h and pva/sharedstate.h
  make PeerInfo available during search phase
  auth status void accidental success.
  minor doc
  always need to link with netapi32 now
  authorize with local group lookup
  Add osdGetRoles()
  authorization framework
  pvasr show PeerInfo
  redo security (aka. access control)
  remove asCheck

# Conflicts:
#	src/server/pv/responseHandlers.h
#	src/server/responseHandlers.cpp
2019-05-12 14:40:29 -07:00
Michael Davidsaver
a697008f13 demagic 2019-04-17 09:35:43 -07:00
Michael Davidsaver
bdd2730315 auth status void accidental success.
The default value of _verificationStatus is reported
on auth timeout.  Make sure it isn't success.
2019-01-13 19:04:59 -08:00
Michael Davidsaver
3209899172 authorization framework 2019-01-12 15:14:19 -08:00
Michael Davidsaver
fa484a883a redo security (aka. access control)
Break up monolithic SecurityPlugin API into three parts.

1. Authentication.
2. Authorization.
3. Access Control decision.  Left to ChannelProviders
2019-01-12 15:14:19 -08:00
Michael Davidsaver
2fec84461d use of CMD_* instead of magic numbers 2018-10-02 12:52:24 -07:00
Michael Davidsaver
d424202323 client: exception propagation from callbacks
Swallowing exceptions here hides some of our errors.
Particularly unrecoverable introspectionRegistry misses.
Instead, propagate up to Thread and close connection.
2018-06-22 13:28:49 -07:00
Michael Davidsaver
c8292caf91 remote: Request larger stack for workers
Overflows observed on RTEMS/ppc (mvme6100).
2018-06-04 10:08:01 -07:00
Michael Davidsaver
7a523dd948 drop unused NOMINMAX 2018-05-18 15:20:26 -07:00
Michael Davidsaver
bab32c332a codec: notes on thread self dtor 2018-04-04 18:40:46 -07:00
Michael Davidsaver
7f5eb1de4d BlockingClientTCPTransportCodec collapse closedNotifyClients() into internalClose() 2018-04-04 18:31:12 -07:00
Michael Davidsaver
0eabf10005 codec: drop unused _shutdownEvent
using epicsThread::exitWait() instead
2018-04-04 18:31:12 -07:00
Michael Davidsaver
fe5780521b Context::getSecurityPlugins() no return of non-const ref.
Return of map as non-const ref. allows callers to modify.
Probably unintended.
2018-04-04 09:09:43 -07:00
Michael Davidsaver
df14a19ae0 codec: eliminate internalPostClose()
no reason to distinguish before and after
send worker break is _requested_ (won't
actually be stopped).
2018-04-02 11:30:19 -07:00
Michael Davidsaver
434a43dfe1 codec: less force-ful shutdown
eliminate unused 'force' argument.
2018-04-02 10:46:57 -07:00
Michael Davidsaver
da85d39c0c codec: const-ify socket
Avoid possible data race of changing _channel
before worker threads are joined.
Was just using this as a boolean flag for a method
which is already guarded in BlockingTCPTransportCodec::close()
from being called twice.
2018-04-02 10:41:30 -07:00
Michael Davidsaver
38965bb847 codec: collapse internalDestroy() into internalClose() 2018-04-02 10:24:35 -07:00
Michael Davidsaver
18758fa497 throw new doesn't work
javaism...
2018-02-13 18:07:58 -08:00
Michael Davidsaver
a266777d82 destroyAllChannels() swap out channels list
avoid possible modifications while iterating.
2018-02-13 17:58:56 -08:00
Michael Davidsaver
e8347f17b4 minor 2018-02-07 20:16:38 -08:00
Michael Davidsaver
5a86835a6f add ref-counter for Transport ABC 2018-02-01 11:17:56 -08:00
Michael Davidsaver
3bb2f25bed Merge remote-tracking branch 'origin/master'
* origin/master:
  prevent CAChannel::disconnectChannel() from calling ca_clear_channel twice This was causing a crash when exiting
  Revert "When caProvider is destroyed make sure all channels are cleared"
  make changes suggested by andrew that remove warning messages
  Clean up compiler warnings
  fix issue #77
2018-01-31 11:51:57 -08:00
Michael Davidsaver
9daf7a0cad remove unnecessary includes 2018-01-31 11:51:13 -08:00
Andrew Johnson
fa46935d35 Clean up compiler warnings 2018-01-04 17:52:36 -06:00
Michael Davidsaver
903d117485 pvAccessLog() add EPICS_PRINTF_STYLE()
and fixup incorrect specifiers
2017-12-28 10:49:54 -06:00
Michael Davidsaver
ba3b777978 missed one
cf 2f0bb7d448
2017-11-16 11:18:13 -06:00
Michael Davidsaver
2f0bb7d448 "Not-a-first segmented message" is a critical error
Let's try to scare users into reporting it more promptly.
2017-11-15 19:38:26 -06:00
Michael Davidsaver
576b241faa consolidate TransportClient and ChannelImpl as ClientChannelImpl 2017-11-06 15:51:43 -06:00
Michael Davidsaver
073c77b1ef consolidate ServerChannel and ServerChannelImpl
"interface" with a single implementation.
combine and de-virtualize.
2017-11-06 15:14:41 -06:00
Michael Davidsaver
8d5c27143b pvasr list client channels 2017-11-05 17:11:28 -06:00
Michael Davidsaver
5e900b1f11 remove super abstract authNZInitialize(void*)
with separate client and server calls.

Still dynamic_cast ugliness as Transport and Codec
hierarchies don't have a common root.
2017-11-05 16:41:59 -06:00
Michael Davidsaver
47332fdf90 server status reporting via iocsh 2017-11-05 15:59:01 -06:00
Michael Davidsaver
98df225583 insturment with reftrack 2017-08-30 11:17:03 -05:00
Michael Davidsaver
ad5d23f4c8 minor vx fix 2017-07-17 17:38:51 +02:00
Michael Davidsaver
0c02625aa5 servercontext wait for transport worker threads to finish
doing this through Transport::close()
causes deadlock in client code due to locking.
So make this an extra step.
2017-06-26 14:16:41 +02:00
Michael Davidsaver
3dca3dc38f ServerContext clear timer queue 2017-06-22 13:51:38 +02:00
Michael Davidsaver
11cc395baf more BlockingTCPTransportCodec::close() wait for threads
can't wait here as locks are held
2017-06-02 12:30:40 +02:00
Michael Davidsaver
3ad27665e8 BlockingTCPTransportCodec::close() wait for threads 2017-05-31 15:47:46 +02:00
Michael Davidsaver
3283bed413 drop PVA_ALIGNMENT constant
This will forevermore be 1, so no
reason to incur complexity of testing this.

size % PVA_ALIGNMENT -> 0
alignBuffer(PVA_ALIGNMENT) -> no-op
alignedValue(val, PVA_ALIGNMENT) -> val
2017-05-24 17:20:17 -04:00
Michael Davidsaver
87dca19708 codec: avoid indirection when accessing buffers
avoid some indirection to make this code easier to follow.
move buffer lower limit to base class.
2017-05-24 17:20:17 -04:00
Michael Davidsaver
b05e7699b5 remove no-op lock/unlock from Lock sub-classes 2017-05-24 17:20:17 -04:00
Michael Davidsaver
2cc1be2dee codec.h: minor 2017-05-24 17:20:17 -04:00
Michael Davidsaver
ab4f0b7e3a collapse BlockingSocketAbstractCodec -> BlockingTCPTransportCodec 2017-05-24 17:20:17 -04:00
Michael Davidsaver
e47124aa30 collapse BlockingAbstractCodec into BlockingSocketAbstractCodec 2017-05-24 17:20:17 -04:00