diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2009-03-04 14:47:33 -0500 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-03-04 15:18:16 -0500 |
commit | 92ebf7d739306c9e3a83af71d616f33173b19b0c (patch) | |
tree | 320bd571906076cc8cf93ba6233d57e3abd3aee5 /server/sbus | |
parent | e84fcf62e9dd948ff2013c133aeb6581ffad4d80 (diff) | |
download | sssd-92ebf7d739306c9e3a83af71d616f33173b19b0c.tar.gz sssd-92ebf7d739306c9e3a83af71d616f33173b19b0c.tar.xz sssd-92ebf7d739306c9e3a83af71d616f33173b19b0c.zip |
Implement SetUserAttributes in the InfoPipe
SetUserAttributes is now available for use in the Infopipe.
I also reorganized a few of the internal InfoPipe objects to
reduce code duplication.
One very simple test is included in this checkin to validate that
the parser is working.
Diffstat (limited to 'server/sbus')
-rw-r--r-- | server/sbus/sssd_dbus.h | 1 | ||||
-rw-r--r-- | server/sbus/sssd_dbus_common.c | 36 |
2 files changed, 37 insertions, 0 deletions
diff --git a/server/sbus/sssd_dbus.h b/server/sbus/sssd_dbus.h index 8dd0d3e30..2496ae895 100644 --- a/server/sbus/sssd_dbus.h +++ b/server/sbus/sssd_dbus.h @@ -128,4 +128,5 @@ void sbus_conn_send_reply(struct sbus_conn_ctx *conn_ctx, int sbus_is_dbus_fixed_type(int dbus_type); int sbus_is_dbus_string_type(int dbus_type); +size_t sbus_get_dbus_type_size(int dbus_type); #endif /* _SSSD_DBUS_H_*/ diff --git a/server/sbus/sssd_dbus_common.c b/server/sbus/sssd_dbus_common.c index e5011aa60..3b8a3271b 100644 --- a/server/sbus/sssd_dbus_common.c +++ b/server/sbus/sssd_dbus_common.c @@ -72,3 +72,39 @@ int sbus_is_dbus_string_type(int dbus_type) } return false; } + +size_t sbus_get_dbus_type_size(int dbus_type) +{ + size_t ret; + + switch(dbus_type) { + /* 1-byte types */ + case DBUS_TYPE_BYTE: + ret = 1; + break; + + /* 2-byte types */ + case DBUS_TYPE_INT16: + case DBUS_TYPE_UINT16: + ret = 2; + break; + + /* 4-byte types */ + case DBUS_TYPE_BOOLEAN: + case DBUS_TYPE_INT32: + case DBUS_TYPE_UINT32: + ret = 4; + break; + + /* 8-byte types */ + case DBUS_TYPE_INT64: + case DBUS_TYPE_UINT64: + case DBUS_TYPE_DOUBLE: + ret = 8; + break; + + default: + ret = 0; + } + return ret; +} |