]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
CCAPI should use common ipc and stream code
authorAlexandra Ellwood <lxs@mit.edu>
Tue, 30 Sep 2008 21:23:17 +0000 (21:23 +0000)
committerAlexandra Ellwood <lxs@mit.edu>
Tue, 30 Sep 2008 21:23:17 +0000 (21:23 +0000)
KIM and CCAPI should share the same IPC and stream object types.
Modified CCAPI to use code in src/util (stream) and src/util/mac (ipc)

ticket: new

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20787 dc483132-0cff-0310-8789-dd5450dbe970

60 files changed:
src/ccapi/common/cci_common.h
src/ccapi/common/cci_cred_union.c
src/ccapi/common/cci_cred_union.h
src/ccapi/common/cci_identifier.c
src/ccapi/common/cci_identifier.h
src/ccapi/common/cci_message.c
src/ccapi/common/cci_message.h
src/ccapi/common/cci_stream.c [deleted file]
src/ccapi/common/cci_stream.h [deleted file]
src/ccapi/common/cci_types.h
src/ccapi/common/mac/cci_mig.defs [deleted file]
src/ccapi/common/mac/cci_mig_reply.defs [deleted file]
src/ccapi/common/mac/cci_mig_request.defs [deleted file]
src/ccapi/common/mac/cci_mig_types.h [deleted file]
src/ccapi/common/win/tls.c
src/ccapi/common/win/tls.h
src/ccapi/lib/ccapi_ccache.c
src/ccapi/lib/ccapi_ccache.h
src/ccapi/lib/ccapi_ccache_iterator.c
src/ccapi/lib/ccapi_ccache_iterator.h
src/ccapi/lib/ccapi_context.c
src/ccapi/lib/ccapi_credentials.c
src/ccapi/lib/ccapi_credentials.h
src/ccapi/lib/ccapi_credentials_iterator.c
src/ccapi/lib/ccapi_credentials_iterator.h
src/ccapi/lib/ccapi_ipc.c
src/ccapi/lib/ccapi_ipc.h
src/ccapi/lib/ccapi_os_ipc.h
src/ccapi/lib/mac/ccapi_os_ipc.c
src/ccapi/lib/win/ccapi_os_ipc.cxx
src/ccapi/lib/win/ccs_reply_proc.c
src/ccapi/lib/win/debug.exports
src/ccapi/server/ccs_cache_collection.c
src/ccapi/server/ccs_cache_collection.h
src/ccapi/server/ccs_callback.c
src/ccapi/server/ccs_callback.h
src/ccapi/server/ccs_ccache.c
src/ccapi/server/ccs_ccache.h
src/ccapi/server/ccs_ccache_iterator.c
src/ccapi/server/ccs_ccache_iterator.h
src/ccapi/server/ccs_credentials.c
src/ccapi/server/ccs_credentials.h
src/ccapi/server/ccs_credentials_iterator.c
src/ccapi/server/ccs_credentials_iterator.h
src/ccapi/server/ccs_list.c
src/ccapi/server/ccs_list.h
src/ccapi/server/ccs_list_internal.c
src/ccapi/server/ccs_list_internal.h
src/ccapi/server/ccs_os_server.h
src/ccapi/server/ccs_server.c
src/ccapi/server/ccs_server.h
src/ccapi/server/mac/ccs_os_server.c
src/ccapi/server/win/WorkItem.cpp
src/ccapi/server/win/WorkQueue.cpp
src/ccapi/server/win/WorkQueue.h
src/ccapi/server/win/ccs_os_server.cpp
src/ccapi/server/win/ccs_request_proc.c
src/ccapi/server/win/workitem.h
src/include/k5-ipc_stream.h
src/util/support/ipc_stream.c

index 56f21c3706017ebdd2082213525242f9242dffdc..c1a5d08648740ce344423d66f8d0caf8f677cffa 100644 (file)
@@ -51,6 +51,7 @@
 #include "cci_debugging.h"
 #include "cci_identifier.h"
 #include "cci_message.h"
-#include "cci_stream.h"
+
+#include "k5-ipc_stream.h"
 
 #endif /* CCI_COMMON_H */
index e8e230d49d4cac3639eedd5d46fdb852e231df65..9740ffd473ac46da9fb3284510fa1ef78dcb7fe6 100644 (file)
@@ -49,7 +49,7 @@ static cc_uint32 cci_credentials_v4_release (cc_credentials_v4_t *io_v4creds)
 /* ------------------------------------------------------------------------ */
 
 static cc_uint32 cci_credentials_v4_read (cc_credentials_v4_t **out_v4creds,
-                                          cci_stream_t          io_stream)
+                                          k5_ipc_stream          io_stream)
 {
     cc_int32 err = ccNoError;
     cc_credentials_v4_t *v4creds = NULL;
@@ -63,59 +63,59 @@ static cc_uint32 cci_credentials_v4_read (cc_credentials_v4_t **out_v4creds,
     }
     
     if (!err) {
-        err = cci_stream_read_uint32 (io_stream, &v4creds->version);
+        err = k5_ipc_stream_read_uint32 (io_stream, &v4creds->version);
     }
     
     if (!err) {
-        err = cci_stream_read (io_stream, v4creds->principal, cc_v4_name_size);
+        err = k5_ipc_stream_read (io_stream, v4creds->principal, cc_v4_name_size);
     }
     
     if (!err) {
-        err = cci_stream_read (io_stream, v4creds->principal_instance, cc_v4_instance_size);
+        err = k5_ipc_stream_read (io_stream, v4creds->principal_instance, cc_v4_instance_size);
     }
     
     if (!err) {
-        err = cci_stream_read (io_stream, v4creds->service, cc_v4_name_size);
+        err = k5_ipc_stream_read (io_stream, v4creds->service, cc_v4_name_size);
     }
     
     if (!err) {
-        err = cci_stream_read (io_stream, v4creds->service_instance, cc_v4_instance_size);
+        err = k5_ipc_stream_read (io_stream, v4creds->service_instance, cc_v4_instance_size);
     }
     
     if (!err) {
-        err = cci_stream_read (io_stream, v4creds->realm, cc_v4_realm_size);
+        err = k5_ipc_stream_read (io_stream, v4creds->realm, cc_v4_realm_size);
     }
     
     if (!err) {
-        err = cci_stream_read (io_stream, v4creds->session_key, cc_v4_key_size);
+        err = k5_ipc_stream_read (io_stream, v4creds->session_key, cc_v4_key_size);
     }
     
     if (!err) {
-        err = cci_stream_read_int32 (io_stream, &v4creds->kvno);
+        err = k5_ipc_stream_read_int32 (io_stream, &v4creds->kvno);
     }
     
     if (!err) {
-        err = cci_stream_read_int32 (io_stream, &v4creds->string_to_key_type);
+        err = k5_ipc_stream_read_int32 (io_stream, &v4creds->string_to_key_type);
     }
     
     if (!err) {
-        err = cci_stream_read_time (io_stream, &v4creds->issue_date);
+        err = k5_ipc_stream_read_time (io_stream, &v4creds->issue_date);
     }
     
     if (!err) {
-        err = cci_stream_read_int32 (io_stream, &v4creds->lifetime);
+        err = k5_ipc_stream_read_int32 (io_stream, &v4creds->lifetime);
     }
     
     if (!err) {
-        err = cci_stream_read_uint32 (io_stream, &v4creds->address);
+        err = k5_ipc_stream_read_uint32 (io_stream, &v4creds->address);
     }
     
     if (!err) {
-        err = cci_stream_read_int32 (io_stream, &v4creds->ticket_size);
+        err = k5_ipc_stream_read_int32 (io_stream, &v4creds->ticket_size);
     }
     
     if (!err) {
-        err = cci_stream_read (io_stream, v4creds->ticket, cc_v4_ticket_size);
+        err = k5_ipc_stream_read (io_stream, v4creds->ticket, cc_v4_ticket_size);
     }
     
     if (!err) {
@@ -131,7 +131,7 @@ static cc_uint32 cci_credentials_v4_read (cc_credentials_v4_t **out_v4creds,
 /* ------------------------------------------------------------------------ */
 
 static cc_uint32 cci_credentials_v4_write (cc_credentials_v4_t *in_v4creds,
-                                           cci_stream_t         io_stream)
+                                           k5_ipc_stream         io_stream)
 {
     cc_int32 err = ccNoError;
     
@@ -139,59 +139,59 @@ static cc_uint32 cci_credentials_v4_write (cc_credentials_v4_t *in_v4creds,
     if (!in_v4creds) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_write_uint32 (io_stream, in_v4creds->version);
+        err = k5_ipc_stream_write_uint32 (io_stream, in_v4creds->version);
     }
     
     if (!err) {
-        err = cci_stream_write (io_stream, in_v4creds->principal, cc_v4_name_size);
+        err = k5_ipc_stream_write (io_stream, in_v4creds->principal, cc_v4_name_size);
     }
     
     if (!err) {
-        err = cci_stream_write (io_stream, in_v4creds->principal_instance, cc_v4_instance_size);
+        err = k5_ipc_stream_write (io_stream, in_v4creds->principal_instance, cc_v4_instance_size);
     }
     
     if (!err) {
-        err = cci_stream_write (io_stream, in_v4creds->service, cc_v4_name_size);
+        err = k5_ipc_stream_write (io_stream, in_v4creds->service, cc_v4_name_size);
     }
     
     if (!err) {
-        err = cci_stream_write (io_stream, in_v4creds->service_instance, cc_v4_instance_size);
+        err = k5_ipc_stream_write (io_stream, in_v4creds->service_instance, cc_v4_instance_size);
     }
     
     if (!err) {
-        err = cci_stream_write (io_stream, in_v4creds->realm, cc_v4_realm_size);
+        err = k5_ipc_stream_write (io_stream, in_v4creds->realm, cc_v4_realm_size);
     }
     
     if (!err) {
-        err = cci_stream_write (io_stream, in_v4creds->session_key, cc_v4_key_size);
+        err = k5_ipc_stream_write (io_stream, in_v4creds->session_key, cc_v4_key_size);
     }
     
     if (!err) {
-        err = cci_stream_write_int32 (io_stream, in_v4creds->kvno);
+        err = k5_ipc_stream_write_int32 (io_stream, in_v4creds->kvno);
     }
     
     if (!err) {
-        err = cci_stream_write_int32 (io_stream, in_v4creds->string_to_key_type);
+        err = k5_ipc_stream_write_int32 (io_stream, in_v4creds->string_to_key_type);
     }
     
     if (!err) {
-        err = cci_stream_write_time (io_stream, in_v4creds->issue_date);
+        err = k5_ipc_stream_write_time (io_stream, in_v4creds->issue_date);
     }
     
     if (!err) {
-        err = cci_stream_write_int32 (io_stream, in_v4creds->lifetime);
+        err = k5_ipc_stream_write_int32 (io_stream, in_v4creds->lifetime);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (io_stream, in_v4creds->address);
+        err = k5_ipc_stream_write_uint32 (io_stream, in_v4creds->address);
     }
     
     if (!err) {
-        err = cci_stream_write_int32 (io_stream, in_v4creds->ticket_size);
+        err = k5_ipc_stream_write_int32 (io_stream, in_v4creds->ticket_size);
     }
     
     if (!err) {
-        err = cci_stream_write (io_stream, in_v4creds->ticket, cc_v4_ticket_size);
+        err = k5_ipc_stream_write (io_stream, in_v4creds->ticket, cc_v4_ticket_size);
     }
     
     return cci_check_error (err);
@@ -238,7 +238,7 @@ static cc_uint32 cci_cc_data_release (cc_data *io_ccdata)
 /* ------------------------------------------------------------------------ */
 
 static cc_uint32 cci_cc_data_read (cc_data      *io_ccdata,
-                                   cci_stream_t  io_stream)
+                                   k5_ipc_stream io_stream)
 {
     cc_int32 err = ccNoError;
     cc_uint32 type = 0;
@@ -249,11 +249,11 @@ static cc_uint32 cci_cc_data_read (cc_data      *io_ccdata,
     if (!io_ccdata) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_uint32 (io_stream, &type);
+        err = k5_ipc_stream_read_uint32 (io_stream, &type);
     }
     
     if (!err) {
-        err = cci_stream_read_uint32 (io_stream, &length);
+        err = k5_ipc_stream_read_uint32 (io_stream, &length);
     }
     
     if (!err && length > 0) {
@@ -261,7 +261,7 @@ static cc_uint32 cci_cc_data_read (cc_data      *io_ccdata,
         if (!data) { err = cci_check_error (ccErrNoMem); }
 
         if (!err) {
-            err = cci_stream_read (io_stream, data, length);
+            err = k5_ipc_stream_read (io_stream, data, length);
         }
     }
     
@@ -280,7 +280,7 @@ static cc_uint32 cci_cc_data_read (cc_data      *io_ccdata,
 /* ------------------------------------------------------------------------ */
 
 static cc_uint32 cci_cc_data_write (cc_data      *in_ccdata,
-                                    cci_stream_t  io_stream)
+                                    k5_ipc_stream io_stream)
 {
     cc_int32 err = ccNoError;
     
@@ -288,15 +288,15 @@ static cc_uint32 cci_cc_data_write (cc_data      *in_ccdata,
     if (!in_ccdata) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_write_uint32 (io_stream, in_ccdata->type);
+        err = k5_ipc_stream_write_uint32 (io_stream, in_ccdata->type);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (io_stream, in_ccdata->length);
+        err = k5_ipc_stream_write_uint32 (io_stream, in_ccdata->length);
     }
     
     if (!err && in_ccdata->length > 0) {
-        err = cci_stream_write (io_stream, in_ccdata->data, in_ccdata->length);
+        err = k5_ipc_stream_write (io_stream, in_ccdata->data, in_ccdata->length);
     }
     
     return cci_check_error (err);
@@ -329,7 +329,7 @@ static cc_uint32 cci_cc_data_array_release (cc_data **io_ccdata_array)
 /* ------------------------------------------------------------------------ */
 
 static cc_uint32 cci_cc_data_array_read (cc_data      ***io_ccdata_array,
-                                         cci_stream_t    io_stream)
+                                         k5_ipc_stream    io_stream)
 {
     cc_int32 err = ccNoError;
     cc_uint32 count = 0;
@@ -340,7 +340,7 @@ static cc_uint32 cci_cc_data_array_read (cc_data      ***io_ccdata_array,
     if (!io_ccdata_array) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_uint32 (io_stream, &count);
+        err = k5_ipc_stream_read_uint32 (io_stream, &count);
     }
     
     if (!err && count > 0) {
@@ -376,7 +376,7 @@ static cc_uint32 cci_cc_data_array_read (cc_data      ***io_ccdata_array,
 /* ------------------------------------------------------------------------ */
 
 static cc_uint32 cci_cc_data_array_write (cc_data      **in_ccdata_array,
-                                          cci_stream_t   io_stream)
+                                          k5_ipc_stream   io_stream)
 {
     cc_int32 err = ccNoError;
     cc_uint32 count = 0;
@@ -387,7 +387,7 @@ static cc_uint32 cci_cc_data_array_write (cc_data      **in_ccdata_array,
     if (!err) {
         for (count = 0; in_ccdata_array && in_ccdata_array[count]; count++);
         
-        err = cci_stream_write_uint32 (io_stream, count);
+        err = k5_ipc_stream_write_uint32 (io_stream, count);
     }
     
     if (!err) {
@@ -443,7 +443,7 @@ static cc_uint32 cci_credentials_v5_release (cc_credentials_v5_t *io_v5creds)
 /* ------------------------------------------------------------------------ */
 
 static cc_uint32 cci_credentials_v5_read (cc_credentials_v5_t **out_v5creds,
-                                          cci_stream_t          io_stream)
+                                          k5_ipc_stream          io_stream)
 {
     cc_int32 err = ccNoError;
     cc_credentials_v5_t *v5creds = NULL;
@@ -461,11 +461,11 @@ static cc_uint32 cci_credentials_v5_read (cc_credentials_v5_t **out_v5creds,
     }
     
     if (!err) {
-        err = cci_stream_read_string (io_stream, &v5creds->client);
+        err = k5_ipc_stream_read_string (io_stream, &v5creds->client);
     }
     
     if (!err) {
-        err = cci_stream_read_string (io_stream, &v5creds->server);
+        err = k5_ipc_stream_read_string (io_stream, &v5creds->server);
     }
     
     if (!err) {
@@ -473,27 +473,27 @@ static cc_uint32 cci_credentials_v5_read (cc_credentials_v5_t **out_v5creds,
     }
     
     if (!err) {
-        err = cci_stream_read_time (io_stream, &v5creds->authtime);
+        err = k5_ipc_stream_read_time (io_stream, &v5creds->authtime);
     }
     
     if (!err) {
-        err = cci_stream_read_time (io_stream, &v5creds->starttime);
+        err = k5_ipc_stream_read_time (io_stream, &v5creds->starttime);
     }
     
     if (!err) {
-        err = cci_stream_read_time (io_stream, &v5creds->endtime);
+        err = k5_ipc_stream_read_time (io_stream, &v5creds->endtime);
     }
     
     if (!err) {
-        err = cci_stream_read_time (io_stream, &v5creds->renew_till);
+        err = k5_ipc_stream_read_time (io_stream, &v5creds->renew_till);
     }
     
     if (!err) {
-        err = cci_stream_read_uint32 (io_stream, &v5creds->is_skey);
+        err = k5_ipc_stream_read_uint32 (io_stream, &v5creds->is_skey);
     }
     
     if (!err) {
-        err = cci_stream_read_uint32 (io_stream, &v5creds->ticket_flags);
+        err = k5_ipc_stream_read_uint32 (io_stream, &v5creds->ticket_flags);
     }
     
     if (!err) {
@@ -525,7 +525,7 @@ static cc_uint32 cci_credentials_v5_read (cc_credentials_v5_t **out_v5creds,
 /* ------------------------------------------------------------------------ */
 
 static cc_uint32 cci_credentials_v5_write (cc_credentials_v5_t *in_v5creds,
-                                           cci_stream_t         io_stream)
+                                           k5_ipc_stream         io_stream)
 {
     cc_int32 err = ccNoError;
     
@@ -533,11 +533,11 @@ static cc_uint32 cci_credentials_v5_write (cc_credentials_v5_t *in_v5creds,
     if (!in_v5creds) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_write_string (io_stream, in_v5creds->client);
+        err = k5_ipc_stream_write_string (io_stream, in_v5creds->client);
     }
     
     if (!err) {
-        err = cci_stream_write_string (io_stream, in_v5creds->server);
+        err = k5_ipc_stream_write_string (io_stream, in_v5creds->server);
     }
     
     if (!err) {
@@ -545,27 +545,27 @@ static cc_uint32 cci_credentials_v5_write (cc_credentials_v5_t *in_v5creds,
     }
     
     if (!err) {
-        err = cci_stream_write_time (io_stream, in_v5creds->authtime);
+        err = k5_ipc_stream_write_time (io_stream, in_v5creds->authtime);
     }
     
     if (!err) {
-        err = cci_stream_write_time (io_stream, in_v5creds->starttime);
+        err = k5_ipc_stream_write_time (io_stream, in_v5creds->starttime);
     }
     
     if (!err) {
-        err = cci_stream_write_time (io_stream, in_v5creds->endtime);
+        err = k5_ipc_stream_write_time (io_stream, in_v5creds->endtime);
     }
     
     if (!err) {
-        err = cci_stream_write_time (io_stream, in_v5creds->renew_till);
+        err = k5_ipc_stream_write_time (io_stream, in_v5creds->renew_till);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (io_stream, in_v5creds->is_skey);
+        err = k5_ipc_stream_write_uint32 (io_stream, in_v5creds->is_skey);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (io_stream, in_v5creds->ticket_flags);
+        err = k5_ipc_stream_write_uint32 (io_stream, in_v5creds->ticket_flags);
     }
     
     if (!err) {
@@ -615,7 +615,7 @@ cc_uint32 cci_credentials_union_release (cc_credentials_union *io_cred_union)
 /* ------------------------------------------------------------------------ */
 
 cc_uint32 cci_credentials_union_read (cc_credentials_union **out_credentials_union,
-                                      cci_stream_t           io_stream)
+                                      k5_ipc_stream           io_stream)
 {
     cc_int32 err = ccNoError;
     cc_credentials_union *credentials_union = NULL;
@@ -629,7 +629,7 @@ cc_uint32 cci_credentials_union_read (cc_credentials_union **out_credentials_uni
     }
     
     if (!err) {
-        err = cci_stream_read_uint32 (io_stream, &credentials_union->version);
+        err = k5_ipc_stream_read_uint32 (io_stream, &credentials_union->version);
     }
     
     if (!err) {
@@ -660,7 +660,7 @@ cc_uint32 cci_credentials_union_read (cc_credentials_union **out_credentials_uni
 /* ------------------------------------------------------------------------ */
 
 cc_uint32 cci_credentials_union_write (const cc_credentials_union *in_credentials_union,
-                                       cci_stream_t                io_stream)
+                                       k5_ipc_stream                io_stream)
 {
     cc_int32 err = ccNoError;
     
@@ -668,7 +668,7 @@ cc_uint32 cci_credentials_union_write (const cc_credentials_union *in_credential
     if (!in_credentials_union) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_write_uint32 (io_stream, in_credentials_union->version);
+        err = k5_ipc_stream_write_uint32 (io_stream, in_credentials_union->version);
     }
     
     if (!err) {
index 3264d350a5f8a1748d2b744c79901bc9d8cae946..44dd6348d9b4214a53cd3d301338f074394bc4c6 100644 (file)
 cc_uint32 cci_credentials_union_release (cc_credentials_union *io_credentials);
 
 cc_uint32 cci_credentials_union_read (cc_credentials_union **out_credentials_union,
-                                      cci_stream_t           io_stream);
+                                      k5_ipc_stream           io_stream);
 
 cc_uint32 cci_credentials_union_write (const cc_credentials_union *in_credentials_union,
-                                       cci_stream_t                io_stream);
+                                       k5_ipc_stream                io_stream);
 
 cc_uint32 cci_cred_union_release (cred_union *io_cred_union);
 
index dac2e15449f695a1d9d98ae9e3874c410420702c..5ca962f1cdc6057d5bf6192de9af2a152404b14a 100644 (file)
@@ -242,7 +242,7 @@ cc_int32 cci_identifier_is_initialized (cci_identifier_t  in_identifier,
 /* ------------------------------------------------------------------------ */
 
 cc_uint32 cci_identifier_read (cci_identifier_t *out_identifier,
-                               cci_stream_t      io_stream)
+                               k5_ipc_stream      io_stream)
 {
     cc_int32 err = ccNoError;
     cci_uuid_string_t server_id = NULL;
@@ -252,19 +252,19 @@ cc_uint32 cci_identifier_read (cci_identifier_t *out_identifier,
     if (!io_stream     ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_string (io_stream, &server_id);
+        err = k5_ipc_stream_read_string (io_stream, &server_id);
     }
 
     if (!err) {
-        err = cci_stream_read_string (io_stream, &object_id);
+        err = k5_ipc_stream_read_string (io_stream, &object_id);
     }    
      
     if (!err) {
         err = cci_identifier_alloc (out_identifier, server_id, object_id);
     }
     
-    if (server_id) { free (server_id); }
-    if (object_id) { free (object_id); }
+    k5_ipc_stream_free_string (server_id);
+    k5_ipc_stream_free_string (object_id);
     
     return cci_check_error (err);
 }
@@ -272,7 +272,7 @@ cc_uint32 cci_identifier_read (cci_identifier_t *out_identifier,
 /* ------------------------------------------------------------------------ */
 
 cc_uint32 cci_identifier_write (cci_identifier_t in_identifier,
-                                cci_stream_t     io_stream)
+                                k5_ipc_stream     io_stream)
 {
     cc_int32 err = ccNoError;
     
@@ -280,11 +280,11 @@ cc_uint32 cci_identifier_write (cci_identifier_t in_identifier,
     if (!io_stream    ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_write_string (io_stream, in_identifier->server_id);
+        err = k5_ipc_stream_write_string (io_stream, in_identifier->server_id);
     }
     
     if (!err) {
-        err = cci_stream_write_string (io_stream, in_identifier->object_id);
+        err = k5_ipc_stream_write_string (io_stream, in_identifier->object_id);
     }
     
     return cci_check_error (err);
index 7d835de0a3aea827787bbd7fe816a8f181de4bef..2c7ea20abf4dfd5e118bd52af647d29eb41c3a02 100644 (file)
@@ -57,9 +57,9 @@ cc_int32 cci_identifier_is_initialized (cci_identifier_t  in_identifier,
                                         cc_uint32        *out_is_initialized);
 
 cc_uint32 cci_identifier_read (cci_identifier_t *out_identifier,
-                               cci_stream_t      io_stream);
+                               k5_ipc_stream      io_stream);
 
 cc_uint32 cci_identifier_write (cci_identifier_t in_identifier,
-                                cci_stream_t     io_stream);
+                                k5_ipc_stream     io_stream);
 
 #endif /* CCI_IDENTIFIER_H */
index 4152e6c3cfe500f4e84f771b8df9a904779021b5..b541558893e16f5406965b45de1fd42832b1f019 100644 (file)
@@ -57,21 +57,21 @@ cc_int32 cci_message_invalid_object_err (enum cci_msg_id_t in_request_name)
 
 /* ------------------------------------------------------------------------ */
 
-cc_int32 cci_message_new_request_header (cci_stream_t      *out_request,
+cc_int32 cci_message_new_request_header (k5_ipc_stream      *out_request,
                                          enum cci_msg_id_t  in_request_name,
                                          cci_identifier_t   in_identifier)
 {
     cc_int32 err = ccNoError;
-    cci_stream_t request = NULL;
+    k5_ipc_stream request = NULL;
     
     if (!out_request) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (request, in_request_name);
+        err = k5_ipc_stream_write_uint32 (request, in_request_name);
     }
     
     if (!err) {
@@ -83,14 +83,14 @@ cc_int32 cci_message_new_request_header (cci_stream_t      *out_request,
         request = NULL;
     }
     
-    cci_stream_release (request);
+    k5_ipc_stream_release (request);
     
     return cci_check_error (err);
 }
 
 /* ------------------------------------------------------------------------ */
 
-cc_int32 cci_message_read_request_header (cci_stream_t       in_request,
+cc_int32 cci_message_read_request_header (k5_ipc_stream       in_request,
                                           enum cci_msg_id_t *out_request_name,
                                           cci_identifier_t  *out_identifier)
 {
@@ -103,7 +103,7 @@ cc_int32 cci_message_read_request_header (cci_stream_t       in_request,
     if (!out_identifier  ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_uint32 (in_request, &request_name);
+        err = k5_ipc_stream_read_uint32 (in_request, &request_name);
     }
     
     if (!err) {
@@ -123,20 +123,20 @@ cc_int32 cci_message_read_request_header (cci_stream_t       in_request,
 
 /* ------------------------------------------------------------------------ */
 
-cc_int32 cci_message_new_reply_header (cci_stream_t     *out_reply,
+cc_int32 cci_message_new_reply_header (k5_ipc_stream     *out_reply,
                                        cc_int32          in_error)
 {
     cc_int32 err = ccNoError;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     
     if (!out_reply) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&reply);
+        err = k5_ipc_stream_new (&reply);
     }
     
     if (!err) {
-        err = cci_stream_write_int32 (reply, in_error);
+        err = k5_ipc_stream_write_int32 (reply, in_error);
     }
     
     if (!err) {
@@ -144,14 +144,14 @@ cc_int32 cci_message_new_reply_header (cci_stream_t     *out_reply,
         reply = NULL;
     }
     
-    cci_stream_release (reply);
+    k5_ipc_stream_release (reply);
     
     return cci_check_error (err);
 }
 
 /* ------------------------------------------------------------------------ */
 
-cc_int32 cci_message_read_reply_header (cci_stream_t      in_reply,
+cc_int32 cci_message_read_reply_header (k5_ipc_stream      in_reply,
                                         cc_int32         *out_reply_error)
 {
     cc_int32 err = ccNoError;
@@ -161,7 +161,7 @@ cc_int32 cci_message_read_reply_header (cci_stream_t      in_reply,
     if (!out_reply_error) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_int32 (in_reply, &reply_err);
+        err = k5_ipc_stream_read_int32 (in_reply, &reply_err);
     }
     
     if (!err) {
@@ -170,3 +170,45 @@ cc_int32 cci_message_read_reply_header (cci_stream_t      in_reply,
     
     return cci_check_error (err);
 }
+
+#ifdef TARGET_OS_MAC
+#pragma mark -
+#endif
+
+/* ------------------------------------------------------------------------ */
+
+uint32_t k5_ipc_stream_read_time (k5_ipc_stream  io_stream, 
+                                  cc_time_t     *out_time)
+{
+    int32_t err = 0;
+    int64_t t = 0;
+    
+    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
+    if (!out_time ) { err = cci_check_error (ccErrBadParam); }
+    
+    if (!err) {
+        err = k5_ipc_stream_read_int64 (io_stream, &t);
+    }
+    
+    if (!err) {
+        *out_time = t;
+    }
+    
+    return cci_check_error (err);
+}
+
+/* ------------------------------------------------------------------------ */
+
+uint32_t k5_ipc_stream_write_time (k5_ipc_stream io_stream, 
+                                   cc_time_t     in_time)
+{
+    int32_t err = 0;
+    
+    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
+    
+    if (!err) {
+        err = k5_ipc_stream_write_int64 (io_stream, in_time);
+    }
+    
+    return cci_check_error (err);
+}
index 7cab2dc7662aef9981d01cac36456160ebeb828f..27ed9c1f2d8ff8801358d10a7e84d49034b3aafb 100644 (file)
 
 cc_int32 cci_message_invalid_object_err (enum cci_msg_id_t in_request_name);
 
-cc_int32 cci_message_new_request_header (cci_stream_t     *out_request,
+cc_int32 cci_message_new_request_header (k5_ipc_stream     *out_request,
                                          enum cci_msg_id_t in_request_name,
                                          cci_identifier_t  in_identifier);
 
-cc_int32 cci_message_read_request_header (cci_stream_t       in_request,
+cc_int32 cci_message_read_request_header (k5_ipc_stream       in_request,
                                           enum cci_msg_id_t *out_request_name,
                                           cci_identifier_t  *out_identifier);
 
-cc_int32 cci_message_new_reply_header (cci_stream_t     *out_reply,
+cc_int32 cci_message_new_reply_header (k5_ipc_stream     *out_reply,
                                        cc_int32          in_error);
 
-cc_int32 cci_message_read_reply_header (cci_stream_t  in_reply,
+cc_int32 cci_message_read_reply_header (k5_ipc_stream in_reply,
                                         cc_int32     *out_reply_error);
 
+uint32_t k5_ipc_stream_read_time (k5_ipc_stream  io_stream, 
+                               cc_time_t     *out_time);
+uint32_t k5_ipc_stream_write_time (k5_ipc_stream io_stream, 
+                                cc_time_t     in_time);
+
 #endif /* CCI_MESSAGE_H */
diff --git a/src/ccapi/common/cci_stream.c b/src/ccapi/common/cci_stream.c
deleted file mode 100644 (file)
index 2f06789..0000000
+++ /dev/null
@@ -1,498 +0,0 @@
-/*
- * $Header$
- *
- * Copyright 2006, 2007 Massachusetts Institute of Technology.
- * All Rights Reserved.
- *
- * Export of this software from the United States of America may
- * require a specific license from the United States Government.
- * It is the responsibility of any person or organization contemplating
- * export to obtain such a license before exporting.
- *
- * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
- * distribute this software and its documentation for any purpose and
- * without fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright notice and
- * this permission notice appear in supporting documentation, and that
- * the name of M.I.T. not be used in advertising or publicity pertaining
- * to distribution of the software without specific, written prior
- * permission.  Furthermore if you modify this software you must label
- * your software as modified software and not distribute it in such a
- * fashion that it might be confused with the original M.I.T. software.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose.  It is provided "as is" without express
- * or implied warranty.
- */
-
-#include "cci_common.h"
-#include "k5-platform.h"       /* for byte swapping */
-
-#if !defined(htonll)
-#define htonll(x) k5_htonll(x)
-#endif
-
-#if !defined(ntohll)
-#define ntohll(x) k5_ntohll(x)
-#endif
-
-struct cci_stream_d {
-    char *data;
-    cc_uint64 size;
-    cc_uint64 max_size;
-};
-
-const struct cci_stream_d cci_stream_initializer = { NULL, 0, 0 };
-
-#define CC_STREAM_SIZE_INCREMENT 128
-
-/* ------------------------------------------------------------------------ */
-
-static cc_uint32 cci_stream_reallocate (cci_stream_t io_stream,
-                                        cc_uint64    in_new_size)
-{
-    cc_int32 err = ccNoError;
-    cc_uint64 new_max_size = 0;
-    
-    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        cc_uint64 old_max_size = io_stream->max_size;
-        new_max_size = io_stream->max_size;
-        
-        if (in_new_size > old_max_size) {
-            /* Expand the stream */
-            while (in_new_size > new_max_size) {
-                new_max_size += CC_STREAM_SIZE_INCREMENT;
-            }
-            
-        
-        } else if ((in_new_size + CC_STREAM_SIZE_INCREMENT) < old_max_size) {
-            /* Shrink the array, but never drop below CC_LIST_COUNT_INCREMENT */
-            while ((in_new_size + CC_STREAM_SIZE_INCREMENT) < new_max_size &&
-                   (new_max_size > CC_STREAM_SIZE_INCREMENT)) {
-                new_max_size -= CC_STREAM_SIZE_INCREMENT;
-            }
-        }
-    }
-    
-    if (!err && new_max_size != io_stream->max_size) {
-        char *data = io_stream->data;
-        if (!data) {
-            data = malloc (new_max_size * sizeof (*data));
-        } else {
-            data = realloc (data, new_max_size * sizeof (*data));
-        }
-        
-        if (data) { 
-            io_stream->data = data;
-            io_stream->max_size = new_max_size;
-        } else {
-            err = cci_check_error (ccErrNoMem); 
-        }
-    }
-    
-    return cci_check_error (err);    
-}
-
-/* ------------------------------------------------------------------------ */
-
-cc_int32 cci_stream_new (cci_stream_t *out_stream)
-{
-    cc_int32 err = ccNoError;
-    cci_stream_t stream = NULL;
-    
-    if (!out_stream) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        stream = malloc (sizeof (*stream));
-        if (stream) { 
-            *stream = cci_stream_initializer;
-        } else {
-            err = cci_check_error (ccErrNoMem); 
-        }
-    }
-    
-    if (!err) {
-        *out_stream = stream;
-        stream = NULL;
-    }
-    
-    cci_stream_release (stream);
-    
-    return cci_check_error (err);    
-}
-
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint32 cci_stream_release (cci_stream_t io_stream)
-{      
-    cc_int32 err = ccNoError;
-    
-    if (!err && io_stream) {
-        free (io_stream->data);
-        free (io_stream);
-    }
-    
-    return err;    
-}
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint64 cci_stream_size (cci_stream_t in_stream)
-{
-    return in_stream ? in_stream->size : 0;
-}
-
-
-/* ------------------------------------------------------------------------ */
-
-const char *cci_stream_data (cci_stream_t in_stream)
-{
-    return in_stream ? in_stream->data : NULL;
-}
-
-#ifdef TARGET_OS_MAC
-#pragma mark -
-#endif
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint32 cci_stream_read (cci_stream_t  io_stream, 
-                           void         *io_data, 
-                           cc_uint64     in_size)
-{
-    cc_int32 err = ccNoError;
-    
-    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
-    if (!io_data  ) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        if (in_size > io_stream->size) { 
-            err = cci_check_error (ccErrBadInternalMessage); 
-        }
-    }
-    
-    if (!err) {
-        memcpy (io_data, io_stream->data, in_size);
-        memmove (io_stream->data, &io_stream->data[in_size], 
-                 io_stream->size - in_size);
-        
-        err = cci_stream_reallocate (io_stream, io_stream->size - in_size);
-        
-        if (!err) {
-            io_stream->size -= in_size;
-        }
-    }
-    
-    return cci_check_error (err);
-}
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint32 cci_stream_write (cci_stream_t  io_stream,
-                            const void   *in_data, 
-                            cc_uint64     in_size)
-{
-    cc_int32 err = ccNoError;
-    
-    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
-    if (!in_data  ) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        /* Security check: Do not let the caller overflow the length */
-        if (in_size > (UINT64_MAX - io_stream->size)) {
-            err = cci_check_error (ccErrBadParam);
-        }
-    }
-    
-    if (!err) {
-        err = cci_stream_reallocate (io_stream, io_stream->size + in_size);
-    }
-    
-    if (!err) {
-        memcpy (&io_stream->data[io_stream->size], in_data, in_size);
-        io_stream->size += in_size;
-    }
-    
-    return cci_check_error (err);
-}
-
-#ifdef TARGET_OS_MAC
-#pragma mark -
-#endif
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint32 cci_stream_read_string (cci_stream_t   io_stream, 
-                                  char         **out_string)
-{
-    cc_int32 err = ccNoError;
-    cc_uint32 length = 0;
-    char *string = NULL;
-    
-    if (!io_stream ) { err = cci_check_error (ccErrBadParam); }
-    if (!out_string) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        err = cci_stream_read_uint32 (io_stream, &length);
-    }
-    
-    if (!err) {
-        string = malloc (length);
-        if (!string) { err = cci_check_error (ccErrNoMem); }
-    }
-    
-    if (!err) {
-        err = cci_stream_read (io_stream, string, length);
-    }
-    
-    if (!err) {
-        *out_string = string;
-        string = NULL;
-    }
-    
-    free (string);
-
-    return cci_check_error (err);
-}
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint32 cci_stream_write_string (cci_stream_t  io_stream, 
-                                   const char   *in_string)
-{
-    cc_int32 err = ccNoError;
-    cc_uint32 length = 0;
-    
-    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
-    if (!in_string) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        length = strlen (in_string) + 1;
-        
-        err = cci_stream_write_uint32 (io_stream, length);
-    }
-    
-    if (!err) {
-        err = cci_stream_write (io_stream, in_string, length);
-    }
-    
-    return cci_check_error (err);
-}
-
-#ifdef TARGET_OS_MAC
-#pragma mark -
-#endif
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint32 cci_stream_read_int32 (cci_stream_t  io_stream, 
-                                 cc_int32     *out_int32)
-{
-    cc_int32 err = ccNoError;
-    cc_int32 int32 = 0;
-    
-    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
-    if (!out_int32) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        err = cci_stream_read (io_stream, &int32, sizeof (int32));
-    }
-    
-    if (!err) {
-        *out_int32 = ntohl (int32);
-    }
-    
-    return cci_check_error (err);
-}
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint32 cci_stream_write_int32 (cci_stream_t io_stream, 
-                                  cc_int32     in_int32)
-{
-    cc_int32 err = ccNoError;
-    cc_int32 int32 = htonl (in_int32);
-    
-    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        err = cci_stream_write (io_stream, &int32, sizeof (int32));
-    }
-    
-    return cci_check_error (err);
-}
-
-#ifdef TARGET_OS_MAC
-#pragma mark -
-#endif
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint32 cci_stream_read_uint32 (cci_stream_t  io_stream, 
-                                  cc_uint32    *out_uint32)
-{
-    cc_int32 err = ccNoError;
-    cc_uint32 uint32 = 0;
-    
-    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
-    if (!out_uint32) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        err = cci_stream_read (io_stream, &uint32, sizeof (uint32));
-    }
-    
-    if (!err) {
-        *out_uint32 = ntohl (uint32);
-    }
-    
-    return cci_check_error (err);
-}
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint32 cci_stream_write_uint32 (cci_stream_t io_stream, 
-                                   cc_uint32    in_uint32)
-{
-    cc_int32 err = ccNoError;
-    cc_int32 uint32 = htonl (in_uint32);
-    
-    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        err = cci_stream_write (io_stream, &uint32, sizeof (uint32));
-    }
-    
-    return cci_check_error (err);
-}
-
-#ifdef TARGET_OS_MAC
-#pragma mark -
-#endif
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint32 cci_stream_read_int64 (cci_stream_t  io_stream, 
-                                 cc_int64     *out_int64)
-{
-    cc_int32 err = ccNoError;
-    cc_uint64 int64 = 0;
-    
-    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
-    if (!out_int64) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        err = cci_stream_read (io_stream, &int64, sizeof (int64));
-    }
-    
-    if (!err) {
-        *out_int64 = ntohll (int64);
-    }
-    
-    return cci_check_error (err);
-}
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint32 cci_stream_write_int64 (cci_stream_t io_stream, 
-                                  cc_int64     in_int64)
-{
-    cc_int32 err = ccNoError;
-    cc_int64 int64 = htonll (in_int64);
-    
-    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        err = cci_stream_write (io_stream, &int64, sizeof (int64));
-    }
-    
-    return cci_check_error (err);
-}
-
-
-#ifdef TARGET_OS_MAC
-#pragma mark -
-#endif
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint32 cci_stream_read_uint64 (cci_stream_t  io_stream, 
-                                  cc_uint64     *out_uint64)
-{
-    cc_int32 err = ccNoError;
-    cc_uint64 uint64 = 0;
-    
-    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
-    if (!out_uint64) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        err = cci_stream_read (io_stream, &uint64, sizeof (uint64));
-    }
-    
-    if (!err) {
-        *out_uint64 = ntohll (uint64);
-    }
-    
-    return cci_check_error (err);
-}
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint32 cci_stream_write_uint64 (cci_stream_t io_stream, 
-                                   cc_uint64     in_uint64)
-{
-    cc_int32 err = ccNoError;
-    cc_int64 uint64 = htonll (in_uint64);
-    
-    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        err = cci_stream_write (io_stream, &uint64, sizeof (uint64));
-    }
-    
-    return cci_check_error (err);
-}
-
-#ifdef TARGET_OS_MAC
-#pragma mark -
-#endif
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint32 cci_stream_read_time (cci_stream_t  io_stream, 
-                                cc_time_t    *out_time)
-{
-    cc_int32 err = ccNoError;
-    cc_int64 t = 0;
-    
-    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
-    if (!out_time ) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        err = cci_stream_read_int64 (io_stream, &t);
-    }
-    
-    if (!err) {
-        *out_time = t;
-    }
-    
-    return cci_check_error (err);
-}
-
-/* ------------------------------------------------------------------------ */
-
-cc_uint32 cci_stream_write_time (cci_stream_t io_stream, 
-                                 cc_time_t    in_time)
-{
-    cc_int32 err = ccNoError;
-    
-    if (!io_stream) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        err = cci_stream_write_int64 (io_stream, in_time);
-    }
-    
-    return cci_check_error (err);
-}
diff --git a/src/ccapi/common/cci_stream.h b/src/ccapi/common/cci_stream.h
deleted file mode 100644 (file)
index 76df2c8..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * $Header$
- *
- * Copyright 2006 Massachusetts Institute of Technology.
- * All Rights Reserved.
- *
- * Export of this software from the United States of America may
- * require a specific license from the United States Government.
- * It is the responsibility of any person or organization contemplating
- * export to obtain such a license before exporting.
- *
- * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
- * distribute this software and its documentation for any purpose and
- * without fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright notice and
- * this permission notice appear in supporting documentation, and that
- * the name of M.I.T. not be used in advertising or publicity pertaining
- * to distribution of the software without specific, written prior
- * permission.  Furthermore if you modify this software you must label
- * your software as modified software and not distribute it in such a
- * fashion that it might be confused with the original M.I.T. software.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose.  It is provided "as is" without express
- * or implied warranty.
- */
-
-#ifndef CCI_STREAM_H
-#define CCI_STREAM_H
-
-#include "cci_types.h"
-
-cc_int32 cci_stream_new (cci_stream_t *out_stream);
-
-cc_uint32 cci_stream_release (cci_stream_t io_stream);
-
-cc_uint64 cci_stream_size (cci_stream_t in_stream);
-
-const char *cci_stream_data (cci_stream_t in_stream);
-
-cc_uint32 cci_stream_read (cci_stream_t  in_stream, 
-                           void         *io_data,
-                           cc_uint64     in_size);
-cc_uint32 cci_stream_write (cci_stream_t  in_stream, 
-                            const void   *in_data,
-                            cc_uint64     in_size);
-
-cc_uint32 cci_stream_read_string (cci_stream_t   io_stream, 
-                                  char         **out_string);
-cc_uint32 cci_stream_write_string (cci_stream_t  io_stream, 
-                                   const char   *in_string);
-
-cc_uint32 cci_stream_read_int32 (cci_stream_t  io_stream, 
-                                 cc_int32     *out_int32);
-cc_uint32 cci_stream_write_int32 (cci_stream_t io_stream, 
-                                  cc_int32     in_int32);
-
-cc_uint32 cci_stream_read_uint32 (cci_stream_t  io_stream, 
-                                  cc_uint32    *out_uint32);
-cc_uint32 cci_stream_write_uint32 (cci_stream_t io_stream, 
-                                   cc_uint32    in_uint32);
-
-cc_uint32 cci_stream_read_int64 (cci_stream_t  io_stream, 
-                                 cc_int64     *out_int64);
-cc_uint32 cci_stream_write_int64 (cci_stream_t io_stream, 
-                                  cc_int64     in_int64);
-
-cc_uint32 cci_stream_read_uint64 (cci_stream_t  io_stream, 
-                                  cc_uint64    *out_uint64);
-cc_uint32 cci_stream_write_uint64 (cci_stream_t io_stream, 
-                                   cc_uint64    in_uint64);
-
-cc_uint32 cci_stream_read_time (cci_stream_t  io_stream, 
-                                cc_time_t    *out_time);
-cc_uint32 cci_stream_write_time (cci_stream_t io_stream, 
-                                 cc_time_t    in_time);
-
-#endif /* CCI_STREAM_H */
index 8ace67ce7b4e0650378435a00ca04defad09d57b..20c64701a2f76d6f76ac917c99bbd8b45a36ca7d 100644 (file)
@@ -28,9 +28,7 @@
 #define CCI_TYPES_H
 
 #include <CredentialsCache.h>
-
-struct cci_stream_d;
-typedef struct cci_stream_d *cci_stream_t;
+#include <k5-ipc_stream.h>
 
 typedef char *cci_uuid_string_t;
 
diff --git a/src/ccapi/common/mac/cci_mig.defs b/src/ccapi/common/mac/cci_mig.defs
deleted file mode 100644 (file)
index 3a57368..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/* $Copyright:
- *
- * Copyright 2004-2006 by the Massachusetts Institute of Technology.
- * 
- * All rights reserved.
- * 
- * Export of this software from the United States of America may require a
- * specific license from the United States Government.  It is the
- * responsibility of any person or organization contemplating export to
- * obtain such a license before exporting.
- * 
- * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute
- * this software and its documentation for any purpose and without fee is
- * hereby granted, provided that the above copyright notice appear in all
- * copies and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of M.I.T. not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.  Furthermore if you
- * modify this software you must label your software as modified software
- * and not distribute it in such a fashion that it might be confused with
- * the original MIT software. M.I.T. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- * 
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- * 
- * Individual source code files are copyright MIT, Cygnus Support,
- * OpenVision, Oracle, Sun Soft, FundsXpress, and others.
- * 
- * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,
- * and Zephyr are trademarks of the Massachusetts Institute of Technology
- * (MIT).  No commercial use of these trademarks may be made without prior
- * written permission of MIT.
- * 
- * "Commercial use" means use of a name in a product or other for-profit
- * manner.  It does NOT prevent a commercial firm from referring to the MIT
- * trademarks in order to convey information (although in doing so,
- * recognition of their trademark status should be given).
- * $
- */
-#include <mach/std_types.defs>
-#include <mach/mach_types.defs>
-
-import "cci_mig_types.h";
-
-/* Note the 1024 must be the same as kCCAPIMaxILMsgSize */
-type cci_mipc_inl_request_t = array [ * : 1024 ] of char;
-type cci_mipc_ool_request_t = array [] of char;
-
-type cci_mipc_inl_reply_t = array [ * : 1024 ] of char;
-type cci_mipc_ool_reply_t = array [] of char;
diff --git a/src/ccapi/common/mac/cci_mig_reply.defs b/src/ccapi/common/mac/cci_mig_reply.defs
deleted file mode 100644 (file)
index f500ef9..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/* $Copyright:
- *
- * Copyright 2004-2006 by the Massachusetts Institute of Technology.
- * 
- * All rights reserved.
- * 
- * Export of this software from the United States of America may require a
- * specific license from the United States Government.  It is the
- * responsibility of any person or organization contemplating export to
- * obtain such a license before exporting.
- * 
- * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute
- * this software and its documentation for any purpose and without fee is
- * hereby granted, provided that the above copyright notice appear in all
- * copies and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of M.I.T. not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.  Furthermore if you
- * modify this software you must label your software as modified software
- * and not distribute it in such a fashion that it might be confused with
- * the original MIT software. M.I.T. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- * 
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- * 
- * Individual source code files are copyright MIT, Cygnus Support,
- * OpenVision, Oracle, Sun Soft, FundsXpress, and others.
- * 
- * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,
- * and Zephyr are trademarks of the Massachusetts Institute of Technology
- * (MIT).  No commercial use of these trademarks may be made without prior
- * written permission of MIT.
- * 
- * "Commercial use" means use of a name in a product or other for-profit
- * manner.  It does NOT prevent a commercial firm from referring to the MIT
- * trademarks in order to convey information (although in doing so,
- * recognition of their trademark status should be given).
- * $
- */
-#include "cci_mig.defs"
-subsystem cci 200;
-
-serverprefix cci_mipc_;
-userprefix ccs_mipc_;
-
-/* ",dealloc" means that the vm_read() memory will be moved to 
- * the other process rather than copied.  This is necessary on the
- * client side because we can't know when server has copied our
- * buffers so we can't vm_deallocate() them ourselves. */
-simpleroutine reply (in_reply_port : mach_port_move_send_once_t;
-                     in_inl_reply  : cci_mipc_inl_reply_t;
-                     in_ool_reply  : cci_mipc_ool_reply_t, dealloc);
diff --git a/src/ccapi/common/mac/cci_mig_request.defs b/src/ccapi/common/mac/cci_mig_request.defs
deleted file mode 100644 (file)
index 45887e1..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/* $Copyright:
- *
- * Copyright 2004-2006 by the Massachusetts Institute of Technology.
- * 
- * All rights reserved.
- * 
- * Export of this software from the United States of America may require a
- * specific license from the United States Government.  It is the
- * responsibility of any person or organization contemplating export to
- * obtain such a license before exporting.
- * 
- * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute
- * this software and its documentation for any purpose and without fee is
- * hereby granted, provided that the above copyright notice appear in all
- * copies and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of M.I.T. not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.  Furthermore if you
- * modify this software you must label your software as modified software
- * and not distribute it in such a fashion that it might be confused with
- * the original MIT software. M.I.T. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- * 
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- * 
- * Individual source code files are copyright MIT, Cygnus Support,
- * OpenVision, Oracle, Sun Soft, FundsXpress, and others.
- * 
- * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,
- * and Zephyr are trademarks of the Massachusetts Institute of Technology
- * (MIT).  No commercial use of these trademarks may be made without prior
- * written permission of MIT.
- * 
- * "Commercial use" means use of a name in a product or other for-profit
- * manner.  It does NOT prevent a commercial firm from referring to the MIT
- * trademarks in order to convey information (although in doing so,
- * recognition of their trademark status should be given).
- * $
- */
-#include "cci_mig.defs"
-
-subsystem ccs 100;
-
-serverprefix ccs_mipc_;
-userprefix cci_mipc_;
-
-routine create_client_connection (in_server_port     : mach_port_t;
-                             out out_connection_port : mach_port_t = MACH_MSG_TYPE_MAKE_SEND);
-
-/* ",dealloc" means that the vm_read() memory will be moved to 
- * the other process rather than copied.  This is necessary on the
- * server side because we can't know when client has copied our
- * buffers so we can't vm_deallocate() them ourselves. */
-
-simpleroutine request (in_connection_port : mach_port_t;
-                       in_reply_port      : mach_port_make_send_once_t;
-                       in_inl_request     : cci_mipc_inl_request_t;
-                       in_ool_request     : cci_mipc_ool_request_t, dealloc);
diff --git a/src/ccapi/common/mac/cci_mig_types.h b/src/ccapi/common/mac/cci_mig_types.h
deleted file mode 100644 (file)
index d82d5ac..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/* $Copyright:
-*
-* Copyright 2004-2006 by the Massachusetts Institute of Technology.
-* 
-* All rights reserved.
-* 
-* Export of this software from the United States of America may require a
-* specific license from the United States Government.  It is the
-* responsibility of any person or organization contemplating export to
-* obtain such a license before exporting.
-* 
-* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute
-* this software and its documentation for any purpose and without fee is
-* hereby granted, provided that the above copyright notice appear in all
-* copies and that both that copyright notice and this permission notice
-* appear in supporting documentation, and that the name of M.I.T. not be
-* used in advertising or publicity pertaining to distribution of the
-* software without specific, written prior permission.  Furthermore if you
-* modify this software you must label your software as modified software
-* and not distribute it in such a fashion that it might be confused with
-* the original MIT software. M.I.T. makes no representations about the
-* suitability of this software for any purpose.  It is provided "as is"
-* without express or implied warranty.
-* 
-* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
-* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
-* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-* 
-* Individual source code files are copyright MIT, Cygnus Support,
-* OpenVision, Oracle, Sun Soft, FundsXpress, and others.
-* 
-* Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,
-* and Zephyr are trademarks of the Massachusetts Institute of Technology
-* (MIT).  No commercial use of these trademarks may be made without prior
-* written permission of MIT.
-* 
-* "Commercial use" means use of a name in a product or other for-profit
-* manner.  It does NOT prevent a commercial firm from referring to the MIT
-* trademarks in order to convey information (although in doing so,
-* recognition of their trademark status should be given).
-* $
-*/
-
-#ifndef CCI_MIG_TYPES_H
-#define CCI_MIG_TYPES_H
-
-#include "cci_common.h"
-
-#define kCCAPIMaxILMsgSize 1024
-
-typedef const char  cci_mipc_inl_request_t[kCCAPIMaxILMsgSize];
-typedef const char *cci_mipc_ool_request_t;
-typedef char        cci_mipc_inl_reply_t[kCCAPIMaxILMsgSize];
-typedef char       *cci_mipc_ool_reply_t;
-
-#endif /* CCI_MIG_TYPES_H */
index 45020b57075c41010703fb18c7a7d8b518872d89..5e0e11d7af3ce32e8db81af8b14c05364362c0ca 100644 (file)
@@ -57,7 +57,7 @@ void         tspdata_setRpcAState (struct tspdata* p, RPC_ASYNC_STATE* rpcState)
 
 void         tspdata_setSST       (struct tspdata* p, time_t t)         {p->_sst = t;}
 
-void         tspdata_setStream    (struct tspdata* p, cci_stream_t s)   {p->_stream = s;}
+void         tspdata_setStream    (struct tspdata* p, k5_ipc_stream s)   {p->_stream = s;}
 
 
 BOOL         tspdata_getConnected (const struct tspdata* p)         {return p->_CCAPI_Connected;}
@@ -66,7 +66,7 @@ HANDLE       tspdata_getReplyEvent(const struct tspdata* p)         {return p->_
 
 time_t       tspdata_getSST       (const struct tspdata* p)         {return p->_sst;}
 
-cci_stream_t tspdata_getStream    (const struct tspdata* p)         {return p->_stream;}
+k5_ipc_stream tspdata_getStream    (const struct tspdata* p)         {return p->_stream;}
 
 char*        tspdata_getUUID      (const struct tspdata* p)         {return p->_uuid;}
 
index 1a6086888b3de2c520dba1819a7bb1d3fbff0120..b6761c8bb3368147dc66e103c702a2a016f30631 100644 (file)
@@ -46,7 +46,7 @@ struct tspdata {
     RPC_ASYNC_STATE*    _rpcState;
     HANDLE              _replyEvent;
     time_t              _sst;
-    cci_stream_t        _stream;
+    k5_ipc_stream        _stream;
     char                _uuid[UUID_SIZE];
     };
 
@@ -57,14 +57,14 @@ void            tspdata_setConnected (struct tspdata* p, BOOL b);
 void            tspdata_setReplyEvent(struct tspdata* p, HANDLE h);
 void            tspdata_setRpcAState (struct tspdata* p, RPC_ASYNC_STATE* rpcState);
 void            tspdata_setSST       (struct tspdata* p, time_t t);
-void            tspdata_setStream    (struct tspdata* p, cci_stream_t s);
+void            tspdata_setStream    (struct tspdata* p, k5_ipc_stream s);
 void            tspdata_setUUID      (struct tspdata* p, unsigned char __RPC_FAR* uuidString);
 HANDLE          tspdata_getReplyEvent(const struct tspdata* p);
 
 BOOL             tspdata_getConnected(const struct tspdata* p);
 RPC_ASYNC_STATE* tspdata_getRpcAState(const struct tspdata* p);
 time_t           tspdata_getSST      (const struct tspdata* p);
-cci_stream_t     tspdata_getStream   (const struct tspdata* p);
+k5_ipc_stream     tspdata_getStream   (const struct tspdata* p);
 char*            tspdata_getUUID     (const struct tspdata* p);
 
 BOOL WINAPI PutTspData(DWORD tlsIndex, struct tspdata*  dw);
index cdef6a5d007e7dc2aac213a73db0f1bfc7633f5a..57c6f83aa326d84eaa87876de9bd64a94e070ea1 100644 (file)
@@ -121,7 +121,7 @@ cc_int32 cci_ccache_new (cc_ccache_t      *out_ccache,
 /* ------------------------------------------------------------------------ */
 
 cc_int32 cci_ccache_write (cc_ccache_t  in_ccache,
-                           cci_stream_t in_stream)
+                           k5_ipc_stream in_stream)
 {
     cc_int32 err = ccNoError;
     cci_ccache_t ccache = (cci_ccache_t) in_ccache;
@@ -208,7 +208,7 @@ cc_int32 ccapi_ccache_get_credentials_version (cc_ccache_t  in_ccache,
 {
     cc_int32 err = ccNoError;
     cci_ccache_t ccache = (cci_ccache_t) in_ccache;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     
     if (!in_ccache              ) { err = cci_check_error (ccErrBadParam); }
     if (!out_credentials_version) { err = cci_check_error (ccErrBadParam); }
@@ -221,10 +221,10 @@ cc_int32 ccapi_ccache_get_credentials_version (cc_ccache_t  in_ccache,
     }
     
     if (!err) {
-        err = cci_stream_read_uint32 (reply, out_credentials_version);
+        err = k5_ipc_stream_read_uint32 (reply, out_credentials_version);
     }
     
-    cci_stream_release (reply);
+    k5_ipc_stream_release (reply);
     
     return cci_check_error (err);
 }
@@ -236,7 +236,7 @@ cc_int32 ccapi_ccache_get_name (cc_ccache_t  in_ccache,
 {
     cc_int32 err = ccNoError;
     cci_ccache_t ccache = (cci_ccache_t) in_ccache;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     char *name = NULL;
     
     if (!in_ccache) { err = cci_check_error (ccErrBadParam); }
@@ -250,15 +250,15 @@ cc_int32 ccapi_ccache_get_name (cc_ccache_t  in_ccache,
     }
     
     if (!err) {
-        err = cci_stream_read_string (reply, &name);
+        err = k5_ipc_stream_read_string (reply, &name);
     }
     
     if (!err) {
         err = cci_string_new (out_name, name);
     }
     
-    cci_stream_release (reply);
-    free (name);
+    k5_ipc_stream_release (reply);
+    k5_ipc_stream_free_string (name);
         
     return cci_check_error (err);
 }
@@ -271,19 +271,19 @@ cc_int32 ccapi_ccache_get_principal (cc_ccache_t  in_ccache,
 {
     cc_int32 err = ccNoError;
     cci_ccache_t ccache = (cci_ccache_t) in_ccache;
-    cci_stream_t request = NULL;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream request = NULL;
+    k5_ipc_stream reply = NULL;
     char *principal = NULL;
     
     if (!in_ccache    ) { err = cci_check_error (ccErrBadParam); }
     if (!out_principal) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (request, in_credentials_version);
+        err = k5_ipc_stream_write_uint32 (request, in_credentials_version);
     }
     
     if (!err) {
@@ -294,16 +294,16 @@ cc_int32 ccapi_ccache_get_principal (cc_ccache_t  in_ccache,
     }
     
     if (!err) {
-        err = cci_stream_read_string (reply, &principal);
+        err = k5_ipc_stream_read_string (reply, &principal);
     }
     
     if (!err) {
         err = cci_string_new (out_principal, principal);
     }
     
-    cci_stream_release (request);
-    cci_stream_release (reply);
-    free (principal);
+    k5_ipc_stream_release (request);
+    k5_ipc_stream_release (reply);
+    k5_ipc_stream_free_string (principal);
     
     return cci_check_error (err);
 }
@@ -316,21 +316,21 @@ cc_int32 ccapi_ccache_set_principal (cc_ccache_t  io_ccache,
 {
     cc_int32 err = ccNoError;
     cci_ccache_t ccache = (cci_ccache_t) io_ccache;
-    cci_stream_t request = NULL;
+    k5_ipc_stream request = NULL;
     
     if (!io_ccache   ) { err = cci_check_error (ccErrBadParam); }
     if (!in_principal) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (request, in_credentials_version);
+        err = k5_ipc_stream_write_uint32 (request, in_credentials_version);
     }
     
     if (!err) {
-        err = cci_stream_write_string (request, in_principal);
+        err = k5_ipc_stream_write_string (request, in_principal);
     }
 
     if (!err) {
@@ -340,7 +340,7 @@ cc_int32 ccapi_ccache_set_principal (cc_ccache_t  io_ccache,
                              NULL);
     }
     
-    cci_stream_release (request);
+    k5_ipc_stream_release (request);
 
     return cci_check_error (err);
 }
@@ -352,13 +352,13 @@ cc_int32 ccapi_ccache_store_credentials (cc_ccache_t                 io_ccache,
 {
     cc_int32 err = ccNoError;
     cci_ccache_t ccache = (cci_ccache_t) io_ccache;
-    cci_stream_t request = NULL;
+    k5_ipc_stream request = NULL;
     
     if (!io_ccache           ) { err = cci_check_error (ccErrBadParam); }
     if (!in_credentials_union) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
@@ -372,7 +372,7 @@ cc_int32 ccapi_ccache_store_credentials (cc_ccache_t                 io_ccache,
                              NULL);
     }
     
-    cci_stream_release (request);
+    k5_ipc_stream_release (request);
     
     return cci_check_error (err);
 }
@@ -384,13 +384,13 @@ cc_int32 ccapi_ccache_remove_credentials (cc_ccache_t      io_ccache,
 {
     cc_int32 err = ccNoError;
     cci_ccache_t ccache = (cci_ccache_t) io_ccache;
-    cci_stream_t request = NULL;
+    k5_ipc_stream request = NULL;
     
     if (!io_ccache     ) { err = cci_check_error (ccErrBadParam); }
     if (!in_credentials) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
@@ -404,7 +404,7 @@ cc_int32 ccapi_ccache_remove_credentials (cc_ccache_t      io_ccache,
                              NULL);
     }
     
-    cci_stream_release (request);
+    k5_ipc_stream_release (request);
     
     return cci_check_error (err);
 }
@@ -416,7 +416,7 @@ cc_int32 ccapi_ccache_new_credentials_iterator (cc_ccache_t                in_cc
 {
     cc_int32 err = ccNoError;
     cci_ccache_t ccache = (cci_ccache_t) in_ccache;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     cci_identifier_t identifier = NULL;
     
     if (!in_ccache               ) { err = cci_check_error (ccErrBadParam); }
@@ -437,7 +437,7 @@ cc_int32 ccapi_ccache_new_credentials_iterator (cc_ccache_t                in_cc
         err = cci_credentials_iterator_new (out_credentials_iterator, identifier);
     }
     
-    cci_stream_release (reply);
+    k5_ipc_stream_release (reply);
     cci_identifier_release (identifier);
 
     return cci_check_error (err);
@@ -453,13 +453,13 @@ cc_int32 ccapi_ccache_move (cc_ccache_t io_source_ccache,
     cc_int32 err = ccNoError;
     cci_ccache_t source_ccache = (cci_ccache_t) io_source_ccache;
     cci_ccache_t destination_ccache = (cci_ccache_t) io_destination_ccache;
-    cci_stream_t request = NULL;
+    k5_ipc_stream request = NULL;
     
     if (!io_source_ccache     ) { err = cci_check_error (ccErrBadParam); }
     if (!io_destination_ccache) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
@@ -473,7 +473,7 @@ cc_int32 ccapi_ccache_move (cc_ccache_t io_source_ccache,
                              NULL);
     }
     
-    cci_stream_release (request);
+    k5_ipc_stream_release (request);
 
     return cci_check_error (err);
 }
@@ -486,20 +486,20 @@ cc_int32 ccapi_ccache_lock (cc_ccache_t io_ccache,
 {
     cc_int32 err = ccNoError;
     cci_ccache_t ccache = (cci_ccache_t) io_ccache;
-    cci_stream_t request = NULL;
+    k5_ipc_stream request = NULL;
     
     if (!io_ccache) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (request, in_lock_type);
+        err = k5_ipc_stream_write_uint32 (request, in_lock_type);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (request, in_block);
+        err = k5_ipc_stream_write_uint32 (request, in_block);
     }
     
     if (!err) {
@@ -509,7 +509,7 @@ cc_int32 ccapi_ccache_lock (cc_ccache_t io_ccache,
                              NULL);
     }
     
-    cci_stream_release (request);
+    k5_ipc_stream_release (request);
     
     return cci_check_error (err);
 }
@@ -540,7 +540,7 @@ cc_int32 ccapi_ccache_get_last_default_time (cc_ccache_t  in_ccache,
 {
     cc_int32 err = ccNoError;
     cci_ccache_t ccache = (cci_ccache_t) in_ccache;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     
     if (!in_ccache            ) { err = cci_check_error (ccErrBadParam); }
     if (!out_last_default_time) { err = cci_check_error (ccErrBadParam); }
@@ -553,10 +553,10 @@ cc_int32 ccapi_ccache_get_last_default_time (cc_ccache_t  in_ccache,
     }
     
     if (!err) {
-        err = cci_stream_read_time (reply, out_last_default_time);
+        err = k5_ipc_stream_read_time (reply, out_last_default_time);
     }
     
-    cci_stream_release (reply);
+    k5_ipc_stream_release (reply);
 
     return cci_check_error (err);
 }
@@ -568,7 +568,7 @@ cc_int32 ccapi_ccache_get_change_time (cc_ccache_t  in_ccache,
 {
     cc_int32 err = ccNoError;
     cci_ccache_t ccache = (cci_ccache_t) in_ccache;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     
     if (!in_ccache      ) { err = cci_check_error (ccErrBadParam); }
     if (!out_change_time) { err = cci_check_error (ccErrBadParam); }
@@ -581,10 +581,10 @@ cc_int32 ccapi_ccache_get_change_time (cc_ccache_t  in_ccache,
     }
     
     if (!err) {
-        err = cci_stream_read_time (reply, out_change_time);
+        err = k5_ipc_stream_read_time (reply, out_change_time);
     }
     
-    cci_stream_release (reply);
+    k5_ipc_stream_release (reply);
     
     return cci_check_error (err);
 }
@@ -595,17 +595,17 @@ cc_int32 ccapi_ccache_wait_for_change (cc_ccache_t  in_ccache)
 {
     cc_int32 err = ccNoError;
     cci_ccache_t ccache = (cci_ccache_t) in_ccache;
-    cci_stream_t request = NULL;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream request = NULL;
+    k5_ipc_stream reply = NULL;
     
     if (!in_ccache) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
-        err = cci_stream_write_time (request, ccache->last_wait_for_change_time);
+        err = k5_ipc_stream_write_time (request, ccache->last_wait_for_change_time);
     }
     
     if (!err) {
@@ -616,11 +616,11 @@ cc_int32 ccapi_ccache_wait_for_change (cc_ccache_t  in_ccache)
     }
     
     if (!err) {
-        err = cci_stream_read_time (reply, &ccache->last_wait_for_change_time);
+        err = k5_ipc_stream_read_time (reply, &ccache->last_wait_for_change_time);
     }    
         
-    cci_stream_release (request);
-    cci_stream_release (reply);
+    k5_ipc_stream_release (request);
+    k5_ipc_stream_release (reply);
     
     return cci_check_error (err);
 }
@@ -656,18 +656,18 @@ cc_int32 ccapi_ccache_get_kdc_time_offset (cc_ccache_t  in_ccache,
 {
     cc_int32 err = ccNoError;
     cci_ccache_t ccache = (cci_ccache_t) in_ccache;
-    cci_stream_t request = NULL;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream request = NULL;
+    k5_ipc_stream reply = NULL;
     
     if (!in_ccache      ) { err = cci_check_error (ccErrBadParam); }
     if (!out_time_offset) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (request, in_credentials_version);
+        err = k5_ipc_stream_write_uint32 (request, in_credentials_version);
     }
 
     if (!err) {
@@ -678,11 +678,11 @@ cc_int32 ccapi_ccache_get_kdc_time_offset (cc_ccache_t  in_ccache,
     }
     
     if (!err) {
-        err = cci_stream_read_time (reply, out_time_offset);
+        err = k5_ipc_stream_read_time (reply, out_time_offset);
     }
     
-    cci_stream_release (request);
-    cci_stream_release (reply);
+    k5_ipc_stream_release (request);
+    k5_ipc_stream_release (reply);
     
     return cci_check_error (err);
 }
@@ -695,20 +695,20 @@ cc_int32 ccapi_ccache_set_kdc_time_offset (cc_ccache_t io_ccache,
 {
     cc_int32 err = ccNoError;
     cci_ccache_t ccache = (cci_ccache_t) io_ccache;
-    cci_stream_t request = NULL;
+    k5_ipc_stream request = NULL;
     
     if (!io_ccache) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (request, in_credentials_version);
+        err = k5_ipc_stream_write_uint32 (request, in_credentials_version);
     }
     
     if (!err) {
-        err = cci_stream_write_time (request, in_time_offset);
+        err = k5_ipc_stream_write_time (request, in_time_offset);
     }
     
     if (!err) {
@@ -718,7 +718,7 @@ cc_int32 ccapi_ccache_set_kdc_time_offset (cc_ccache_t io_ccache,
                              NULL);
     }
     
-    cci_stream_release (request);
+    k5_ipc_stream_release (request);
     
     return cci_check_error (err);
 }
@@ -730,16 +730,16 @@ cc_int32 ccapi_ccache_clear_kdc_time_offset (cc_ccache_t io_ccache,
 {
     cc_int32 err = ccNoError;
     cci_ccache_t ccache = (cci_ccache_t) io_ccache;
-    cci_stream_t request = NULL;
+    k5_ipc_stream request = NULL;
     
     if (!io_ccache) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (request, in_credentials_version);
+        err = k5_ipc_stream_write_uint32 (request, in_credentials_version);
     }
     
     if (!err) {
@@ -749,7 +749,7 @@ cc_int32 ccapi_ccache_clear_kdc_time_offset (cc_ccache_t io_ccache,
                              NULL);
     }
     
-    cci_stream_release (request);
+    k5_ipc_stream_release (request);
     
     return cci_check_error (err);
 }
index 73091b7a0d7559366984e1a49a532d906924175e..1a449c2fb1700c419e98d5ef1edb9a517510d06e 100644 (file)
@@ -35,7 +35,7 @@ cc_int32 cci_ccache_new (cc_ccache_t      *out_ccache,
 cc_int32 ccapi_ccache_release (cc_ccache_t io_ccache);
 
 cc_int32 cci_ccache_write (cc_ccache_t  in_ccache,
-                           cci_stream_t in_stream);
+                           k5_ipc_stream in_stream);
 
 cc_int32 ccapi_ccache_destroy (cc_ccache_t io_ccache);
 
index 1d4dd6c5562c164a9317b4cc1845c9fa9d71a6e7..0f5d241f94fc2c0b9a493bac70d5b1d836b12917 100644 (file)
@@ -100,7 +100,7 @@ cc_int32 cci_ccache_iterator_new (cc_ccache_iterator_t *out_ccache_iterator,
 /* ------------------------------------------------------------------------ */
 
 cc_int32 cci_ccache_iterator_write (cc_ccache_iterator_t in_ccache_iterator,
-                                   cci_stream_t          in_stream)
+                                   k5_ipc_stream          in_stream)
 {
     cc_int32 err = ccNoError;
     cci_ccache_iterator_t ccache_iterator = (cci_ccache_iterator_t) in_ccache_iterator;
@@ -160,7 +160,7 @@ cc_int32 ccapi_ccache_iterator_next (cc_ccache_iterator_t  in_ccache_iterator,
 {
     cc_int32 err = ccNoError;
     cci_ccache_iterator_t ccache_iterator = (cci_ccache_iterator_t) in_ccache_iterator;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     cci_identifier_t identifier = NULL;
     
     if (!in_ccache_iterator) { err = cci_check_error (ccErrBadParam); }
@@ -193,7 +193,7 @@ cc_int32 ccapi_ccache_iterator_next (cc_ccache_iterator_t  in_ccache_iterator,
         err = cci_ccache_new (out_ccache, identifier);
     }
     
-    cci_stream_release (reply);
+    k5_ipc_stream_release (reply);
     cci_identifier_release (identifier);
     
     return cci_check_error (err);
@@ -206,7 +206,7 @@ cc_int32 ccapi_ccache_iterator_clone (cc_ccache_iterator_t  in_ccache_iterator,
 {
     cc_int32 err = ccNoError;
     cci_ccache_iterator_t ccache_iterator = (cci_ccache_iterator_t) in_ccache_iterator;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     cc_uint32 initialized = 0;
     cci_identifier_t identifier = NULL;
     
@@ -240,7 +240,7 @@ cc_int32 ccapi_ccache_iterator_clone (cc_ccache_iterator_t  in_ccache_iterator,
     }
 
     cci_identifier_release (identifier);
-    cci_stream_release (reply);
+    k5_ipc_stream_release (reply);
     
     return cci_check_error (err);
 }
index 8b07b076398e643c866a69d7d5aa64d2008aeaf8..9556aa0eb2550c69b4c0dcfc2a2c4cd507563653 100644 (file)
@@ -33,7 +33,7 @@ cc_int32 cci_ccache_iterator_new (cc_ccache_iterator_t *out_ccache_iterator,
                                   cci_identifier_t      in_identifier);
 
 cc_int32 cci_ccache_iterator_write (cc_ccache_iterator_t in_ccache_iterator,
-                                    cci_stream_t          in_stream);
+                                    k5_ipc_stream          in_stream);
 
 cc_int32 ccapi_ccache_iterator_release (cc_ccache_iterator_t io_ccache_iterator);
 
index 3e405679f9f3d299acb854fc2020d872d65bf639..0f1712ea48b6c4d0c06b2407c7c9387c6a0d54ef 100644 (file)
@@ -233,7 +233,7 @@ cc_int32 ccapi_context_get_change_time (cc_context_t  in_context,
 {
     cc_int32 err = ccNoError;
     cci_context_t context = (cci_context_t) in_context;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     
     if (!in_context     ) { err = cci_check_error (ccErrBadParam); }
     if (!out_change_time) { err = cci_check_error (ccErrBadParam); }
@@ -248,11 +248,11 @@ cc_int32 ccapi_context_get_change_time (cc_context_t  in_context,
                                        NULL, &reply);
     }
     
-    if (!err && cci_stream_size (reply) > 0) {
+    if (!err && k5_ipc_stream_size (reply) > 0) {
         cc_time_t change_time = 0;
         
         /* got a response from the server */
-        err = cci_stream_read_time (reply, &change_time);
+        err = k5_ipc_stream_read_time (reply, &change_time);
         
         if (!err) {
             err = cci_context_change_time_update (context->identifier,
@@ -264,7 +264,7 @@ cc_int32 ccapi_context_get_change_time (cc_context_t  in_context,
         err = cci_context_change_time_get (out_change_time);
     }
     
-    cci_stream_release (reply);
+    k5_ipc_stream_release (reply);
     
     return cci_check_error (err);
 }
@@ -275,17 +275,17 @@ cc_int32 ccapi_context_wait_for_change (cc_context_t  in_context)
 {
     cc_int32 err = ccNoError;
     cci_context_t context = (cci_context_t) in_context;
-    cci_stream_t request = NULL;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream request = NULL;
+    k5_ipc_stream reply = NULL;
     
     if (!in_context) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
-        err = cci_stream_write_time (request, context->last_wait_for_change_time);
+        err = k5_ipc_stream_write_time (request, context->last_wait_for_change_time);
     }
 
     if (!err) {
@@ -300,11 +300,11 @@ cc_int32 ccapi_context_wait_for_change (cc_context_t  in_context)
     }
 
     if (!err) {
-        err = cci_stream_read_time (reply, &context->last_wait_for_change_time);
+        err = k5_ipc_stream_read_time (reply, &context->last_wait_for_change_time);
     }
     
-    cci_stream_release (request);
-    cci_stream_release (reply);
+    k5_ipc_stream_release (request);
+    k5_ipc_stream_release (reply);
 
     return cci_check_error (err);
 }
@@ -316,7 +316,7 @@ cc_int32 ccapi_context_get_default_ccache_name (cc_context_t  in_context,
 {
     cc_int32 err = ccNoError;
     cci_context_t context = (cci_context_t) in_context;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     char *reply_name = NULL;
     char *name = NULL;
     
@@ -335,9 +335,9 @@ cc_int32 ccapi_context_get_default_ccache_name (cc_context_t  in_context,
     }
     
     if (!err) {
-        if (cci_stream_size (reply) > 0) {
+        if (k5_ipc_stream_size (reply) > 0) {
             /* got a response from the server */
-            err = cci_stream_read_string (reply, &reply_name);
+            err = k5_ipc_stream_read_string (reply, &reply_name);
             
             if (!err) {
                 name = reply_name;
@@ -351,8 +351,8 @@ cc_int32 ccapi_context_get_default_ccache_name (cc_context_t  in_context,
         err = cci_string_new (out_name, name);
     }
     
-    cci_stream_release (reply);
-    free (reply_name);
+    k5_ipc_stream_release (reply);
+    k5_ipc_stream_free_string (reply_name);
     
     return cci_check_error (err);
 }
@@ -365,8 +365,8 @@ cc_int32 ccapi_context_open_ccache (cc_context_t  in_context,
 {
     cc_int32 err = ccNoError;
     cci_context_t context = (cci_context_t) in_context;
-    cci_stream_t request = NULL;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream request = NULL;
+    k5_ipc_stream reply = NULL;
     cci_identifier_t identifier = NULL;
     
     if (!in_context  ) { err = cci_check_error (ccErrBadParam); }
@@ -374,11 +374,11 @@ cc_int32 ccapi_context_open_ccache (cc_context_t  in_context,
     if (!out_ccache  ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
-        err = cci_stream_write_string (request, in_name);
+        err = k5_ipc_stream_write_string (request, in_name);
     }
     
     if (!err) {
@@ -392,7 +392,7 @@ cc_int32 ccapi_context_open_ccache (cc_context_t  in_context,
                                        &reply);
     }
     
-    if (!err && !(cci_stream_size (reply) > 0)) {
+    if (!err && !(k5_ipc_stream_size (reply) > 0)) {
         err = ccErrCCacheNotFound;
     }
     
@@ -405,8 +405,8 @@ cc_int32 ccapi_context_open_ccache (cc_context_t  in_context,
     }
     
     cci_identifier_release (identifier);
-    cci_stream_release (reply);
-    cci_stream_release (request);
+    k5_ipc_stream_release (reply);
+    k5_ipc_stream_release (request);
     
     return cci_check_error (err);
 }
@@ -418,7 +418,7 @@ cc_int32 ccapi_context_open_default_ccache (cc_context_t  in_context,
 {
     cc_int32 err = ccNoError;
     cci_context_t context = (cci_context_t) in_context;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     cci_identifier_t identifier = NULL;
     
     if (!in_context) { err = cci_check_error (ccErrBadParam); }
@@ -435,7 +435,7 @@ cc_int32 ccapi_context_open_default_ccache (cc_context_t  in_context,
                                        &reply);
     }
     
-    if (!err && !(cci_stream_size (reply) > 0)) {
+    if (!err && !(k5_ipc_stream_size (reply) > 0)) {
         err = ccErrCCacheNotFound;
     }
     
@@ -448,7 +448,7 @@ cc_int32 ccapi_context_open_default_ccache (cc_context_t  in_context,
     }
     
     cci_identifier_release (identifier);
-    cci_stream_release (reply);
+    k5_ipc_stream_release (reply);
     
     return cci_check_error (err);
 }
@@ -463,8 +463,8 @@ cc_int32 ccapi_context_create_ccache (cc_context_t  in_context,
 {
     cc_int32 err = ccNoError;
     cci_context_t context = (cci_context_t) in_context;
-    cci_stream_t request = NULL;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream request = NULL;
+    k5_ipc_stream reply = NULL;
     cci_identifier_t identifier = NULL;
     
     if (!in_context  ) { err = cci_check_error (ccErrBadParam); }
@@ -473,19 +473,19 @@ cc_int32 ccapi_context_create_ccache (cc_context_t  in_context,
     if (!out_ccache  ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
-        err = cci_stream_write_string (request, in_name);
+        err = k5_ipc_stream_write_string (request, in_name);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (request, in_cred_vers);
+        err = k5_ipc_stream_write_uint32 (request, in_cred_vers);
     }
     
     if (!err) {
-        err = cci_stream_write_string (request, in_principal);
+        err = k5_ipc_stream_write_string (request, in_principal);
     }
     
     if (!err) {
@@ -508,8 +508,8 @@ cc_int32 ccapi_context_create_ccache (cc_context_t  in_context,
     }
     
     cci_identifier_release (identifier);
-    cci_stream_release (reply);
-    cci_stream_release (request);
+    k5_ipc_stream_release (reply);
+    k5_ipc_stream_release (request);
     
     return cci_check_error (err);
 }
@@ -523,8 +523,8 @@ cc_int32 ccapi_context_create_default_ccache (cc_context_t  in_context,
 {
     cc_int32 err = ccNoError;
     cci_context_t context = (cci_context_t) in_context;
-    cci_stream_t request = NULL;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream request = NULL;
+    k5_ipc_stream reply = NULL;
     cci_identifier_t identifier = NULL;
     
     if (!in_context  ) { err = cci_check_error (ccErrBadParam); }
@@ -532,15 +532,15 @@ cc_int32 ccapi_context_create_default_ccache (cc_context_t  in_context,
     if (!out_ccache  ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (request, in_cred_vers);
+        err = k5_ipc_stream_write_uint32 (request, in_cred_vers);
     }
     
     if (!err) {
-        err = cci_stream_write_string (request, in_principal);
+        err = k5_ipc_stream_write_string (request, in_principal);
     }
     
     if (!err) {
@@ -563,8 +563,8 @@ cc_int32 ccapi_context_create_default_ccache (cc_context_t  in_context,
     }
     
     cci_identifier_release (identifier);
-    cci_stream_release (reply);
-    cci_stream_release (request);
+    k5_ipc_stream_release (reply);
+    k5_ipc_stream_release (request);
     
     return cci_check_error (err);
 }
@@ -578,8 +578,8 @@ cc_int32 ccapi_context_create_new_ccache (cc_context_t in_context,
 {
     cc_int32 err = ccNoError;
     cci_context_t context = (cci_context_t) in_context;
-    cci_stream_t request = NULL;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream request = NULL;
+    k5_ipc_stream reply = NULL;
     cci_identifier_t identifier = NULL;
     
     if (!in_context  ) { err = cci_check_error (ccErrBadParam); }
@@ -587,15 +587,15 @@ cc_int32 ccapi_context_create_new_ccache (cc_context_t in_context,
     if (!out_ccache  ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (request, in_cred_vers);
+        err = k5_ipc_stream_write_uint32 (request, in_cred_vers);
     }
     
     if (!err) {
-        err = cci_stream_write_string (request, in_principal);
+        err = k5_ipc_stream_write_string (request, in_principal);
     }
     
     if (!err) {
@@ -618,8 +618,8 @@ cc_int32 ccapi_context_create_new_ccache (cc_context_t in_context,
     }
     
     cci_identifier_release (identifier);
-    cci_stream_release (reply);
-    cci_stream_release (request);
+    k5_ipc_stream_release (reply);
+    k5_ipc_stream_release (request);
     
     return cci_check_error (err);
 }
@@ -631,7 +631,7 @@ cc_int32 ccapi_context_new_ccache_iterator (cc_context_t          in_context,
 {
     cc_int32 err = ccNoError;
     cci_context_t context = (cci_context_t) in_context;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     cci_identifier_t identifier = NULL;
     
     if (!in_context  ) { err = cci_check_error (ccErrBadParam); }
@@ -649,7 +649,7 @@ cc_int32 ccapi_context_new_ccache_iterator (cc_context_t          in_context,
     }
     
     if (!err) {
-        if (cci_stream_size (reply) > 0) {
+        if (k5_ipc_stream_size (reply) > 0) {
             err = cci_identifier_read (&identifier, reply);
         } else {
             identifier = cci_identifier_uninitialized;
@@ -660,7 +660,7 @@ cc_int32 ccapi_context_new_ccache_iterator (cc_context_t          in_context,
         err = cci_ccache_iterator_new (out_iterator, identifier);
     }
 
-    cci_stream_release (reply);
+    k5_ipc_stream_release (reply);
     cci_identifier_release (identifier);
 
     return cci_check_error (err);
@@ -674,20 +674,20 @@ cc_int32 ccapi_context_lock (cc_context_t in_context,
 {
     cc_int32 err = ccNoError;
     cci_context_t context = (cci_context_t) in_context;
-    cci_stream_t request = NULL;
+    k5_ipc_stream request = NULL;
     
     if (!in_context) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&request);
+        err = k5_ipc_stream_new (&request);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (request, in_lock_type);
+        err = k5_ipc_stream_write_uint32 (request, in_lock_type);
     }
     
     if (!err) {
-        err = cci_stream_write_uint32 (request, in_block);
+        err = k5_ipc_stream_write_uint32 (request, in_block);
     }
     
     if (!err) {
@@ -701,7 +701,7 @@ cc_int32 ccapi_context_lock (cc_context_t in_context,
                              NULL);
     }
     
-    cci_stream_release (request);
+    k5_ipc_stream_release (request);
     
     return cci_check_error (err);
 }
@@ -773,7 +773,7 @@ static cc_int32 cci_context_sync (cci_context_t in_context,
 {
     cc_int32 err = ccNoError;
     cci_context_t context = (cci_context_t) in_context;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     cci_identifier_t new_identifier = NULL;
     
     if (!in_context) { err = cci_check_error (ccErrBadParam); }
@@ -796,7 +796,7 @@ static cc_int32 cci_context_sync (cci_context_t in_context,
     }
     
     if (!err) {
-        if (cci_stream_size (reply) > 0) {
+        if (k5_ipc_stream_size (reply) > 0) {
             err = cci_identifier_read (&new_identifier, reply);
         } else {
             new_identifier = cci_identifier_uninitialized;
@@ -828,7 +828,7 @@ static cc_int32 cci_context_sync (cci_context_t in_context,
     }
         
     cci_identifier_release (new_identifier);
-    cci_stream_release (reply);
+    k5_ipc_stream_release (reply);
     
     return cci_check_error (err);
 }
index 3c40478fbed12b2a90dadaf16972b945d6fd0f4e..6a3b4cb91a3843ba58a02d1e32bbd1b211f7be24 100644 (file)
@@ -61,7 +61,7 @@ cc_credentials_union cci_credentials_union_initializer = {
 /* ------------------------------------------------------------------------ */
 
 cc_int32 cci_credentials_read (cc_credentials_t *out_credentials,
-                               cci_stream_t      in_stream)
+                               k5_ipc_stream      in_stream)
 {
     cc_int32 err = ccNoError;
     cci_credentials_t credentials = NULL;
@@ -108,7 +108,7 @@ cc_int32 cci_credentials_read (cc_credentials_t *out_credentials,
 /* ------------------------------------------------------------------------ */
 
 cc_int32 cci_credentials_write (cc_credentials_t in_credentials,
-                                cci_stream_t     in_stream)
+                                k5_ipc_stream     in_stream)
 {
     cc_int32 err = ccNoError;
     cci_credentials_t credentials = (cci_credentials_t) in_credentials;
index bde0b2c03da16dd478cf5782186789fc75ff3c4e..9307e684bfbcb6dbd42dd0702fdf1d3f65a58488 100644 (file)
 #include "cci_common.h"
 
 cc_int32 cci_credentials_read (cc_credentials_t *out_credentials,
-                               cci_stream_t      in_stream);
+                               k5_ipc_stream      in_stream);
 
 cc_int32 cci_credentials_write (cc_credentials_t in_credentials,
-                                cci_stream_t     in_stream);
+                                k5_ipc_stream     in_stream);
 
 cc_int32 ccapi_credentials_compare (cc_credentials_t  in_credentials,
                                     cc_credentials_t  in_compare_to_credentials,
index b6cd85c5d451cf6ca109cb2761f56649ceff7934..4571b64f84dccb5237bab16c40e6e6d3179a3a46 100644 (file)
@@ -100,7 +100,7 @@ cc_int32 cci_credentials_iterator_new (cc_credentials_iterator_t *out_credential
 /* ------------------------------------------------------------------------ */
 
 cc_int32 cci_credentials_iterator_write (cc_credentials_iterator_t in_credentials_iterator,
-                                         cci_stream_t              in_stream)
+                                         k5_ipc_stream              in_stream)
 {
     cc_int32 err = ccNoError;
     cci_credentials_iterator_t credentials_iterator = (cci_credentials_iterator_t) in_credentials_iterator;
@@ -152,7 +152,7 @@ cc_int32 ccapi_credentials_iterator_next (cc_credentials_iterator_t  in_credenti
 {
     cc_int32 err = ccNoError;
     cci_credentials_iterator_t credentials_iterator = (cci_credentials_iterator_t) in_credentials_iterator;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     
     if (!in_credentials_iterator) { err = cci_check_error (ccErrBadParam); }
     if (!out_credentials        ) { err = cci_check_error (ccErrBadParam); }
@@ -168,7 +168,7 @@ cc_int32 ccapi_credentials_iterator_next (cc_credentials_iterator_t  in_credenti
         err = cci_credentials_read (out_credentials, reply);
     }
     
-    cci_stream_release (reply);
+    k5_ipc_stream_release (reply);
     
     return cci_check_error (err);
 }
@@ -180,7 +180,7 @@ cc_int32 ccapi_credentials_iterator_clone (cc_credentials_iterator_t  in_credent
 {
     cc_int32 err = ccNoError;
     cci_credentials_iterator_t credentials_iterator = (cci_credentials_iterator_t) in_credentials_iterator;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     cci_identifier_t identifier = NULL;
         
     if (!in_credentials_iterator ) { err = cci_check_error (ccErrBadParam); }
@@ -201,7 +201,7 @@ cc_int32 ccapi_credentials_iterator_clone (cc_credentials_iterator_t  in_credent
         err = cci_credentials_iterator_new (out_credentials_iterator, identifier);
     }
     
-    cci_stream_release (reply);
+    k5_ipc_stream_release (reply);
     cci_identifier_release (identifier);
     
     return cci_check_error (err);
index 12647d4ee24fbdfffcbbb9c0ff85b31b96235387..84c3d2e229adba9958b475e9c8b37b00ac5f6ac3 100644 (file)
@@ -33,7 +33,7 @@ cc_int32 cci_credentials_iterator_new (cc_credentials_iterator_t *out_credential
                                        cci_identifier_t           in_identifier);
 
 cc_int32 cci_credentials_iterator_write (cc_credentials_iterator_t in_credentials_iterator,
-                                         cci_stream_t              in_stream);
+                                         k5_ipc_stream              in_stream);
 
 cc_int32 ccapi_credentials_iterator_release (cc_credentials_iterator_t io_credentials_iterator);
 
index fe541db4eb628823f9a76aa2d7b0417b57214894..43993dc76d43575e12b1a1844aae3baae7214216 100644 (file)
@@ -46,12 +46,12 @@ void cci_ipc_thread_fini (void)
 static cc_int32 _cci_ipc_send (enum cci_msg_id_t  in_request_name,
                                cc_int32           in_launch_server,
                                cci_identifier_t   in_identifier,
-                               cci_stream_t       in_request_data,
-                               cci_stream_t      *out_reply_data)
+                               k5_ipc_stream       in_request_data,
+                               k5_ipc_stream      *out_reply_data)
 {
     cc_int32 err = ccNoError;
-    cci_stream_t request = NULL;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream request = NULL;
+    k5_ipc_stream reply = NULL;
     cc_int32 reply_error = 0;
     
     if (!in_identifier) { err = cci_check_error (ccErrBadParam); }
@@ -65,15 +65,15 @@ static cc_int32 _cci_ipc_send (enum cci_msg_id_t  in_request_name,
     }
     
     if (!err && in_request_data) {
-        err = cci_stream_write (request, 
-                                cci_stream_data (in_request_data), 
-                                cci_stream_size (in_request_data));
+        err = k5_ipc_stream_write (request, 
+                                k5_ipc_stream_data (in_request_data), 
+                                k5_ipc_stream_size (in_request_data));
     }
     
     if (!err) {
         err = cci_os_ipc (in_launch_server, request, &reply);
 
-        if (!err && cci_stream_size (reply) > 0) {
+        if (!err && k5_ipc_stream_size (reply) > 0) {
             err = cci_message_read_reply_header (reply, &reply_error);
         }
     }
@@ -87,8 +87,8 @@ static cc_int32 _cci_ipc_send (enum cci_msg_id_t  in_request_name,
         reply = NULL; /* take ownership */
     }
     
-    cci_stream_release (request);
-    cci_stream_release (reply);
+    k5_ipc_stream_release (request);
+    k5_ipc_stream_release (reply);
     
     return cci_check_error (err);
 }
@@ -97,8 +97,8 @@ static cc_int32 _cci_ipc_send (enum cci_msg_id_t  in_request_name,
 
 cc_int32 cci_ipc_send (enum cci_msg_id_t  in_request_name,
                        cci_identifier_t   in_identifier,
-                       cci_stream_t       in_request_data,
-                       cci_stream_t      *out_reply_data)
+                       k5_ipc_stream       in_request_data,
+                       k5_ipc_stream      *out_reply_data)
 {
     return cci_check_error (_cci_ipc_send (in_request_name, 1,
                                            in_identifier,
@@ -110,8 +110,8 @@ cc_int32 cci_ipc_send (enum cci_msg_id_t  in_request_name,
 
 cc_int32 cci_ipc_send_no_launch (enum cci_msg_id_t  in_request_name,
                                  cci_identifier_t   in_identifier,
-                                 cci_stream_t       in_request_data,
-                                 cci_stream_t      *out_reply_data)
+                                 k5_ipc_stream       in_request_data,
+                                 k5_ipc_stream      *out_reply_data)
 {
     return cci_check_error (_cci_ipc_send (in_request_name, 0,
                                            in_identifier,
index 2ba7637ac6c1809759298a81f3bd574b3f0d0608..5b7d5d3745be7e03b23e82792ec7b0f22544811f 100644 (file)
@@ -34,12 +34,12 @@ void cci_ipc_thread_fini (void);
 
 cc_int32 cci_ipc_send (enum cci_msg_id_t  in_request_name,
                        cci_identifier_t   in_identifier,
-                       cci_stream_t       in_request_data,
-                       cci_stream_t      *out_reply_data);
+                       k5_ipc_stream       in_request_data,
+                       k5_ipc_stream      *out_reply_data);
 
 cc_int32 cci_ipc_send_no_launch (enum cci_msg_id_t  in_request_name,
                                  cci_identifier_t   in_identifier,
-                                 cci_stream_t       in_request_data,
-                                 cci_stream_t      *out_reply_data);
+                                 k5_ipc_stream       in_request_data,
+                                 k5_ipc_stream      *out_reply_data);
 
 #endif /* CCAPI_IPC_H */
index 0121adadb767f1c08e3f8bc7c6dcb20226578b8d..b5e040599731000b5fc1faec0e00bde902307543 100644 (file)
@@ -33,7 +33,7 @@ cc_int32 cci_os_ipc_thread_init (void);
 void cci_os_ipc_thread_fini (void);
 
 cc_int32 cci_os_ipc (cc_int32      in_launch_server,
-                     cci_stream_t  in_request_stream,
-                     cci_stream_t *out_reply_stream);
+                     k5_ipc_stream in_request_stream,
+                     k5_ipc_stream *out_reply_stream);
 
 #endif /* CCAPI_OS_IPC_H */
index bde357e16bba7e8297fdbf02361853948d3c97b7..e0a81d878605f895d7e708fdf128fb6402990b64 100644 (file)
 
 #include "ccapi_os_ipc.h"
 
-#include <Kerberos/kipc_client.h>
-#include "cci_mig_request.h"
-#include "cci_mig_replyServer.h"
-#include "k5-thread.h"
+#include "k5_mig_client.h"
 
 #define cci_server_bundle_id "edu.mit.Kerberos.CCacheServer"
 
 
 cc_int32 cci_os_ipc_thread_init (void)
 {
-    cc_int32 err = ccNoError;
-
-    err = k5_key_register (K5_KEY_CCAPI_REQUEST_PORT, free);
-    
-    if (!err) {
-        err = k5_key_register (K5_KEY_CCAPI_REPLY_STREAM, NULL);
-    }
-    
-    if (!err) {
-        err = k5_key_register (K5_KEY_CCAPI_SERVER_DIED, NULL);
-    }
-    
-    return err;
+    /* k5_ipc_send_request handles all thread data for us */
+    return 0;
 }
 
 /* ------------------------------------------------------------------------ */
 
 void cci_os_ipc_thread_fini (void)
-{    
-    k5_key_delete (K5_KEY_CCAPI_REQUEST_PORT);
-    k5_key_delete (K5_KEY_CCAPI_REPLY_STREAM);
-    k5_key_delete (K5_KEY_CCAPI_SERVER_DIED);
-}
-
-#pragma mark -
-
-/* ------------------------------------------------------------------------ */
-
-static boolean_t cci_server_demux (mach_msg_header_t *request, 
-                                   mach_msg_header_t *reply) 
-{
-    boolean_t handled = false;
-    
-    if (!handled && request->msgh_id == MACH_NOTIFY_NO_SENDERS) {
-        cc_int32 *server_died = k5_getspecific (K5_KEY_CCAPI_SERVER_DIED);
-        if (!server_died) { 
-            *server_died = 1;
-        }
-        
-        handled = 1; /* server died */
-    }
-    
-    if (!handled) {
-        handled = cci_server (request, reply);
-    }
-    
-    return handled;    
-}
-
-/* ------------------------------------------------------------------------ */
-
-kern_return_t cci_mipc_reply (mach_port_t             in_reply_port,
-                              cci_mipc_inl_reply_t    in_inl_reply,
-                              mach_msg_type_number_t  in_inl_replyCnt,
-                              cci_mipc_ool_reply_t    in_ool_reply,
-                              mach_msg_type_number_t  in_ool_replyCnt)
 {
-    kern_return_t err = KERN_SUCCESS;
-    cci_stream_t reply_stream = NULL;
-    
-    if (!err) {
-        reply_stream = k5_getspecific (K5_KEY_CCAPI_REPLY_STREAM);
-        if (!reply_stream) { err = cci_check_error (ccErrBadInternalMessage); }
-    }
-    
-    if (!err) {
-        if (in_inl_replyCnt) {
-            err = cci_stream_write (reply_stream, in_inl_reply, in_inl_replyCnt);
-            
-        } else if (in_ool_replyCnt) {
-            err = cci_stream_write (reply_stream, in_ool_reply, in_ool_replyCnt);
-            
-        } else {
-            err = cci_check_error (ccErrBadInternalMessage);
-        }
-    }
-    
-    if (in_ool_replyCnt) { vm_deallocate (mach_task_self (), (vm_address_t) in_ool_reply, in_ool_replyCnt); }
-    
-    return cci_check_error (err);
+    /* k5_ipc_send_request handles all thread data for us */
+    return;
 }
 
-#pragma mark -
-
 /* ------------------------------------------------------------------------ */
 
 cc_int32 cci_os_ipc (cc_int32      in_launch_server,
-                     cci_stream_t  in_request_stream,
-                     cci_stream_t *out_reply_stream)
+                     k5_ipc_stream in_request_stream,
+                     k5_ipc_stream *out_reply_stream)
 {
-    cc_int32 err = ccNoError;
-    cc_int32 done = 0;
-    cc_int32 try_count = 0;
-    cc_int32 server_died = 0;
-    mach_port_t server_port = MACH_PORT_NULL;
-    mach_port_t *request_port = NULL;
-    mach_port_t reply_port = MACH_PORT_NULL;
-    const char *inl_request = NULL; /* char * so we can pass the buffer in directly */
-    mach_msg_type_number_t inl_request_length = 0;
-    cci_mipc_ool_request_t ool_request = NULL;
-    mach_msg_type_number_t ool_request_length = 0;
-    cci_stream_t reply_stream = NULL;
-    
-    if (!in_request_stream) { err = cci_check_error (ccErrBadParam); }
-    if (!out_reply_stream ) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        /* depending on how big the message is, use the fast inline buffer or  
-         * the slow dynamically allocated buffer */
-        mach_msg_type_number_t request_length = cci_stream_size (in_request_stream);
-        
-        if (request_length > kCCAPIMaxILMsgSize) {
-            cci_debug_printf ("%s choosing out of line buffer (size is %d)", 
-                              __FUNCTION__, request_length);
-            
-            err = vm_read (mach_task_self (), 
-                           (vm_address_t) cci_stream_data (in_request_stream), request_length, 
-                           (vm_address_t *) &ool_request, &ool_request_length);        
-        } else {
-            //cci_debug_printf ("%s choosing in line buffer (size is %d)",
-            //                  __FUNCTION__, request_length);
-            
-            inl_request_length = request_length;
-            inl_request = cci_stream_data (in_request_stream);
-        }
-    }
-
-    if (!err) {
-        request_port = k5_getspecific (K5_KEY_CCAPI_REQUEST_PORT);
-        
-        if (!request_port) {
-            request_port = malloc (sizeof (mach_port_t));
-            if (!request_port) { err = cci_check_error (ccErrNoMem); }
-            
-            if (!err) {
-                *request_port = MACH_PORT_NULL;
-                err = k5_setspecific (K5_KEY_CCAPI_REQUEST_PORT, request_port);
-            }
-        }
-    }
-    
-    if (!err) {
-        err = mach_port_allocate (mach_task_self (), MACH_PORT_RIGHT_RECEIVE, &reply_port);
-    }
-
-    if (!err) {
-        err = kipc_client_lookup_server (cci_server_bundle_id, 
-                                         in_launch_server, TRUE, &server_port);
-    }
-    
-    while (!err && !done) {
-        if (!err && !MACH_PORT_VALID (*request_port)) {
-            err = cci_mipc_create_client_connection (server_port, request_port);
-        }
-        
-        if (!err) {
-            err = cci_mipc_request (*request_port, reply_port,
-                                    inl_request, inl_request_length,
-                                    ool_request, ool_request_length);
-            
-        }
-        
-        if (err == MACH_SEND_INVALID_DEST) {
-            if (try_count < 2) { 
-                try_count++;
-                err = ccNoError;
-            }
-
-            if (request_port && MACH_PORT_VALID (*request_port)) {
-                mach_port_mod_refs (mach_task_self(), *request_port, MACH_PORT_RIGHT_SEND, -1 );
-                *request_port = MACH_PORT_NULL;
-            }    
-            
-            /* Look up server name again without using the cached copy */
-            err = kipc_client_lookup_server (cci_server_bundle_id,  
-                                             in_launch_server, FALSE, &server_port);
-            
-        } else {
-            /* Talked to server, though we may have gotten an error */
-            done = 1;
-            
-            /* Because we use ",dealloc" ool_request will be freed by mach. 
-            * Don't double free it. */
-            ool_request = NULL; 
-            ool_request_length = 0;                
-        }            
-    }
-    
-    if (!err) {
-        err = cci_stream_new (&reply_stream);
-    }
-    
-    if (!err) {
-        err = k5_setspecific (K5_KEY_CCAPI_REPLY_STREAM, reply_stream);
-    }
-    
-    if (!err) {
-        err = k5_setspecific (K5_KEY_CCAPI_SERVER_DIED, &server_died);
-    }
-    
-    if (!err) {
-        mach_port_t old_notification_target = MACH_PORT_NULL;
-
-        /* request no-senders notification so we can get a message when server dies */
-        err = mach_port_request_notification (mach_task_self (), reply_port, 
-                                              MACH_NOTIFY_NO_SENDERS, 1, reply_port, 
-                                              MACH_MSG_TYPE_MAKE_SEND_ONCE, 
-                                              &old_notification_target);
-        
-        if (!err && old_notification_target != MACH_PORT_NULL) {
-            mach_port_deallocate (mach_task_self (), old_notification_target);
-        }
-    }
-    
-    if (!err) {
-        err = mach_msg_server_once (cci_server_demux, kkipc_max_message_size, 
-                                    reply_port, MACH_MSG_TIMEOUT_NONE);
-    }
-    
-    if (!err && server_died) {
-        err = cci_check_error (ccErrServerUnavailable);
-    }
-    
-    if (err == BOOTSTRAP_UNKNOWN_SERVICE && !in_launch_server) {
-        err = ccNoError;  /* If the server is not running just return an empty stream. */
-    }
-    
-    if (!err) {
-        *out_reply_stream = reply_stream;
-        reply_stream = NULL;
-    }
-    
-    k5_setspecific (K5_KEY_CCAPI_REPLY_STREAM, NULL);
-    k5_setspecific (K5_KEY_CCAPI_SERVER_DIED, NULL);
-    if (reply_port != MACH_PORT_NULL) { mach_port_destroy (mach_task_self (), reply_port); }
-    if (ool_request_length          ) { vm_deallocate (mach_task_self (), (vm_address_t) ool_request, ool_request_length); }
-    if (reply_stream                ) { cci_stream_release (reply_stream); }
-    
-    return cci_check_error (err);    
+    return cci_check_error (k5_ipc_send_request (cci_server_bundle_id,
+                                                 in_launch_server,
+                                                 in_request_stream,
+                                                 out_reply_stream));
 }
index 4b00e2de388fad41088e905a465d6377cb4108dd..6ccd59b9ab1ac94e6185fae7f5de23b7dd93b49e 100644 (file)
@@ -68,9 +68,9 @@ static DWORD    handle_exception(DWORD code);
 
 extern "C" {
 cc_int32        cci_os_ipc_msg( cc_int32        in_launch_server,
-                                cci_stream_t    in_request_stream,
+                                k5_ipc_stream    in_request_stream,
                                 cc_int32        in_msg,
-                                cci_stream_t*   out_reply_stream);
+                                k5_ipc_stream*   out_reply_stream);
     }
 
 /* ------------------------------------------------------------------------ */
@@ -128,8 +128,8 @@ void cci_os_ipc_thread_fini (void)
 /* ------------------------------------------------------------------------ */
 
 cc_int32 cci_os_ipc (cc_int32      in_launch_server,
-                     cci_stream_t  in_request_stream,
-                     cci_stream_t* out_reply_stream) {
+                     k5_ipc_stream in_request_stream,
+                     k5_ipc_stream* out_reply_stream) {
     return cci_os_ipc_msg(  in_launch_server, 
                             in_request_stream, 
                             CCMSG_REQUEST, 
@@ -137,9 +137,9 @@ cc_int32 cci_os_ipc (cc_int32      in_launch_server,
     }
 
 extern "C" cc_int32 cci_os_ipc_msg( cc_int32        in_launch_server,
-                                    cci_stream_t    in_request_stream,
+                                    k5_ipc_stream    in_request_stream,
                                     cc_int32        in_msg,
-                                    cci_stream_t*   out_reply_stream) {
+                                    k5_ipc_stream*   out_reply_stream) {
 
     cc_int32        err             = ccNoError;
     cc_int32        done            = FALSE;
@@ -207,8 +207,8 @@ extern "C" cc_int32 cci_os_ipc_msg( cc_int32        in_launch_server,
                 in_msg,                         /* Message type */
                 (unsigned char*)&ptspdata,      /* Our tspdata* will be sent back to the reply proc. */
                 (unsigned char*)uuid,
-                cci_stream_size(in_request_stream),
-                (unsigned char*)cci_stream_data(in_request_stream), /* Data buffer */
+                k5_ipc_stream_size(in_request_stream),
+                (unsigned char*)k5_ipc_stream_data(in_request_stream), /* Data buffer */
                 sst,                            /* session start time */
                 (long*)(&err) );                /* Return code */
             }
index 79f45e4c8142e1d1c541bddc252a7a0923852802..8eb340836706660a469e450197fc81c07584e98d 100644 (file)
@@ -47,17 +47,17 @@ void ccs_rpc_request_reply(
     HANDLE          hEvent  = openThreadEvent(uuid, REPLY_SUFFIX);
     DWORD*          p       = (DWORD*)(tspHandle);
     struct tspdata* tsp     = (struct tspdata*)*p;
-    cci_stream_t    stream;
+    k5_ipc_stream    stream;
     long            status  = 0;
 #if 0
     cci_debug_printf("%s! msg#:%d SST:%ld uuid:%s", __FUNCTION__, rpcmsg, srvStartTime, uuid);
 #endif
     if (!status) {                         
-        status = cci_stream_new (&stream);  /* Create a stream for the request data */
+        status = k5_ipc_stream_new (&stream);  /* Create a stream for the request data */
         }
 
     if (!status) {                          /* Put the data into the stream */
-        status = cci_stream_write (stream, chIn, cbIn);
+        status = k5_ipc_stream_write (stream, chIn, cbIn);
         }
 
     if (!status) {                          /* Put the data into the stream */
index 0c3765325ab91e2f76392c9409e4e7f9d4518200..d7fbcc152d4e2c10db186a9737e97b803520d08e 100644 (file)
@@ -3,9 +3,9 @@
     cci_os_ipc\r
     cci_os_ipc_msg\r
     cci_os_ipc_thread_init\r
-    cci_stream_data\r
-    cci_stream_write\r
-    cci_stream_new\r
+    k5_ipc_stream_data\r
+    k5_ipc_stream_write\r
+    k5_ipc_stream_new\r
     \r
     ccs_authenticate\r
     \r
index 1a312b90e96704d5b107e5f673b4862dcb611def..b09ae8d8ef37e6b22d87ba3f61e587e5890e2bf4 100644 (file)
@@ -137,7 +137,7 @@ cc_int32 ccs_cache_collection_compare_identifier (ccs_cache_collection_t  in_cac
 cc_int32 ccs_cache_collection_changed (ccs_cache_collection_t io_cache_collection)
 {
     cc_int32 err = ccNoError;
-    cci_stream_t reply_data = NULL;
+    k5_ipc_stream reply_data = NULL;
     
     if (!io_cache_collection) { err = cci_check_error (ccErrBadParam); }
 
@@ -152,11 +152,11 @@ cc_int32 ccs_cache_collection_changed (ccs_cache_collection_t io_cache_collectio
     }
     
     if (!err) {
-        err = cci_stream_new (&reply_data);
+        err = k5_ipc_stream_new (&reply_data);
     }
 
     if (!err) {
-       err = cci_stream_write_time (reply_data, io_cache_collection->last_changed_time);
+       err = k5_ipc_stream_write_time (reply_data, io_cache_collection->last_changed_time);
     }
     
     if (!err) {
@@ -181,7 +181,7 @@ cc_int32 ccs_cache_collection_changed (ccs_cache_collection_t io_cache_collectio
         err = ccs_os_notify_cache_collection_changed (io_cache_collection);
     }
     
-    cci_stream_release (reply_data);
+    k5_ipc_stream_release (reply_data);
     
     return cci_check_error (err);
 }
@@ -572,8 +572,8 @@ cc_int32 ccs_cache_collection_set_default_ccache (ccs_cache_collection_t  io_cac
 /* ------------------------------------------------------------------------ */
 
 static cc_int32 ccs_cache_collection_context_release (ccs_cache_collection_t io_cache_collection,
-                                                       cci_stream_t           in_request_data,
-                                                       cci_stream_t           io_reply_data)
+                                                       k5_ipc_stream           in_request_data,
+                                                       k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     
@@ -591,8 +591,8 @@ static cc_int32 ccs_cache_collection_context_release (ccs_cache_collection_t io_
 /* ------------------------------------------------------------------------ */
 
 static cc_int32 ccs_cache_collection_sync (ccs_cache_collection_t io_cache_collection,
-                                            cci_stream_t           in_request_data,
-                                            cci_stream_t           io_reply_data)
+                                            k5_ipc_stream           in_request_data,
+                                            k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     
@@ -610,8 +610,8 @@ static cc_int32 ccs_cache_collection_sync (ccs_cache_collection_t io_cache_colle
 /* ------------------------------------------------------------------------ */
 
 static cc_int32 ccs_cache_collection_get_change_time (ccs_cache_collection_t io_cache_collection,
-                                                       cci_stream_t           in_request_data,
-                                                       cci_stream_t           io_reply_data)
+                                                       k5_ipc_stream           in_request_data,
+                                                       k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     
@@ -620,7 +620,7 @@ static cc_int32 ccs_cache_collection_get_change_time (ccs_cache_collection_t io_
     if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_write_time (io_reply_data, io_cache_collection->last_changed_time);
+        err = k5_ipc_stream_write_time (io_reply_data, io_cache_collection->last_changed_time);
     }
     
     return cci_check_error (err);    
@@ -631,8 +631,8 @@ static cc_int32 ccs_cache_collection_get_change_time (ccs_cache_collection_t io_
 static cc_int32 ccs_cache_collection_wait_for_change (ccs_pipe_t              in_client_pipe,
                                                      ccs_pipe_t              in_reply_pipe,
                                                      ccs_cache_collection_t  io_cache_collection,
-                                                     cci_stream_t            in_request_data,
-                                                     cci_stream_t            io_reply_data,
+                                                     k5_ipc_stream            in_request_data,
+                                                     k5_ipc_stream            io_reply_data,
                                                      cc_uint32              *out_will_block)
 {
     cc_int32 err = ccNoError;
@@ -646,12 +646,12 @@ static cc_int32 ccs_cache_collection_wait_for_change (ccs_pipe_t              in
     if (!out_will_block                 ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_time (in_request_data, &last_wait_for_change_time);
+        err = k5_ipc_stream_read_time (in_request_data, &last_wait_for_change_time);
     }
     
     if (!err) {
        if (last_wait_for_change_time < io_cache_collection->last_changed_time) {
-           err = cci_stream_write_time (io_reply_data, io_cache_collection->last_changed_time);
+           err = k5_ipc_stream_write_time (io_reply_data, io_cache_collection->last_changed_time);
        
        } else {
            ccs_callback_t callback = NULL;
@@ -685,8 +685,8 @@ static cc_int32 ccs_cache_collection_wait_for_change (ccs_pipe_t              in
 /* ------------------------------------------------------------------------ */
 
 static cc_int32 ccs_cache_collection_get_default_ccache_name (ccs_cache_collection_t io_cache_collection,
-                                                               cci_stream_t           in_request_data,
-                                                               cci_stream_t           io_reply_data)
+                                                               k5_ipc_stream           in_request_data,
+                                                               k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     cc_uint64 count = 0;
@@ -709,7 +709,7 @@ static cc_int32 ccs_cache_collection_get_default_ccache_name (ccs_cache_collecti
                 err = ccs_ccache_write_name (ccache, io_reply_data);
             }
         } else {
-            err = cci_stream_write_string (io_reply_data, 
+            err = k5_ipc_stream_write_string (io_reply_data, 
                                            k_cci_context_initial_ccache_name);
         }
     }
@@ -720,8 +720,8 @@ static cc_int32 ccs_cache_collection_get_default_ccache_name (ccs_cache_collecti
 /* ------------------------------------------------------------------------ */
 
 static cc_int32 ccs_cache_collection_open_ccache (ccs_cache_collection_t io_cache_collection,
-                                                   cci_stream_t           in_request_data,
-                                                   cci_stream_t           io_reply_data)
+                                                   k5_ipc_stream           in_request_data,
+                                                   k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     char *name = NULL;
@@ -732,7 +732,7 @@ static cc_int32 ccs_cache_collection_open_ccache (ccs_cache_collection_t io_cach
     if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_string (in_request_data, &name);
+        err = k5_ipc_stream_read_string (in_request_data, &name);
     }
     
     if (!err) {
@@ -744,7 +744,7 @@ static cc_int32 ccs_cache_collection_open_ccache (ccs_cache_collection_t io_cach
         err = ccs_ccache_write (ccache, io_reply_data);
     }
     
-    free (name);
+    k5_ipc_stream_free_string (name);
         
     return cci_check_error (err);    
 }
@@ -752,8 +752,8 @@ static cc_int32 ccs_cache_collection_open_ccache (ccs_cache_collection_t io_cach
 /* ------------------------------------------------------------------------ */
 
 static cc_int32 ccs_cache_collection_open_default_ccache (ccs_cache_collection_t io_cache_collection,
-                                                           cci_stream_t           in_request_data,
-                                                           cci_stream_t           io_reply_data)
+                                                           k5_ipc_stream           in_request_data,
+                                                           k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     ccs_ccache_t ccache = NULL;
@@ -777,8 +777,8 @@ static cc_int32 ccs_cache_collection_open_default_ccache (ccs_cache_collection_t
 /* ------------------------------------------------------------------------ */
 
 static cc_int32 ccs_cache_collection_create_ccache (ccs_cache_collection_t io_cache_collection,
-                                                    cci_stream_t           in_request_data,
-                                                    cci_stream_t           io_reply_data)
+                                                    k5_ipc_stream           in_request_data,
+                                                    k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     char *name = NULL;
@@ -791,15 +791,15 @@ static cc_int32 ccs_cache_collection_create_ccache (ccs_cache_collection_t io_ca
     if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_string (in_request_data, &name);
+        err = k5_ipc_stream_read_string (in_request_data, &name);
     }
     
     if (!err) {
-        err = cci_stream_read_uint32 (in_request_data, &cred_vers);
+        err = k5_ipc_stream_read_uint32 (in_request_data, &cred_vers);
     }
     
     if (!err) {
-        err = cci_stream_read_string (in_request_data, &principal);
+        err = k5_ipc_stream_read_string (in_request_data, &principal);
     }
     
     if (!err) {
@@ -824,8 +824,8 @@ static cc_int32 ccs_cache_collection_create_ccache (ccs_cache_collection_t io_ca
         err = ccs_cache_collection_changed (io_cache_collection);
     }
     
-    free (name);
-    free (principal);
+    k5_ipc_stream_free_string (name);
+    k5_ipc_stream_free_string (principal);
     
     return cci_check_error (err);    
 }
@@ -833,8 +833,8 @@ static cc_int32 ccs_cache_collection_create_ccache (ccs_cache_collection_t io_ca
 /* ------------------------------------------------------------------------ */
 
 static cc_int32 ccs_cache_collection_create_default_ccache (ccs_cache_collection_t io_cache_collection,
-                                                            cci_stream_t           in_request_data,
-                                                            cci_stream_t           io_reply_data)
+                                                            k5_ipc_stream           in_request_data,
+                                                            k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     cc_uint32 cred_vers;
@@ -846,11 +846,11 @@ static cc_int32 ccs_cache_collection_create_default_ccache (ccs_cache_collection
     if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_uint32 (in_request_data, &cred_vers);
+        err = k5_ipc_stream_read_uint32 (in_request_data, &cred_vers);
     }
     
     if (!err) {
-        err = cci_stream_read_string (in_request_data, &principal);
+        err = k5_ipc_stream_read_string (in_request_data, &principal);
     }
     
     if (!err) {
@@ -883,7 +883,7 @@ static cc_int32 ccs_cache_collection_create_default_ccache (ccs_cache_collection
         err = ccs_cache_collection_changed (io_cache_collection);
     }
     
-    free (principal);
+    k5_ipc_stream_free_string (principal);
     
     return cci_check_error (err);    
 }
@@ -891,8 +891,8 @@ static cc_int32 ccs_cache_collection_create_default_ccache (ccs_cache_collection
 /* ------------------------------------------------------------------------ */
 
 static cc_int32 ccs_cache_collection_create_new_ccache (ccs_cache_collection_t io_cache_collection,
-                                                        cci_stream_t           in_request_data,
-                                                        cci_stream_t           io_reply_data)
+                                                        k5_ipc_stream           in_request_data,
+                                                        k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     cc_uint32 cred_vers;
@@ -905,11 +905,11 @@ static cc_int32 ccs_cache_collection_create_new_ccache (ccs_cache_collection_t i
     if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_uint32 (in_request_data, &cred_vers);
+        err = k5_ipc_stream_read_uint32 (in_request_data, &cred_vers);
     }
     
     if (!err) {
-        err = cci_stream_read_string (in_request_data, &principal);
+        err = k5_ipc_stream_read_string (in_request_data, &principal);
     }
     
     if (!err) {
@@ -931,7 +931,7 @@ static cc_int32 ccs_cache_collection_create_new_ccache (ccs_cache_collection_t i
     }
     
     free (name);
-    free (principal);
+    k5_ipc_stream_free_string (principal);
     
     return cci_check_error (err);    
 }
@@ -940,8 +940,8 @@ static cc_int32 ccs_cache_collection_create_new_ccache (ccs_cache_collection_t i
 
 static  cc_int32 ccs_cache_collection_new_ccache_iterator (ccs_cache_collection_t io_cache_collection,
                                                            ccs_pipe_t             in_client_pipe,
-                                                           cci_stream_t           in_request_data,
-                                                           cci_stream_t           io_reply_data)
+                                                           k5_ipc_stream           in_request_data,
+                                                           k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     ccs_ccache_iterator_t ccache_iterator = NULL;
@@ -968,9 +968,9 @@ static  cc_int32 ccs_cache_collection_new_ccache_iterator (ccs_cache_collection_
 static cc_int32 ccs_cache_collection_lock (ccs_pipe_t              in_client_pipe,
                                            ccs_pipe_t              in_reply_pipe,
                                            ccs_cache_collection_t  io_cache_collection,
-                                           cci_stream_t            in_request_data,
+                                           k5_ipc_stream            in_request_data,
                                            cc_uint32              *out_will_block,
-                                           cci_stream_t            io_reply_data)
+                                           k5_ipc_stream            io_reply_data)
 {
     cc_int32 err = ccNoError;
     cc_uint32 lock_type;
@@ -983,11 +983,11 @@ static cc_int32 ccs_cache_collection_lock (ccs_pipe_t              in_client_pip
     if (!io_reply_data                  ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_uint32 (in_request_data, &lock_type);
+        err = k5_ipc_stream_read_uint32 (in_request_data, &lock_type);
     }
     
     if (!err) {
-        err = cci_stream_read_uint32 (in_request_data, &block);
+        err = k5_ipc_stream_read_uint32 (in_request_data, &block);
     }
     
     if (!err) {
@@ -1003,8 +1003,8 @@ static cc_int32 ccs_cache_collection_lock (ccs_pipe_t              in_client_pip
 
 static cc_int32 ccs_cache_collection_unlock (ccs_pipe_t             in_client_pipe,
                                              ccs_cache_collection_t io_cache_collection,
-                                             cci_stream_t           in_request_data,
-                                             cci_stream_t           io_reply_data)
+                                             k5_ipc_stream           in_request_data,
+                                             k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     
@@ -1031,13 +1031,13 @@ static cc_int32 ccs_cache_collection_unlock (ccs_pipe_t             in_client_pi
                                                ccs_pipe_t              in_reply_pipe,
                                                ccs_cache_collection_t  io_cache_collection,
                                                enum cci_msg_id_t       in_request_name,
-                                               cci_stream_t            in_request_data,
+                                               k5_ipc_stream            in_request_data,
                                                cc_uint32              *out_will_block,
-                                               cci_stream_t           *out_reply_data)
+                                               k5_ipc_stream           *out_reply_data)
 {
     cc_int32 err = ccNoError;
     cc_uint32 will_block = 0;
-    cci_stream_t reply_data = NULL;
+    k5_ipc_stream reply_data = NULL;
      
     if (!ccs_pipe_valid (in_client_pipe)) { err = cci_check_error (ccErrBadParam); }
     if (!ccs_pipe_valid (in_reply_pipe) ) { err = cci_check_error (ccErrBadParam); }
@@ -1047,7 +1047,7 @@ static cc_int32 ccs_cache_collection_unlock (ccs_pipe_t             in_client_pi
     if (!out_reply_data                 ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&reply_data);
+        err = k5_ipc_stream_new (&reply_data);
     }
     
     if (!err) {
@@ -1124,7 +1124,7 @@ static cc_int32 ccs_cache_collection_unlock (ccs_pipe_t             in_client_pi
         }
     }
     
-    cci_stream_release (reply_data);
+    k5_ipc_stream_release (reply_data);
     
     return cci_check_error (err);
 }
index b3278f7dbe370a1efe6bed0344c6fc7dcb73cb4b..f0507967bb73b51fa3acb4cfb24417ad416a0679 100644 (file)
@@ -66,8 +66,8 @@ cc_int32 ccs_cache_collection_handle_message (ccs_pipe_t              in_client_
                                               ccs_pipe_t              in_reply_pipe,
                                               ccs_cache_collection_t  io_cache_collection,
                                               enum cci_msg_id_t       in_request_name,
-                                              cci_stream_t            in_request_data,
+                                              k5_ipc_stream            in_request_data,
                                               cc_uint32              *out_will_block,
-                                              cci_stream_t           *out_reply_data);
+                                              k5_ipc_stream           *out_reply_data);
 
 #endif /* CCS_CACHE_COLLECTION_H */
index 6a5281c2f5a3d37cf58924a3aaffb9eb52ed5c33..94e9d9b4be8b0c1208c2cf213ddef44e7a6d422f 100644 (file)
@@ -156,7 +156,7 @@ cc_int32 ccs_callback_invalidate (ccs_callback_t io_callback)
 /* ------------------------------------------------------------------------ */
 
 cc_int32 ccs_callback_reply_to_client (ccs_callback_t io_callback,
-                                      cci_stream_t   in_stream)
+                                      k5_ipc_stream   in_stream)
 {
     cc_int32 err = ccNoError;
     
index 3ebe28d47bff37b8d5e93007630bdbcd31babb6f..26526984e4e5fc4b62f26196c48f71a728cbf7ca 100644 (file)
@@ -47,7 +47,7 @@ cc_int32 ccs_callback_release (ccs_callback_t io_callback);
 cc_int32 ccs_callback_invalidate (ccs_callback_t io_callback);
 
 cc_int32 ccs_callback_reply_to_client (ccs_callback_t io_callback,
-                                      cci_stream_t   in_stream);
+                                      k5_ipc_stream   in_stream);
 
 cc_uint32 ccs_callback_is_pending (ccs_callback_t  in_callback,
                                   cc_uint32      *out_pending);
index 35f70903cf9d50afe9247f505dd9d2592c7a036c..88cf1e0d96f4e638766f067304c306c64b1f2ed2 100644 (file)
@@ -315,7 +315,7 @@ cc_int32 ccs_ccache_changed (ccs_ccache_t           io_ccache,
                              ccs_cache_collection_t io_cache_collection)
 {
     cc_int32 err = ccNoError;
-    cci_stream_t reply_data = NULL;
+    k5_ipc_stream reply_data = NULL;
     
     if (!io_ccache          ) { err = cci_check_error (ccErrBadParam); }
     if (!io_cache_collection) { err = cci_check_error (ccErrBadParam); }
@@ -335,11 +335,11 @@ cc_int32 ccs_ccache_changed (ccs_ccache_t           io_ccache,
     }
     
     if (!err) {
-        err = cci_stream_new (&reply_data);
+        err = k5_ipc_stream_new (&reply_data);
     }
     
     if (!err) {
-       err = cci_stream_write_time (reply_data, io_ccache->last_changed_time);
+       err = k5_ipc_stream_write_time (reply_data, io_ccache->last_changed_time);
     }
 
     if (!err) {
@@ -365,7 +365,7 @@ cc_int32 ccs_ccache_changed (ccs_ccache_t           io_ccache,
                                             io_ccache->name);
     }
     
-    cci_stream_release (reply_data);
+    k5_ipc_stream_release (reply_data);
     
     return cci_check_error (err);
 }
@@ -461,7 +461,7 @@ cc_int32 ccs_ccache_find_credentials_iterator (ccs_ccache_t                in_cc
 /* ------------------------------------------------------------------------ */
 
 cc_int32 ccs_ccache_write (ccs_ccache_t in_ccache,
-                           cci_stream_t io_stream)
+                           k5_ipc_stream io_stream)
 {
     cc_int32 err = ccNoError;
     
@@ -479,7 +479,7 @@ cc_int32 ccs_ccache_write (ccs_ccache_t in_ccache,
 /* ------------------------------------------------------------------------ */
 
 cc_int32 ccs_ccache_write_name (ccs_ccache_t in_ccache,
-                                cci_stream_t io_stream)
+                                k5_ipc_stream io_stream)
 {
     cc_int32 err = ccNoError;
     
@@ -487,7 +487,7 @@ cc_int32 ccs_ccache_write_name (ccs_ccache_t in_ccache,
     if (!io_stream) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_write_string (io_stream, in_ccache->name);
+        err = k5_ipc_stream_write_string (io_stream, in_ccache->name);
     }
     
     return cci_check_error (err);    
@@ -502,8 +502,8 @@ cc_int32 ccs_ccache_write_name (ccs_ccache_t in_ccache,
 
 static cc_int32 ccs_ccache_destroy (ccs_ccache_t           io_ccache,
                                     ccs_cache_collection_t io_cache_collection,
-                                    cci_stream_t           in_request_data,
-                                    cci_stream_t           io_reply_data)
+                                    k5_ipc_stream           in_request_data,
+                                    k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     
@@ -529,8 +529,8 @@ static cc_int32 ccs_ccache_destroy (ccs_ccache_t           io_ccache,
 
 static cc_int32 ccs_ccache_set_default (ccs_ccache_t           io_ccache,
                                         ccs_cache_collection_t io_cache_collection,
-                                        cci_stream_t           in_request_data,
-                                        cci_stream_t           io_reply_data)
+                                        k5_ipc_stream           in_request_data,
+                                        k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     
@@ -551,8 +551,8 @@ static cc_int32 ccs_ccache_set_default (ccs_ccache_t           io_ccache,
 
 static cc_int32 ccs_ccache_get_credentials_version (ccs_ccache_t           io_ccache,
                                                     ccs_cache_collection_t io_cache_collection,
-                                                    cci_stream_t           in_request_data,
-                                                    cci_stream_t           io_reply_data)
+                                                    k5_ipc_stream           in_request_data,
+                                                    k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     
@@ -562,7 +562,7 @@ static cc_int32 ccs_ccache_get_credentials_version (ccs_ccache_t           io_cc
     if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_write_uint32 (io_reply_data, io_ccache->creds_version);
+        err = k5_ipc_stream_write_uint32 (io_reply_data, io_ccache->creds_version);
     }
     
     return cci_check_error (err);    
@@ -572,8 +572,8 @@ static cc_int32 ccs_ccache_get_credentials_version (ccs_ccache_t           io_cc
 
 static cc_int32 ccs_ccache_get_name (ccs_ccache_t           io_ccache,
                                      ccs_cache_collection_t io_cache_collection,
-                                     cci_stream_t           in_request_data,
-                                     cci_stream_t           io_reply_data)
+                                     k5_ipc_stream           in_request_data,
+                                     k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     
@@ -583,7 +583,7 @@ static cc_int32 ccs_ccache_get_name (ccs_ccache_t           io_ccache,
     if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_write_string (io_reply_data, io_ccache->name);
+        err = k5_ipc_stream_write_string (io_reply_data, io_ccache->name);
     }
     
     return cci_check_error (err);    
@@ -593,8 +593,8 @@ static cc_int32 ccs_ccache_get_name (ccs_ccache_t           io_ccache,
 
 static cc_int32 ccs_ccache_get_principal (ccs_ccache_t           io_ccache,
                                           ccs_cache_collection_t io_cache_collection,
-                                          cci_stream_t           in_request_data,
-                                          cci_stream_t           io_reply_data)
+                                          k5_ipc_stream           in_request_data,
+                                          k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     cc_uint32 version = 0;
@@ -605,7 +605,7 @@ static cc_int32 ccs_ccache_get_principal (ccs_ccache_t           io_ccache,
     if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_uint32 (in_request_data, &version);
+        err = k5_ipc_stream_read_uint32 (in_request_data, &version);
     }
     
     if (!err && version == cc_credentials_v4_v5) {
@@ -614,10 +614,10 @@ static cc_int32 ccs_ccache_get_principal (ccs_ccache_t           io_ccache,
     
     if (!err) {
         if (version == cc_credentials_v4) {
-            err = cci_stream_write_string (io_reply_data, io_ccache->v4_principal);
+            err = k5_ipc_stream_write_string (io_reply_data, io_ccache->v4_principal);
             
         } else if (version == cc_credentials_v5) {
-            err = cci_stream_write_string (io_reply_data, io_ccache->v5_principal);
+            err = k5_ipc_stream_write_string (io_reply_data, io_ccache->v5_principal);
             
         } else {
             err = cci_check_error (ccErrBadCredentialsVersion);
@@ -631,8 +631,8 @@ static cc_int32 ccs_ccache_get_principal (ccs_ccache_t           io_ccache,
 
 static cc_int32 ccs_ccache_set_principal (ccs_ccache_t           io_ccache,
                                           ccs_cache_collection_t io_cache_collection,
-                                          cci_stream_t           in_request_data,
-                                          cci_stream_t           io_reply_data)
+                                          k5_ipc_stream           in_request_data,
+                                          k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     cc_uint32 version = 0;
@@ -644,11 +644,11 @@ static cc_int32 ccs_ccache_set_principal (ccs_ccache_t           io_ccache,
     if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_uint32 (in_request_data, &version);
+        err = k5_ipc_stream_read_uint32 (in_request_data, &version);
     }
     
     if (!err) {
-        err = cci_stream_read_string (in_request_data, &principal);
+        err = k5_ipc_stream_read_string (in_request_data, &principal);
     }
     
     if (!err) {
@@ -681,7 +681,7 @@ static cc_int32 ccs_ccache_set_principal (ccs_ccache_t           io_ccache,
         err = ccs_ccache_changed (io_ccache, io_cache_collection);
     }
     
-    free (principal);
+    k5_ipc_stream_free_string (principal);
         
     return cci_check_error (err);    
 }
@@ -690,8 +690,8 @@ static cc_int32 ccs_ccache_set_principal (ccs_ccache_t           io_ccache,
 
 static cc_int32 ccs_ccache_store_credentials (ccs_ccache_t           io_ccache,
                                               ccs_cache_collection_t io_cache_collection,
-                                              cci_stream_t           in_request_data,
-                                              cci_stream_t           io_reply_data)
+                                              k5_ipc_stream           in_request_data,
+                                              k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     ccs_credentials_t credentials = NULL;
@@ -719,8 +719,8 @@ static cc_int32 ccs_ccache_store_credentials (ccs_ccache_t           io_ccache,
 
 static cc_int32 ccs_ccache_remove_credentials (ccs_ccache_t           io_ccache,
                                                ccs_cache_collection_t io_cache_collection,
-                                               cci_stream_t           in_request_data,
-                                               cci_stream_t           io_reply_data)
+                                               k5_ipc_stream           in_request_data,
+                                               k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     cci_identifier_t credentials_identifier = NULL;
@@ -752,8 +752,8 @@ static cc_int32 ccs_ccache_remove_credentials (ccs_ccache_t           io_ccache,
 static cc_int32 ccs_ccache_new_credentials_iterator (ccs_ccache_t           io_ccache,
                                                      ccs_cache_collection_t io_cache_collection,
                                                      ccs_pipe_t             in_client_pipe,
-                                                     cci_stream_t           in_request_data,
-                                                     cci_stream_t           io_reply_data)
+                                                     k5_ipc_stream           in_request_data,
+                                                     k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     ccs_credentials_iterator_t credentials_iterator = NULL;
@@ -780,8 +780,8 @@ static cc_int32 ccs_ccache_new_credentials_iterator (ccs_ccache_t           io_c
 
 static cc_int32 ccs_ccache_move (ccs_ccache_t           io_ccache,
                                  ccs_cache_collection_t io_cache_collection,
-                                 cci_stream_t           in_request_data,
-                                 cci_stream_t           io_reply_data)
+                                 k5_ipc_stream           in_request_data,
+                                 k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     cci_identifier_t source_identifier = NULL;
@@ -818,9 +818,9 @@ static cc_int32 ccs_ccache_lock (ccs_pipe_t             in_client_pipe,
                                  ccs_pipe_t             in_reply_pipe,
                                  ccs_ccache_t           io_ccache,
                                  ccs_cache_collection_t io_cache_collection,
-                                 cci_stream_t           in_request_data,
+                                 k5_ipc_stream           in_request_data,
                                  cc_uint32              *out_will_block,
-                                 cci_stream_t           io_reply_data)
+                                 k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     cc_uint32 lock_type;
@@ -834,11 +834,11 @@ static cc_int32 ccs_ccache_lock (ccs_pipe_t             in_client_pipe,
     if (!io_reply_data                  ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_uint32 (in_request_data, &lock_type);
+        err = k5_ipc_stream_read_uint32 (in_request_data, &lock_type);
     }
     
     if (!err) {
-        err = cci_stream_read_uint32 (in_request_data, &block);
+        err = k5_ipc_stream_read_uint32 (in_request_data, &block);
     }
     
     if (!err) {
@@ -855,8 +855,8 @@ static cc_int32 ccs_ccache_lock (ccs_pipe_t             in_client_pipe,
 static cc_int32 ccs_ccache_unlock (ccs_pipe_t             in_client_pipe,
                                    ccs_ccache_t           io_ccache,
                                    ccs_cache_collection_t io_cache_collection,
-                                   cci_stream_t           in_request_data,
-                                   cci_stream_t           io_reply_data)
+                                   k5_ipc_stream           in_request_data,
+                                   k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     
@@ -877,8 +877,8 @@ static cc_int32 ccs_ccache_unlock (ccs_pipe_t             in_client_pipe,
 
 static cc_int32 ccs_ccache_get_last_default_time (ccs_ccache_t           io_ccache,
                                                   ccs_cache_collection_t io_cache_collection,
-                                                  cci_stream_t           in_request_data,
-                                                  cci_stream_t           io_reply_data)
+                                                  k5_ipc_stream           in_request_data,
+                                                  k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     
@@ -892,7 +892,7 @@ static cc_int32 ccs_ccache_get_last_default_time (ccs_ccache_t           io_ccac
     }
     
     if (!err) {
-        err = cci_stream_write_time (io_reply_data, io_ccache->last_default_time);
+        err = k5_ipc_stream_write_time (io_reply_data, io_ccache->last_default_time);
     }
     
     return cci_check_error (err);    
@@ -902,8 +902,8 @@ static cc_int32 ccs_ccache_get_last_default_time (ccs_ccache_t           io_ccac
 
 static cc_int32 ccs_ccache_get_change_time (ccs_ccache_t           io_ccache,
                                             ccs_cache_collection_t io_cache_collection,
-                                            cci_stream_t           in_request_data,
-                                            cci_stream_t           io_reply_data)
+                                            k5_ipc_stream           in_request_data,
+                                            k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     
@@ -913,7 +913,7 @@ static cc_int32 ccs_ccache_get_change_time (ccs_ccache_t           io_ccache,
     if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_write_time (io_reply_data, io_ccache->last_changed_time);
+        err = k5_ipc_stream_write_time (io_reply_data, io_ccache->last_changed_time);
     }
     
     return cci_check_error (err);    
@@ -925,8 +925,8 @@ static cc_int32 ccs_ccache_wait_for_change (ccs_pipe_t              in_client_pi
                                            ccs_pipe_t              in_reply_pipe,
                                            ccs_ccache_t            io_ccache,
                                            ccs_cache_collection_t  io_cache_collection,
-                                           cci_stream_t            in_request_data,
-                                           cci_stream_t            io_reply_data,
+                                           k5_ipc_stream            in_request_data,
+                                           k5_ipc_stream            io_reply_data,
                                            cc_uint32              *out_will_block)
 {
     cc_int32 err = ccNoError;
@@ -941,13 +941,13 @@ static cc_int32 ccs_ccache_wait_for_change (ccs_pipe_t              in_client_pi
     if (!out_will_block                 ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_time (in_request_data, &last_wait_for_change_time);
+        err = k5_ipc_stream_read_time (in_request_data, &last_wait_for_change_time);
     }
     
     if (!err) {
        if (last_wait_for_change_time < io_ccache->last_changed_time) {
            cci_debug_printf ("%s returning immediately", __FUNCTION__);
-           err = cci_stream_write_time (io_reply_data, io_ccache->last_changed_time);
+           err = k5_ipc_stream_write_time (io_reply_data, io_ccache->last_changed_time);
            
        } else {
            ccs_callback_t callback = NULL;
@@ -983,8 +983,8 @@ static cc_int32 ccs_ccache_wait_for_change (ccs_pipe_t              in_client_pi
 
 static cc_int32 ccs_ccache_get_kdc_time_offset (ccs_ccache_t           io_ccache,
                                                 ccs_cache_collection_t io_cache_collection,
-                                                cci_stream_t           in_request_data,
-                                                cci_stream_t           io_reply_data)
+                                                k5_ipc_stream           in_request_data,
+                                                k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     cc_uint32 cred_vers = 0;
@@ -995,20 +995,20 @@ static cc_int32 ccs_ccache_get_kdc_time_offset (ccs_ccache_t           io_ccache
     if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_uint32 (in_request_data, &cred_vers);
+        err = k5_ipc_stream_read_uint32 (in_request_data, &cred_vers);
     }
     
     if (!err) {
         if (cred_vers == cc_credentials_v4) {
             if (io_ccache->kdc_time_offset_v4_valid) {
-                err = cci_stream_write_time (io_reply_data, io_ccache->kdc_time_offset_v4);
+                err = k5_ipc_stream_write_time (io_reply_data, io_ccache->kdc_time_offset_v4);
             } else {
                 err = cci_check_error (ccErrTimeOffsetNotSet);
             }
             
         } else if (cred_vers == cc_credentials_v5) {
             if (io_ccache->kdc_time_offset_v5_valid) {
-                err = cci_stream_write_time (io_reply_data, io_ccache->kdc_time_offset_v5);
+                err = k5_ipc_stream_write_time (io_reply_data, io_ccache->kdc_time_offset_v5);
             } else {
                 err = cci_check_error (ccErrTimeOffsetNotSet);
             }
@@ -1025,8 +1025,8 @@ static cc_int32 ccs_ccache_get_kdc_time_offset (ccs_ccache_t           io_ccache
 
 static cc_int32 ccs_ccache_set_kdc_time_offset (ccs_ccache_t           io_ccache,
                                                 ccs_cache_collection_t io_cache_collection,
-                                                cci_stream_t           in_request_data,
-                                                cci_stream_t           io_reply_data)
+                                                k5_ipc_stream           in_request_data,
+                                                k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     cc_uint32 cred_vers = 0;
@@ -1037,18 +1037,18 @@ static cc_int32 ccs_ccache_set_kdc_time_offset (ccs_ccache_t           io_ccache
     if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_uint32 (in_request_data, &cred_vers);
+        err = k5_ipc_stream_read_uint32 (in_request_data, &cred_vers);
     }
     
     if (!err) {
         if (cred_vers == cc_credentials_v4) {
-            err = cci_stream_read_time (in_request_data, &io_ccache->kdc_time_offset_v4);
+            err = k5_ipc_stream_read_time (in_request_data, &io_ccache->kdc_time_offset_v4);
             
             if (!err) {
                 io_ccache->kdc_time_offset_v4_valid = 1;
             }
         } else if (cred_vers == cc_credentials_v5) {
-            err = cci_stream_read_time (in_request_data, &io_ccache->kdc_time_offset_v5);
+            err = k5_ipc_stream_read_time (in_request_data, &io_ccache->kdc_time_offset_v5);
             
             if (!err) {
                 io_ccache->kdc_time_offset_v5_valid = 1;
@@ -1069,8 +1069,8 @@ static cc_int32 ccs_ccache_set_kdc_time_offset (ccs_ccache_t           io_ccache
 
 static cc_int32 ccs_ccache_clear_kdc_time_offset (ccs_ccache_t           io_ccache,
                                                   ccs_cache_collection_t io_cache_collection,
-                                                  cci_stream_t           in_request_data,
-                                                  cci_stream_t           io_reply_data)
+                                                  k5_ipc_stream           in_request_data,
+                                                  k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     cc_uint32 cred_vers = 0;
@@ -1081,7 +1081,7 @@ static cc_int32 ccs_ccache_clear_kdc_time_offset (ccs_ccache_t           io_ccac
     if (!io_reply_data      ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_read_uint32 (in_request_data, &cred_vers);
+        err = k5_ipc_stream_read_uint32 (in_request_data, &cred_vers);
     }
     
     if (!err) {
@@ -1116,13 +1116,13 @@ cc_int32 ccs_ccache_handle_message (ccs_pipe_t              in_client_pipe,
                                     ccs_ccache_t            io_ccache,
                                     ccs_cache_collection_t  io_cache_collection,
                                     enum cci_msg_id_t       in_request_name,
-                                    cci_stream_t            in_request_data,
+                                    k5_ipc_stream            in_request_data,
                                     cc_uint32              *out_will_block,
-                                    cci_stream_t           *out_reply_data)
+                                    k5_ipc_stream           *out_reply_data)
 {
     cc_int32 err = ccNoError;
     cc_uint32 will_block = 0;
-    cci_stream_t reply_data = NULL;
+    k5_ipc_stream reply_data = NULL;
     
     if (!ccs_pipe_valid (in_client_pipe)) { err = cci_check_error (ccErrBadParam); }
     if (!ccs_pipe_valid (in_reply_pipe) ) { err = cci_check_error (ccErrBadParam); }
@@ -1132,7 +1132,7 @@ cc_int32 ccs_ccache_handle_message (ccs_pipe_t              in_client_pipe,
     if (!out_reply_data                 ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&reply_data);
+        err = k5_ipc_stream_new (&reply_data);
     }
     
     if (!err) {
@@ -1231,7 +1231,7 @@ cc_int32 ccs_ccache_handle_message (ccs_pipe_t              in_client_pipe,
         }
     }
     
-    cci_stream_release (reply_data);
+    k5_ipc_stream_release (reply_data);
     
     return cci_check_error (err);
 }
index 3e9f6ae855167dbc0c70b6c5ce0224775236e42a..21c9f410fe1e3256083f70c62837e09ca7ea9d11 100644 (file)
@@ -66,18 +66,18 @@ cc_int32 ccs_ccache_find_credentials_iterator (ccs_ccache_t                in_cc
                                                ccs_credentials_iterator_t *out_credentials_iterator);
 
 cc_int32 ccs_ccache_write (ccs_ccache_t in_ccache,
-                           cci_stream_t io_stream);
+                           k5_ipc_stream io_stream);
 
 cc_int32 ccs_ccache_write_name (ccs_ccache_t in_ccache,
-                                cci_stream_t io_stream);
+                                k5_ipc_stream io_stream);
 
 cc_int32 ccs_ccache_handle_message (ccs_pipe_t              in_client_pipe,
                                     ccs_pipe_t              in_reply_pipe,
                                     ccs_ccache_t            io_ccache,
                                     ccs_cache_collection_t  io_cache_collection,
                                     enum cci_msg_id_t       in_request_name,
-                                    cci_stream_t            in_request_data,
+                                    k5_ipc_stream            in_request_data,
                                     cc_uint32              *out_will_block,
-                                    cci_stream_t           *out_reply_data);
+                                    k5_ipc_stream           *out_reply_data);
 
 #endif /* CCS_CCACHE_H */
index 77d8eda4562510beb9acf35e805f7276473e973f..0e05056440ac4ac76ff2dd8165f54d66fccb0244 100644 (file)
@@ -30,8 +30,8 @@
 
 static  cc_int32 ccs_ccache_iterator_release (ccs_ccache_iterator_t  io_ccache_iterator,
                                               ccs_cache_collection_t io_cache_collection,
-                                              cci_stream_t           in_request_data,
-                                              cci_stream_t           io_reply_data)
+                                              k5_ipc_stream           in_request_data,
+                                              k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     
@@ -51,8 +51,8 @@ static  cc_int32 ccs_ccache_iterator_release (ccs_ccache_iterator_t  io_ccache_i
 
 static  cc_int32 ccs_ccache_iterator_next (ccs_ccache_iterator_t  io_ccache_iterator,
                                            ccs_cache_collection_t io_cache_collection,
-                                           cci_stream_t           in_request_data,
-                                           cci_stream_t           io_reply_data)
+                                           k5_ipc_stream           in_request_data,
+                                           k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     ccs_ccache_t ccache = NULL;
@@ -77,8 +77,8 @@ static  cc_int32 ccs_ccache_iterator_next (ccs_ccache_iterator_t  io_ccache_iter
 
 static  cc_int32 ccs_ccache_iterator_clone (ccs_ccache_iterator_t  io_ccache_iterator,
                                             ccs_cache_collection_t io_cache_collection,
-                                            cci_stream_t           in_request_data,
-                                            cci_stream_t           io_reply_data)
+                                            k5_ipc_stream           in_request_data,
+                                            k5_ipc_stream           io_reply_data)
 {
     cc_int32 err = ccNoError;
     ccs_ccache_iterator_t ccache_iterator = NULL;
@@ -109,17 +109,17 @@ static  cc_int32 ccs_ccache_iterator_clone (ccs_ccache_iterator_t  io_ccache_ite
  cc_int32 ccs_ccache_iterator_handle_message (ccs_ccache_iterator_t  io_ccache_iterator,
                                               ccs_cache_collection_t io_cache_collection,
                                               enum cci_msg_id_t      in_request_name,
-                                              cci_stream_t           in_request_data,
-                                              cci_stream_t          *out_reply_data)
+                                              k5_ipc_stream           in_request_data,
+                                              k5_ipc_stream          *out_reply_data)
 {
     cc_int32 err = ccNoError;
-    cci_stream_t reply_data = NULL;
+    k5_ipc_stream reply_data = NULL;
     
     if (!in_request_data) { err = cci_check_error (ccErrBadParam); }
     if (!out_reply_data ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&reply_data);
+        err = k5_ipc_stream_new (&reply_data);
     }
     
     if (!err) {
@@ -151,7 +151,7 @@ static  cc_int32 ccs_ccache_iterator_clone (ccs_ccache_iterator_t  io_ccache_ite
         reply_data = NULL; /* take ownership */
     }
     
-    cci_stream_release (reply_data);
+    k5_ipc_stream_release (reply_data);
     
     return cci_check_error (err);
 }
index 8ec361a67a293798a4f23b2d9f85f75daf9e9812..642ebcc5bf8d35be59fd2204151e740388a194e6 100644 (file)
@@ -32,7 +32,7 @@
  cc_int32 ccs_ccache_iterator_handle_message (ccs_ccache_iterator_t  io_ccache_iterator,
                                               ccs_cache_collection_t io_cache_collection,
                                               enum cci_msg_id_t      in_request_name,
-                                              cci_stream_t           in_request_data,
-                                              cci_stream_t          *out_reply_data);
+                                              k5_ipc_stream           in_request_data,
+                                              k5_ipc_stream          *out_reply_data);
 
 #endif /* CCS_CCACHE_ITERATOR_H */
index 72721e68a1eb48d3f615970732c78f8d49e5dcda..56b5a5799164ad92f1264d61be955fc330144bc1 100644 (file)
@@ -36,7 +36,7 @@ struct ccs_credentials_d ccs_credentials_initializer = { NULL, NULL };
 /* ------------------------------------------------------------------------ */
 
 cc_int32 ccs_credentials_new (ccs_credentials_t      *out_credentials,
-                              cci_stream_t            in_stream,
+                              k5_ipc_stream            in_stream,
                               cc_uint32               in_ccache_version,
                               ccs_credentials_list_t  io_credentials_list)
 {
@@ -100,7 +100,7 @@ cc_int32 ccs_credentials_release (ccs_credentials_t io_credentials)
 /* ------------------------------------------------------------------------ */
 
 cc_int32 ccs_credentials_write (ccs_credentials_t in_credentials,
-                                cci_stream_t      io_stream)
+                                k5_ipc_stream      io_stream)
 {
     cc_int32 err = ccNoError;
     
index b9219aa408a0374b03550c7498919a9aa50e9756..24b279484d18931d7178d947b68cd1ddb9202fef 100644 (file)
 
 
 cc_int32 ccs_credentials_new (ccs_credentials_t      *out_credentials,
-                              cci_stream_t            in_stream,
+                              k5_ipc_stream            in_stream,
                               cc_uint32               in_ccache_version,
                               ccs_credentials_list_t  io_credentials_list);
 
 cc_int32 ccs_credentials_release (ccs_credentials_t io_credentials);
 
 cc_int32 ccs_credentials_write (ccs_credentials_t in_credentials,
-                                cci_stream_t      io_stream);
+                                k5_ipc_stream      io_stream);
 
 cc_int32 ccs_credentials_compare_identifier (ccs_credentials_t  in_credentials,
                                              cci_identifier_t   in_identifier,
index b13a294b18a25f4c165affb73f2cac305bcd735f..38e323c26741c50c926c04ba7cbb20fb4067d904 100644 (file)
@@ -30,8 +30,8 @@
 
 static cc_int32 ccs_credentials_iterator_release (ccs_credentials_iterator_t io_credentials_iterator,
                                                  ccs_ccache_t               io_ccache,
-                                                 cci_stream_t               in_request_data,
-                                                 cci_stream_t               io_reply_data)
+                                                 k5_ipc_stream               in_request_data,
+                                                 k5_ipc_stream               io_reply_data)
 {
     cc_int32 err = ccNoError;
     
@@ -51,8 +51,8 @@ static cc_int32 ccs_credentials_iterator_release (ccs_credentials_iterator_t io_
 
 static cc_int32 ccs_credentials_iterator_next (ccs_credentials_iterator_t io_credentials_iterator,
                                               ccs_ccache_t               io_ccache,
-                                              cci_stream_t               in_request_data,
-                                              cci_stream_t               io_reply_data)
+                                              k5_ipc_stream               in_request_data,
+                                              k5_ipc_stream               io_reply_data)
 {
     cc_int32 err = ccNoError;
     ccs_credentials_t credentials = NULL;
@@ -78,8 +78,8 @@ static cc_int32 ccs_credentials_iterator_next (ccs_credentials_iterator_t io_cre
 
 static  cc_int32 ccs_credentials_iterator_clone (ccs_credentials_iterator_t io_credentials_iterator,
                                                  ccs_ccache_t               io_ccache,
-                                                 cci_stream_t               in_request_data,
-                                                 cci_stream_t               io_reply_data)
+                                                 k5_ipc_stream               in_request_data,
+                                                 k5_ipc_stream               io_reply_data)
 {
     cc_int32 err = ccNoError;
     ccs_credentials_iterator_t credentials_iterator = NULL;
@@ -111,17 +111,17 @@ static  cc_int32 ccs_credentials_iterator_clone (ccs_credentials_iterator_t io_c
  cc_int32 ccs_credentials_iterator_handle_message (ccs_credentials_iterator_t  io_credentials_iterator,
                                                    ccs_ccache_t                io_ccache,
                                                    enum cci_msg_id_t           in_request_name,
-                                                   cci_stream_t                in_request_data,
-                                                   cci_stream_t               *out_reply_data)
+                                                   k5_ipc_stream                in_request_data,
+                                                   k5_ipc_stream               *out_reply_data)
 {
     cc_int32 err = ccNoError;
-    cci_stream_t reply_data = NULL;
+    k5_ipc_stream reply_data = NULL;
     
     if (!in_request_data) { err = cci_check_error (ccErrBadParam); }
     if (!out_reply_data ) { err = cci_check_error (ccErrBadParam); }
     
     if (!err) {
-        err = cci_stream_new (&reply_data);
+        err = k5_ipc_stream_new (&reply_data);
     }
     
     if (!err) {
@@ -153,7 +153,7 @@ static  cc_int32 ccs_credentials_iterator_clone (ccs_credentials_iterator_t io_c
         reply_data = NULL; /* take ownership */
     }
     
-    cci_stream_release (reply_data);
+    k5_ipc_stream_release (reply_data);
     
     return cci_check_error (err);
 }
index af3cf1a182aecc0e6dae1759d4134353424c3309..84ff0ba00b4ecc11851bc0cb0ae24a42e63a4e0d 100644 (file)
@@ -32,7 +32,7 @@
  cc_int32 ccs_credentials_iterator_handle_message (ccs_credentials_iterator_t  io_credentials_iterator,
                                                    ccs_ccache_t                io_ccache,
                                                    enum cci_msg_id_t           in_request_name,
-                                                   cci_stream_t                in_request_data,
-                                                   cci_stream_t               *out_reply_data);
+                                                   k5_ipc_stream                in_request_data,
+                                                   k5_ipc_stream               *out_reply_data);
 
 #endif /* CCS_CREDENTIALS_ITERATOR_H */
index 2743994a147145c6e51e46ad5a120612e32fe106..c5b1eb42153ea07fc7b9d2258b1f1df54f8d71eb 100644 (file)
@@ -199,7 +199,7 @@ cc_int32 ccs_ccache_list_release (ccs_ccache_list_t io_list)
 /* ------------------------------------------------------------------------ */
 
 cc_int32 ccs_ccache_list_iterator_write (ccs_ccache_list_iterator_t in_list_iterator,
-                                         cci_stream_t               in_stream)
+                                         k5_ipc_stream               in_stream)
 {
     return ccs_list_iterator_write (in_list_iterator, in_stream);    
 }
@@ -322,7 +322,7 @@ cc_int32 ccs_credentials_list_release (ccs_credentials_list_t io_list)
 /* ------------------------------------------------------------------------ */
 
 cc_int32 ccs_credentials_list_iterator_write (ccs_credentials_list_iterator_t in_list_iterator,
-                                              cci_stream_t                    in_stream)
+                                              k5_ipc_stream                    in_stream)
 {
     return ccs_list_iterator_write (in_list_iterator, in_stream);    
 }
index fff2f5421e8ba5a4156863ea0f0064648d9f75a6..e48d4c4f1e0ff34c4dae753cc207c8092fab3262 100644 (file)
@@ -81,7 +81,7 @@ cc_int32 ccs_ccache_list_release (ccs_ccache_list_t io_list);
 
 
 cc_int32 ccs_ccache_list_iterator_write (ccs_ccache_list_iterator_t in_list_iterator,
-                                         cci_stream_t               in_stream);
+                                         k5_ipc_stream               in_stream);
 
 cc_int32 ccs_ccache_list_iterator_clone (ccs_ccache_list_iterator_t  in_list_iterator,
                                          ccs_ccache_list_iterator_t *out_list_iterator);
@@ -122,7 +122,7 @@ cc_int32 ccs_credentials_list_release (ccs_credentials_list_t io_list);
 
 
 cc_int32 ccs_credentials_list_iterator_write (ccs_credentials_list_iterator_t in_list_iterator,
-                                              cci_stream_t                    in_stream);
+                                              k5_ipc_stream                    in_stream);
 
 cc_int32 ccs_credentials_list_iterator_clone (ccs_credentials_list_iterator_t  in_list_iterator,
                                               ccs_credentials_list_iterator_t *out_list_iterator);
index 1a8d0c639fdb5a2107c68bdaefc0371a3ea6e94a..74bc45a6af649364d4e235d3ec3154b4594540e7 100644 (file)
@@ -477,7 +477,7 @@ static cc_int32 ccs_list_iterator_new (ccs_list_iterator_t *out_list_iterator,
 /* ------------------------------------------------------------------------ */
 
 cc_int32 ccs_list_iterator_write (ccs_list_iterator_t in_list_iterator,
-                                  cci_stream_t        in_stream)
+                                  k5_ipc_stream        in_stream)
 {
     cc_int32 err = ccNoError;
     
index 1ab6aa4c107e32d00de467787bb98c9fb6773102..d659fbe1063820bd18893838703c5c20abf29eb6 100644 (file)
@@ -77,7 +77,7 @@ cc_int32 ccs_list_push_front (ccs_list_t       io_list,
 
 
 cc_int32 ccs_list_iterator_write (ccs_list_iterator_t in_list_iterator,
-                                  cci_stream_t        in_stream);
+                                  k5_ipc_stream        in_stream);
 
 cc_int32 ccs_list_iterator_clone (ccs_list_iterator_t  in_list_iterator,
                                   ccs_list_iterator_t *out_list_iterator);
index c447ae4d06adb6871465c61f25130f9eef92e067..8212028d6732b6902aba245d847c78e0c287159f 100644 (file)
@@ -36,6 +36,6 @@ cc_int32 ccs_os_server_cleanup (int argc, const char *argv[]);
 cc_int32 ccs_os_server_listen_loop (int argc, const char *argv[]);
 
 cc_int32 ccs_os_server_send_reply (ccs_pipe_t   in_reply_pipe,
-                                   cci_stream_t in_reply_stream);
+                                   k5_ipc_stream in_reply_stream);
 
 #endif /* CCS_OS_SERVER_H */
index 5954d661c96003b6c56036db62138729dad166a2..c1bbe539ad191bb8496f0b86c63770844a736f62 100644 (file)
@@ -207,9 +207,9 @@ static cc_int32 ccs_server_request_demux (ccs_pipe_t              in_client_pipe
                                           ccs_cache_collection_t  in_cache_collection,
                                           enum cci_msg_id_t       in_request_name,
                                           cci_identifier_t        in_request_identifier,
-                                          cci_stream_t            in_request_data,
+                                          k5_ipc_stream            in_request_data,
                                           cc_uint32              *out_will_block,
-                                          cci_stream_t           *out_reply_data)
+                                          k5_ipc_stream           *out_reply_data)
 {
     cc_int32 err = ccNoError;
 
@@ -311,13 +311,13 @@ static cc_int32 ccs_server_request_demux (ccs_pipe_t              in_client_pipe
 
 cc_int32 ccs_server_handle_request (ccs_pipe_t     in_client_pipe,
                                     ccs_pipe_t     in_reply_pipe,
-                                    cci_stream_t   in_request)
+                                    k5_ipc_stream   in_request)
 {
     cc_int32 err = ccNoError;
     enum cci_msg_id_t request_name = 0;
     cci_identifier_t request_identifier = NULL;
     cc_uint32 will_block = 0;
-    cci_stream_t reply_data = NULL;
+    k5_ipc_stream reply_data = NULL;
     
     if (!ccs_pipe_valid (in_client_pipe)) { err = cci_check_error (ccErrBadParam); }
     if (!ccs_pipe_valid (in_reply_pipe) ) { err = cci_check_error (ccErrBadParam); }
@@ -366,7 +366,7 @@ cc_int32 ccs_server_handle_request (ccs_pipe_t     in_client_pipe,
     }
 
     cci_identifier_release (request_identifier);
-    cci_stream_release (reply_data);
+    k5_ipc_stream_release (reply_data);
     
     return cci_check_error (err);    
 }
@@ -375,10 +375,10 @@ cc_int32 ccs_server_handle_request (ccs_pipe_t     in_client_pipe,
 
 cc_int32 ccs_server_send_reply (ccs_pipe_t     in_reply_pipe,
                                 cc_int32       in_reply_err,
-                                cci_stream_t   in_reply_data)
+                                k5_ipc_stream   in_reply_data)
 {
     cc_int32 err = ccNoError;
-    cci_stream_t reply = NULL;
+    k5_ipc_stream reply = NULL;
     
     if (!ccs_pipe_valid (in_reply_pipe) ) { err = cci_check_error (ccErrBadParam); }
     
@@ -386,17 +386,17 @@ cc_int32 ccs_server_send_reply (ccs_pipe_t     in_reply_pipe,
         err = cci_message_new_reply_header (&reply, in_reply_err);
     }
     
-    if (!err && in_reply_data && cci_stream_size (in_reply_data) > 0) {
-        err = cci_stream_write (reply, 
-                                cci_stream_data (in_reply_data), 
-                                cci_stream_size (in_reply_data));
+    if (!err && in_reply_data && k5_ipc_stream_size (in_reply_data) > 0) {
+        err = k5_ipc_stream_write (reply, 
+                                k5_ipc_stream_data (in_reply_data), 
+                                k5_ipc_stream_size (in_reply_data));
     }
     
     if (!err) {
         err = ccs_os_server_send_reply (in_reply_pipe, reply);
     }
     
-    cci_stream_release (reply);
+    k5_ipc_stream_release (reply);
     
     return cci_check_error (err);    
 }
index 670a74ee2b333106e72fb772690a11549d35276f..e059d86bcb8eddf8ee605e0bce3073bce8524939 100644 (file)
@@ -43,10 +43,10 @@ cc_int32 ccs_server_client_is_valid (ccs_pipe_t  in_client_pipe,
 
 cc_int32 ccs_server_handle_request (ccs_pipe_t     in_client_pipe,
                                     ccs_pipe_t     in_reply_pipe,
-                                    cci_stream_t   in_request);
+                                    k5_ipc_stream   in_request);
 
 cc_int32 ccs_server_send_reply (ccs_pipe_t     in_reply_pipe,
                                 cc_int32       in_reply_err,
-                                cci_stream_t   in_reply_data);
+                                k5_ipc_stream   in_reply_data);
 
 #endif /* CCS_SERVER_H */
index c99547fe875df8b5a31c527eaee5fea726be193a..98bc6b30a8a54b8fbec6fc774976b03eb8513b87 100644 (file)
 #include "ccs_common.h"
 
 #include <syslog.h>
-#include <Kerberos/kipc_server.h>
-#include "cci_mig_requestServer.h"
-#include "cci_mig_reply.h"
+#include "k5_mig_server.h"
 #include "ccs_os_server.h"
 
-
 /* ------------------------------------------------------------------------ */
 
-static boolean_t ccs_server_demux (mach_msg_header_t *request, 
-                                   mach_msg_header_t *reply) 
+int32_t k5_ipc_server_add_client (mach_port_t in_client_port)
 {
-    boolean_t handled = false;
-    
-    if (!handled) {
-        handled = ccs_server (request, reply);
-    }
-    
-    if (!handled && request->msgh_id == MACH_NOTIFY_NO_SENDERS) {
-        kern_return_t err = KERN_SUCCESS;
-        
-        err = ccs_server_remove_client (request->msgh_local_port);
-        
-        if (!err) {
-            /* Check here for a client in our table and free rights associated with it */
-            err = mach_port_mod_refs (mach_task_self (), request->msgh_local_port, 
-                                      MACH_PORT_RIGHT_RECEIVE, -1);
-        }
-        
-        if (!err) {
-            handled = 1;  /* was a port we are tracking */
-        }
-        
-        cci_check_error (err);
-    }
-    
-    return handled;    
+    return cci_check_error (ccs_server_add_client (in_client_port));
 }
 
 /* ------------------------------------------------------------------------ */
 
-kern_return_t ccs_mipc_create_client_connection (mach_port_t    in_server_port,
-                                                 mach_port_t   *out_connection_port)
+int32_t k5_ipc_server_remove_client (mach_port_t in_client_port)
 {
-    kern_return_t err = KERN_SUCCESS;
-    mach_port_t connection_port = MACH_PORT_NULL;
-    mach_port_t old_notification_target = MACH_PORT_NULL;
-    
-    if (!err) {
-        err = mach_port_allocate (mach_task_self (), MACH_PORT_RIGHT_RECEIVE, &connection_port);
-    }
-    
-    if (!err) {
-        err = mach_port_move_member (mach_task_self (), connection_port, kipc_server_get_listen_portset ());
-    }
-    
-    if (!err) {
-        /* request no-senders notification so we can tell when client quits/crashes */
-        err = mach_port_request_notification (mach_task_self (), connection_port, 
-                                              MACH_NOTIFY_NO_SENDERS, 1, connection_port, 
-                                              MACH_MSG_TYPE_MAKE_SEND_ONCE, &old_notification_target );
-    }
-    
-    if (!err) {
-        err = ccs_server_add_client (connection_port);
-    }
-    
-    if (!err) {
-        *out_connection_port = connection_port;
-        connection_port = MACH_PORT_NULL;
-    }
-    
-    if (MACH_PORT_VALID (connection_port)) { mach_port_deallocate (mach_task_self (), connection_port); }
-    
-    return cci_check_error (err);    
+    return cci_check_error (ccs_server_remove_client (in_client_port));
 }
 
+
 /* ------------------------------------------------------------------------ */
 
-kern_return_t ccs_mipc_request (mach_port_t             in_connection_port,
-                                mach_port_t             in_reply_port,
-                                cci_mipc_inl_request_t  in_inl_request,
-                                mach_msg_type_number_t  in_inl_requestCnt,
-                                cci_mipc_ool_request_t  in_ool_request,
-                                mach_msg_type_number_t  in_ool_requestCnt)
+kern_return_t k5_ipc_server_handle_request (mach_port_t    in_connection_port,
+                                            mach_port_t    in_reply_port,
+                                            k5_ipc_stream  in_request_stream)
 {
-    kern_return_t err = KERN_SUCCESS;
-    cci_stream_t request_stream = NULL;
-    
-    if (!err) {
-        err = cci_stream_new (&request_stream);
-    }
-    
-    if (!err) {
-        if (in_inl_requestCnt) {
-            err = cci_stream_write (request_stream, in_inl_request, in_inl_requestCnt);
-            
-        } else if (in_ool_requestCnt) {
-            err = cci_stream_write (request_stream, in_ool_request, in_ool_requestCnt);
-            
-        } else {
-            err = cci_check_error (ccErrBadInternalMessage);
-        }
-    }
-    
-    if (!err) {
-        err = ccs_server_handle_request (in_connection_port, in_reply_port, request_stream);
-    }
-    
-    cci_stream_release (request_stream);
-    if (in_ool_requestCnt) { vm_deallocate (mach_task_self (), (vm_address_t) in_ool_request, in_ool_requestCnt); }
-    
-    return cci_check_error (err);
+    return cci_check_error (ccs_server_handle_request (in_connection_port, 
+                                                       in_reply_port, 
+                                                       in_request_stream));
 }
 
 #pragma mark -
@@ -152,8 +67,6 @@ cc_int32 ccs_os_server_initialize (int argc, const char *argv[])
     openlog (argv[0], LOG_CONS | LOG_PID, LOG_AUTH);
     syslog (LOG_INFO, "Starting up.");   
     
-    syslog (LOG_NOTICE, "Exiting: %s (%d)", kipc_error_string (err), err);
-    
     return cci_check_error (err);
 }
 
@@ -163,10 +76,7 @@ cc_int32 ccs_os_server_cleanup (int argc, const char *argv[])
 {
     cc_int32 err = 0;
     
-    openlog (argv[0], LOG_CONS | LOG_PID, LOG_AUTH);
-    syslog (LOG_INFO, "Starting up.");   
-    
-    syslog (LOG_NOTICE, "Exiting: %s (%d)", kipc_error_string (err), err);
+    syslog (LOG_NOTICE, "Exiting.");
     
     return cci_check_error (err);
 }
@@ -175,64 +85,14 @@ cc_int32 ccs_os_server_cleanup (int argc, const char *argv[])
 
 cc_int32 ccs_os_server_listen_loop (int argc, const char *argv[])
 {
-    /* Run the Mach IPC listen loop.  
-     * This will call ccs_mipc_create_client_connection for new clients
-     * and ccs_mipc_request for existing clients */
-    
-    return cci_check_error (kipc_server_run_server (ccs_server_demux));
+    return cci_check_error (k5_ipc_server_listen_loop ());
 }
 
 /* ------------------------------------------------------------------------ */
 
 cc_int32 ccs_os_server_send_reply (ccs_pipe_t   in_reply_pipe,
-                                   cci_stream_t in_reply_stream)
+                                   k5_ipc_stream in_reply_stream)
 {
-    kern_return_t err = KERN_SUCCESS;
-    cci_mipc_inl_reply_t inl_reply;
-    mach_msg_type_number_t inl_reply_length = 0;
-    cci_mipc_ool_reply_t ool_reply = NULL;
-    mach_msg_type_number_t ool_reply_length = 0;
-    
-    if (!ccs_pipe_valid (in_reply_pipe)) { err = cci_check_error (ccErrBadParam); }
-    if (!in_reply_stream               ) { err = cci_check_error (ccErrBadParam); }
-    
-    if (!err) {
-        /* depending on how big the message is, use the fast inline buffer or  
-         * the slow dynamically allocated buffer */
-        mach_msg_type_number_t reply_length = cci_stream_size (in_reply_stream);
-        
-        if (reply_length > kCCAPIMaxILMsgSize) {            
-            cci_debug_printf ("%s choosing out of line buffer (size is %d)", 
-                              __FUNCTION__, reply_length);
-            
-            err = vm_read (mach_task_self (), 
-                           (vm_address_t) cci_stream_data (in_reply_stream), reply_length, 
-                           (vm_address_t *) &ool_reply, &ool_reply_length);
-            cci_check_error (err);
-            
-        } else {
-            //cci_debug_printf ("%s choosing in line buffer (size is %d)",
-            //                  __FUNCTION__, reply_length);
-            
-            inl_reply_length = reply_length;
-            memcpy (inl_reply, cci_stream_data (in_reply_stream), reply_length);
-        }
-    }
-    
-    if (!err) {
-        err = ccs_mipc_reply (in_reply_pipe, 
-                              inl_reply, inl_reply_length,
-                              ool_reply, ool_reply_length);
-        cci_check_error (err);
-    }
-    
-    if (!err) {
-        /* Because we use ",dealloc" ool_reply will be freed by mach. Don't double free it. */
-        ool_reply = NULL;
-        ool_reply_length = 0;
-    }
-    
-    if (ool_reply_length) { vm_deallocate (mach_task_self (), (vm_address_t) ool_reply, ool_reply_length); }
-    
-    return cci_check_error (err);
+    return cci_check_error (k5_ipc_server_send_reply (in_reply_pipe, 
+                                                      in_reply_stream));
 }
index 7e6aeb1cb283700d669c44512b1ba46ee425ddad..2e9ebcc93118af5c6a1fbdb1db13298212d32043 100644 (file)
@@ -47,28 +47,28 @@ void deleteBuffer(char** buf) {
 \r
 // WorkItem contains a CountedBuffer which must be deleted, \r
 //  so each WorkItem must be deleted.\r
-WorkItem::WorkItem(cci_stream_t buf, WIN_PIPE* pipe, const long type, const long sst) \r
+WorkItem::WorkItem(k5_ipc_stream buf, WIN_PIPE* pipe, const long type, const long sst) \r
 : _buf(buf), _rpcmsg(type), _pipe(pipe), _sst(sst) { }\r
 \r
 WorkItem::WorkItem(const WorkItem& item) : _buf(NULL), _rpcmsg(0), _pipe(NULL), _sst(0) {\r
 \r
-    cci_stream_t    _buf = NULL;\r
-    cci_stream_new(&_buf);\r
-    cci_stream_write(_buf, \r
-                     cci_stream_data(item.payload()),\r
-                     cci_stream_size(item.payload()) );\r
+    k5_ipc_stream    _buf = NULL;\r
+    k5_ipc_stream_new(&_buf);\r
+    k5_ipc_stream_write(_buf, \r
+                     k5_ipc_stream_data(item.payload()),\r
+                     k5_ipc_stream_size(item.payload()) );\r
     WorkItem(_buf, item._pipe, item._rpcmsg, item._sst);\r
     }\r
 \r
 WorkItem::WorkItem() : _buf(NULL), _rpcmsg(CCMSG_INVALID), _pipe(NULL), _sst(0) { }\r
 \r
 WorkItem::~WorkItem() {\r
-    if (_buf)   cci_stream_release(_buf);\r
+    if (_buf)   k5_ipc_stream_release(_buf);\r
     if (_pipe)  ccs_win_pipe_release(_pipe);\r
     }\r
 \r
-const cci_stream_t WorkItem::take_payload() {\r
-    cci_stream_t  temp  = payload();\r
+const k5_ipc_stream WorkItem::take_payload() {\r
+    k5_ipc_stream temp  = payload();\r
     _buf                = NULL;\r
     return temp;\r
     }\r
index 711ecc17327d3189fbd0572350233fb25619777d..f16ad117e45f83b0e187d5c0fc822c584c429148 100644 (file)
@@ -39,14 +39,14 @@ EXTERN_C    bool worklist_isEmpty() {
 \r
 EXTERN_C    int worklist_add(   const long          rpcmsg, \r
                                 const ccs_pipe_t    pipe, \r
-                                const cci_stream_t  stream, \r
+                                const k5_ipc_stream stream, \r
                                 const time_t        serverStartTime) {\r
         return worklist.add(new WorkItem(stream, pipe, rpcmsg, serverStartTime) );\r
         }\r
 \r
 EXTERN_C    int  worklist_remove(long*              rpcmsg,\r
                                  ccs_pipe_t*        pipe,\r
-                                 cci_stream_t*      stream,\r
+                                 k5_ipc_stream*      stream,\r
                                  time_t*            sst) {\r
         WorkItem*   item    = NULL;\r
         cc_int32    err     = worklist.remove(&item);\r
index eb4678019663ab93b33aadea0b6fff3580b09b90..42d0cf20725a5b8ea89ea5661b9c7d14651869eb 100644 (file)
@@ -35,12 +35,12 @@ EXTERN_C    BOOL worklist_isEmpty();
 
 EXTERN_C    void worklist_add(  const long          rpcmsg,
                                 const ccs_pipe_t    pipe,
-                                const cci_stream_t  stream,
+                                const k5_ipc_stream stream,
                                 const time_t        serverStartTime);
 
 EXTERN_C    int  worklist_remove(long*              rpcmsg,
                                  ccs_pipe_t*        pipe,
-                                 cci_stream_t*      stream,
+                                 k5_ipc_stream*      stream,
                                  time_t*            serverStartTime);
 
 #endif // _work_queue_h
\ No newline at end of file
index a6725b4edf0d78034411288dc790c9bb753c377b..99854d113967d09c15cbc5c62ca0f4a847178ebb 100644 (file)
@@ -231,12 +231,12 @@ cc_int32 ccs_os_server_listen_loop (int argc, const char *argv[]) {
             SleepEx(1000, TRUE);\r
             }\r
         else if (TRUE) {      // Take next WorkItem from the queue:\r
-            cci_stream_t    buf             = NULL;\r
+            k5_ipc_stream    buf             = NULL;\r
             long            rpcmsg          = CCMSG_INVALID;\r
             time_t          serverStartTime = 0xDEADDEAD;\r
             RPC_STATUS      status          = 0;\r
             char*           uuid            = NULL;\r
-            cci_stream_t    stream          = NULL;\r
+            k5_ipc_stream    stream          = NULL;\r
             ccs_pipe_t     pipe             = NULL;\r
             ccs_pipe_t     pipe2            = NULL;\r
 \r
@@ -279,8 +279,8 @@ cc_int32 ccs_os_server_listen_loop (int argc, const char *argv[]) {
                             break;\r
                         case CCMSG_PING:\r
                             cci_debug_printf("  Processing PING");\r
-                            err = cci_stream_new  (&stream);\r
-                            err = cci_stream_write(stream, "This is a test of the emergency broadcasting system", 52);\r
+                            err = k5_ipc_stream_new  (&stream);\r
+                            err = k5_ipc_stream_write(stream, "This is a test of the emergency broadcasting system", 52);\r
                             err = ccs_os_server_send_reply(pipe, stream);\r
                             break;\r
                         default:\r
@@ -288,7 +288,7 @@ cc_int32 ccs_os_server_listen_loop (int argc, const char *argv[]) {
                                 rpcmsg, uuid);\r
                             break;\r
                         }\r
-                    if (buf)        cci_stream_release(buf);\r
+                    if (buf)        k5_ipc_stream_release(buf);\r
                     /* Don't free uuid, which was allocated here.  A pointer to it is in the \r
                        rpcargs struct which was passed to connectionListener which will be\r
                        received by ccapi_listen when the client exits.  ccapi_listen needs \r
@@ -311,10 +311,10 @@ cc_int32 ccs_os_server_listen_loop (int argc, const char *argv[]) {
 /* ------------------------------------------------------------------------ */\r
 \r
 cc_int32 ccs_os_server_send_reply (ccs_pipe_t   in_pipe,\r
-                                   cci_stream_t in_reply_stream) {\r
+                                   k5_ipc_stream in_reply_stream) {\r
 \r
     /* ccs_pipe_t in_reply_pipe     is a char* reply endpoint.\r
-       cci_stream_t in_reply_stream is the data to be sent.\r
+       k5_ipc_stream in_reply_stream is the data to be sent.\r
      */\r
 \r
     cc_int32    err     = 0;\r
@@ -333,8 +333,8 @@ cc_int32 ccs_os_server_send_reply (ccs_pipe_t   in_pipe,
                 (unsigned char*)&h,                 /* client's tspdata* */\r
                 (unsigned char*)uuid,\r
                 getMySST(),\r
-                cci_stream_size(in_reply_stream),   /* Length of buffer */\r
-                (const unsigned char*)cci_stream_data(in_reply_stream),   /* Data buffer */\r
+                k5_ipc_stream_size(in_reply_stream),   /* Length of buffer */\r
+                (const unsigned char*)k5_ipc_stream_data(in_reply_stream),   /* Data buffer */\r
                 &status );                          /* Return code */\r
             }\r
         RpcExcept(1) {\r
index e3c741bccbeb4aba4612c87dc7f79dd4a9811c22..8a0da03f4b197429477037b6141ccecc5235f58e 100644 (file)
@@ -43,7 +43,7 @@ void ccs_rpc_request(
     long*       return_status ) {   /* Return code */
 
     cc_int32        status  = 0;
-    cci_stream_t    stream;
+    k5_ipc_stream    stream;
     DWORD*          p       = (DWORD*)(tspHandle);
     WIN_PIPE*       pipe    = NULL;
 #if 0
@@ -52,11 +52,11 @@ void ccs_rpc_request(
     status = (rpcmsg != CCMSG_REQUEST) && (rpcmsg != CCMSG_PING);
     
     if (!status) {                         
-        status = cci_stream_new (&stream);  /* Create a stream for the request data */
+        status = k5_ipc_stream_new (&stream);  /* Create a stream for the request data */
         }
 
     if (!status) {                          /* Put the data into the stream */
-        status = cci_stream_write (stream, pbRequest, lenRequest);
+        status = k5_ipc_stream_write (stream, pbRequest, lenRequest);
         }
 
     pipe = ccs_win_pipe_new(pszUUID, *p);    
index df1d7794a4fe7c65f54cfd85dd57b1aee6a89198..105380669ff99a60f149ea558f399f30853597ba 100644 (file)
@@ -11,12 +11,12 @@ extern "C" {
 
 class WorkItem {
 private:
-          cci_stream_t    _buf;
+          k5_ipc_stream    _buf;
           WIN_PIPE*       _pipe;
     const long            _rpcmsg;
     const long            _sst;
 public:
-    WorkItem(   cci_stream_t  buf, 
+    WorkItem(   k5_ipc_stream buf, 
                 WIN_PIPE*     pipe, 
                 const long    type, 
                 const long    serverStartTime);
@@ -24,8 +24,8 @@ public:
     WorkItem();
     ~WorkItem();
 
-    const cci_stream_t  payload()       const   {return _buf;}
-    const cci_stream_t  take_payload();
+    const k5_ipc_stream payload()       const   {return _buf;}
+    const k5_ipc_stream take_payload();
           WIN_PIPE*     take_pipe();
           WIN_PIPE*     pipe()          const   {return _pipe;}
     const long          type()          const   {return _rpcmsg;}
index 55397ef908b562f63bf0cf92ae248e07956d5c8c..edbf5a4ad2f5a9d36ba8cfeef53a4a386ac8a631 100644 (file)
@@ -74,9 +74,4 @@ uint32_t k5_ipc_stream_read_uint64 (k5_ipc_stream  io_stream,
 uint32_t k5_ipc_stream_write_uint64 (k5_ipc_stream io_stream, 
                                      uint64_t      in_uint64);
 
-uint32_t k5_ipc_stream_read_time (k5_ipc_stream  io_stream, 
-                                  time_t        *out_time);
-uint32_t k5_ipc_stream_write_time (k5_ipc_stream io_stream, 
-                                   time_t        in_time);
-
 #endif /* K5_IPC_STREAM_H */
index 608e0fb37a120817d69513f0d891ddabd45006f9..4037fe87d14a9ed342ce892bce356341ac9bcfee 100644 (file)
@@ -450,7 +450,7 @@ uint32_t k5_ipc_stream_read_uint64 (k5_ipc_stream  io_stream,
 /* ------------------------------------------------------------------------ */
 
 uint32_t k5_ipc_stream_write_uint64 (k5_ipc_stream io_stream, 
-                                     uint64_t     in_uint64)
+                                     uint64_t      in_uint64)
 {
     int32_t err = 0;
     int64_t uint64 = htonll (in_uint64);
@@ -463,45 +463,3 @@ uint32_t k5_ipc_stream_write_uint64 (k5_ipc_stream io_stream,
     
     return k5_check_error (err);
 }
-
-#ifdef TARGET_OS_MAC
-#pragma mark -
-#endif
-
-/* ------------------------------------------------------------------------ */
-
-uint32_t k5_ipc_stream_read_time (k5_ipc_stream  io_stream, 
-                                  time_t        *out_time)
-{
-    int32_t err = 0;
-    int64_t t = 0;
-    
-    if (!io_stream) { err = k5_check_error (EINVAL); }
-    if (!out_time ) { err = k5_check_error (EINVAL); }
-    
-    if (!err) {
-        err = k5_ipc_stream_read_int64 (io_stream, &t);
-    }
-    
-    if (!err) {
-        *out_time = t;
-    }
-    
-    return k5_check_error (err);
-}
-
-/* ------------------------------------------------------------------------ */
-
-uint32_t k5_ipc_stream_write_time (k5_ipc_stream io_stream, 
-                                   time_t        in_time)
-{
-    int32_t err = 0;
-    
-    if (!io_stream) { err = k5_check_error (EINVAL); }
-    
-    if (!err) {
-        err = k5_ipc_stream_write_int64 (io_stream, in_time);
-    }
-    
-    return k5_check_error (err);
-}