Mercurial > hg > orthanc
diff OrthancServer/main.cpp @ 618:5ab377df6d8b find-move-scp
filtering on aet
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 25 Oct 2013 11:50:17 +0200 |
parents | f27923072afd |
children | 70d0f27e5bd3 |
line wrap: on
line diff
--- a/OrthancServer/main.cpp Fri Oct 25 11:28:02 2013 +0200 +++ b/OrthancServer/main.cpp Fri Oct 25 11:50:17 2013 +0200 @@ -257,6 +257,25 @@ }; +class OrthancApplicationEntityFilter : public IApplicationEntityFilter +{ +public: + virtual bool IsAllowed(const std::string& /*callingIp*/, + const std::string& callingAet) + { + if (!IsKnownAETitle(callingAet)) + { + LOG(ERROR) << "Unkwnown remote DICOM modality AET: \"" << callingAet << "\""; + return false; + } + else + { + return true; + } + } +}; + + class MyIncomingHttpRequestFilter : public IIncomingHttpRequestFilter { private: @@ -481,12 +500,14 @@ { // DICOM server DicomServer dicomServer; + OrthancApplicationEntityFilter dicomFilter; dicomServer.SetCalledApplicationEntityTitleCheck(GetGlobalBoolParameter("DicomCheckCalledAet", false)); dicomServer.SetStoreRequestHandlerFactory(serverFactory); dicomServer.SetMoveRequestHandlerFactory(serverFactory); dicomServer.SetFindRequestHandlerFactory(serverFactory); dicomServer.SetPortNumber(GetGlobalIntegerParameter("DicomPort", 4242)); dicomServer.SetApplicationEntityTitle(GetGlobalStringParameter("DicomAet", "ORTHANC")); + dicomServer.SetApplicationEntityFilter(dicomFilter); // HTTP server MyIncomingHttpRequestFilter httpFilter(context);