HRESULT SetLocalNetworkFilter(IltmsServer* server)
{
HRESULT hr;
CComPtr<IltmsIPFilters> filters;
CString ipfirst;
CString iplast;
// this routine will setup an IP filter that only allows local network connections
// retrieve a copy of the current filters
hr = server->GetIPFilters(&filters);
if(FAILED(hr))
goto error;
// create a full range blacklist
// equivalent to filters->Add(CComBSTR(L"0.0.0.0"), CComBSTR(L"255.255.255.255"), VARIANT_FALSE);
// create a full range whitelist
hr = filters->Reset();
if(FAILED(hr))
goto error;
// invert the single whitelist filter to create the blacklist
hr = filters->Remove(0);
if(FAILED(hr))
goto error;
{
// obtain the server IP address and create the filter range
CComPtr<IltmsNetworkProperties> props;
hr = server->GetNetworkProperties(&props);
if(FAILED(hr))
goto error;
CComBSTR v;
hr = props->get_ActualIPAddress(&v);
if(FAILED(hr))
goto error;
CString t(v);
t = t.Left(t.ReverseFind(_T('.')));
ipfirst = t + _T(".0");
iplast += t + _T(".255");
}
// now we will add a filter to allow for the local network IP range
hr = filters->Add(CComBSTR(ipfirst), CComBSTR(iplast), VARIANT_TRUE);
if(FAILED(hr))
goto error;
// copy the filters to the server
hr = server->SetIPFilters(filters);
if(FAILED(hr))
goto error;
error:
return hr;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.