Skip to content

Commit b1c8355

Browse files
committed
[#168] Add missing iRODS types and members
This change adds missing check_auth_credentials type. Adds tcp_keepalive members to rodsEnv as well as connection pool timeout member which was not added before. Also added session_signature member of RcComm and session_props member of RsComm. -Wmissing-field-initializers is raised by a missing member of sockaddr_in called sin_zero. This member has been removed in bwg2001-004. For more information, see http://www.opengroup.org/platform/resolutions/bwg2001-many.html Even though sin_zero must be included in the member list for sockaddr_in for a complete member initialization list, we do not expose it as a property for this type in the rule engine because sin_zero is not part of the standard and may not be available in the future. The missing member is included to silence the warning.
1 parent cec6a2a commit b1c8355

7 files changed

Lines changed: 77 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ add_library(
7373
"${CMAKE_CURRENT_SOURCE_DIR}/src/types/system/sys/stat.cpp"
7474
"${CMAKE_CURRENT_SOURCE_DIR}/src/types/system/sys/time.cpp"
7575
"${CMAKE_CURRENT_SOURCE_DIR}/src/types/irods/bulkDataObjPut.cpp"
76+
"${CMAKE_CURRENT_SOURCE_DIR}/src/types/irods/check_auth_credentials.cpp"
7677
"${CMAKE_CURRENT_SOURCE_DIR}/src/types/irods/dataCopy.cpp"
7778
"${CMAKE_CURRENT_SOURCE_DIR}/src/types/irods/dataObjCopy.cpp"
7879
"${CMAKE_CURRENT_SOURCE_DIR}/src/types/irods/dataObjInpOut.cpp"
@@ -127,6 +128,7 @@ set(
127128
"${CMAKE_CURRENT_SOURCE_DIR}/include/irods/private/re/python/types/system/sys/stat.hpp"
128129
"${CMAKE_CURRENT_SOURCE_DIR}/include/irods/private/re/python/types/system/sys/time.hpp"
129130
"${CMAKE_CURRENT_SOURCE_DIR}/include/irods/private/re/python/types/irods/bulkDataObjPut.hpp"
131+
"${CMAKE_CURRENT_SOURCE_DIR}/include/irods/private/re/python/types/irods/check_auth_credentials.hpp"
130132
"${CMAKE_CURRENT_SOURCE_DIR}/include/irods/private/re/python/types/irods/dataCopy.hpp"
131133
"${CMAKE_CURRENT_SOURCE_DIR}/include/irods/private/re/python/types/irods/dataObjCopy.hpp"
132134
"${CMAKE_CURRENT_SOURCE_DIR}/include/irods/private/re/python/types/irods/dataObjInpOut.hpp"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#ifndef RE_PYTHON_TYPES_IRODS_CHECK_AUTH_CREDENTIALS_HPP
2+
#define RE_PYTHON_TYPES_IRODS_CHECK_AUTH_CREDENTIALS_HPP
3+
4+
namespace irods::re::python::types
5+
{
6+
void export_CheckAuthCredentialsInput();
7+
} //namespace irods::re::python::types
8+
9+
#endif // RE_PYTHON_TYPES_IRODS_CHECK_AUTH_CREDENTIALS_HPP

src/irods_types.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "irods/private/re/python/types/system/sys/stat.hpp"
1919
#include "irods/private/re/python/types/system/sys/time.hpp"
2020
#include "irods/private/re/python/types/irods/bulkDataObjPut.hpp"
21+
#include "irods/private/re/python/types/irods/check_auth_credentials.hpp"
2122
#include "irods/private/re/python/types/irods/dataCopy.hpp"
2223
#include "irods/private/re/python/types/irods/dataObjCopy.hpp"
2324
#include "irods/private/re/python/types/irods/dataObjInpOut.hpp"
@@ -226,5 +227,7 @@ namespace
226227

227228
py_types::export_FileLseekInp_t();
228229
py_types::export_FileLseekOut_t();
230+
231+
py_types::export_CheckAuthCredentialsInput();
229232
}
230233
} //namespace
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// include this first for defines and pyconfig
2+
#include "irods/private/re/python/types/config.hpp"
3+
4+
#include "irods/private/re/python/types/irods/check_auth_credentials.hpp"
5+
6+
#include <irods/check_auth_credentials.h>
7+
8+
#include "irods/private/re/python/types/array_ref.hpp"
9+
#include "irods/private/re/python/types/init_struct.hpp"
10+
11+
#include <patchlevel.h>
12+
#include <boost/version.hpp>
13+
#pragma GCC diagnostic push
14+
#if PY_VERSION_HEX < 0x030400A2
15+
# pragma GCC diagnostic ignored "-Wregister"
16+
#endif
17+
#if PY_VERSION_HEX >= 0x03090000 && BOOST_VERSION < 107500
18+
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
19+
#endif
20+
#include <boost/python/class.hpp>
21+
#pragma GCC diagnostic pop
22+
23+
namespace bp = boost::python;
24+
25+
namespace irods::re::python::types
26+
{
27+
__attribute__((visibility("hidden"))) void export_CheckAuthCredentialsInput()
28+
{
29+
// clang-format off
30+
bp::class_<CheckAuthCredentialsInput>("CheckAuthCredentialsInput", bp::no_init)
31+
.def("__init__", make_init_function<CheckAuthCredentialsInput>(
32+
&CheckAuthCredentialsInput::username,
33+
&CheckAuthCredentialsInput::zone,
34+
&CheckAuthCredentialsInput::password))
35+
.add_property("username", +[](CheckAuthCredentialsInput *s) { return array_ref<char>{s->username}; })
36+
.add_property("zone", +[](CheckAuthCredentialsInput *s) { return array_ref<char>{s->zone}; })
37+
.add_property("password", +[](CheckAuthCredentialsInput *s) { return array_ref<char>{s->password}; })
38+
;
39+
// clang-format on
40+
}
41+
} //namespace irods::re::python::types

src/types/irods/getRodsEnv.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ namespace irods::re::python::types
6161
&rodsEnv::irodsMaxSizeForSingleBuffer,
6262
&rodsEnv::irodsDefaultNumberTransferThreads,
6363
&rodsEnv::irodsTransBufferSizeForParaTrans,
64-
&rodsEnv::irodsPluginHome))
64+
&rodsEnv::irodsConnectionPoolRefreshTime,
65+
&rodsEnv::irodsPluginHome,
66+
&rodsEnv::tcp_keepalive_intvl,
67+
&rodsEnv::tcp_keepalive_probes,
68+
&rodsEnv::tcp_keepalive_time))
6569
.add_property("rodsUserName", +[](rodsEnv *s) { return array_ref<char>{s->rodsUserName}; })
6670
.add_property("rodsHost", +[](rodsEnv *s) { return array_ref<char>{s->rodsHost}; })
6771
.add_property("rodsPort", &rodsEnv::rodsPort)
@@ -94,7 +98,11 @@ namespace irods::re::python::types
9498
.add_property("irodsMaxSizeForSingleBuffer", &rodsEnv::irodsMaxSizeForSingleBuffer)
9599
.add_property("irodsDefaultNumberTransferThreads", &rodsEnv::irodsDefaultNumberTransferThreads)
96100
.add_property("irodsTransBufferSizeForParaTrans", &rodsEnv::irodsTransBufferSizeForParaTrans)
101+
.add_property("irodsConnectionPoolRefreshTime", &rodsEnv::irodsConnectionPoolRefreshTime)
97102
.add_property("irodsPluginHome", +[](rodsEnv *s) { return array_ref<char>{s->irodsPluginHome}; })
103+
.add_property("tcp_keepalive_intvl", &rodsEnv::tcp_keepalive_intvl)
104+
.add_property("tcp_keepalive_probes", &rodsEnv::tcp_keepalive_probes)
105+
.add_property("tcp_keepalive_time", &rodsEnv::tcp_keepalive_time)
98106
;
99107
// clang-format on
100108
}

src/types/irods/rcConnect.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ namespace irods::re::python::types
166166
&rcComm_t::ssl_on,
167167
&rcComm_t::ssl_ctx,
168168
&rcComm_t::ssl,
169-
&rcComm_t::fileRestart))
169+
&rcComm_t::fileRestart,
170+
&rcComm_t::session_signature))
170171
.add_property("irodsProt", &rcComm_t::irodsProt)
171172
.add_property("host", +[](rcComm_t *s) { return array_ref<char>{s->host}; })
172173
.add_property("sock", &rcComm_t::sock)
@@ -212,6 +213,7 @@ namespace irods::re::python::types
212213
// bp::make_getter(&rcComm_t::ssl, bp::return_internal_reference<1>{}),
213214
// bp::make_setter(&rcComm_t::ssl, bp::with_custodian_and_ward<1, 2>{}))
214215
.add_property("fileRestart", &rcComm_t::fileRestart)
216+
.add_property("session_signature", +[](rcComm_t *s) { return array_ref<char>{s->session_signature}; })
215217
;
216218
// clang-format on
217219
}
@@ -274,7 +276,8 @@ namespace irods::re::python::types
274276
&rsComm_t::key_size,
275277
&rsComm_t::salt_size,
276278
&rsComm_t::num_hash_rounds,
277-
&rsComm_t::encryption_algorithm))
279+
&rsComm_t::encryption_algorithm,
280+
&rsComm_t::session_props))
278281
.add_property("irodsProt", &rsComm_t::irodsProt)
279282
.add_property("sock", &rsComm_t::sock)
280283
.add_property("connectCnt", &rsComm_t::connectCnt)
@@ -325,6 +328,7 @@ namespace irods::re::python::types
325328
.add_property("salt_size", &rsComm_t::salt_size)
326329
.add_property("num_hash_rounds", &rsComm_t::num_hash_rounds)
327330
.add_property("encryption_algorithm", +[](rsComm_t *s) { return array_ref<char>{s->encryption_algorithm}; })
331+
.add_property("session_props", &rsComm_t::session_props)
328332
;
329333
// clang-format on
330334
}

src/types/system/netinet/in.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,16 @@ namespace irods::re::python::types
4141
.def("__init__", make_init_function<sockaddr_in>(
4242
&sockaddr_in::sin_family,
4343
&sockaddr_in::sin_port,
44-
&sockaddr_in::sin_addr))
44+
&sockaddr_in::sin_addr,
45+
&sockaddr_in::sin_zero))
4546
.add_property("sin_family", &sockaddr_in::sin_family)
4647
.add_property("sin_port", &sockaddr_in::sin_port)
4748
.add_property("sin_addr", &sockaddr_in::sin_addr)
49+
// sin_zero is intentionally omitted here because the member is not part of the standard. It is included
50+
// above in the list of members for sockaddr_in because all currently supported platforms include the
51+
// sin_zero member. As such, the struct member is included for make_init_function, but it is not exposed
52+
// as a property in the event that it must be removed in the future. For more information, see bwg2001-004
53+
// here: http://www.opengroup.org/platform/resolutions/bwg2001-many.html
4854
;
4955
// clang-format on
5056
}

0 commit comments

Comments
 (0)