[Gluster-devel] [PATCH BUG:393 05/10] transport/encryption: pass transport_crypto_t instead of transport_t

Corentin Chary corentin.chary at gmail.com
Wed Nov 18 11:13:57 UTC 2009


Signed-off-by: Corentin Chary <corentin.chary at gmail.com>
---
 libglusterfs/src/transport.c               |    7 ++++---
 libglusterfs/src/transport.h               |    4 ++--
 transport/encryption/rot-13c/src/rot-13c.c |    4 ++--
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/libglusterfs/src/transport.c b/libglusterfs/src/transport.c
index 2eccf20..b88de9f 100644
--- a/libglusterfs/src/transport.c
+++ b/libglusterfs/src/transport.c
@@ -327,7 +327,8 @@ transport_submit (transport_t *this, char *buf, int32_t len,
 	hdr->crypto = hton32 (this->crypto.magic);
 
 	if (this->crypto.ops && this->crypto.ops->encrypt) {
-		ret = this->crypto.ops->encrypt (this, buf, len, vector, count);
+		ret = this->crypto.ops->encrypt (&this->crypto, buf,
+						 len, vector, count);
 		if (ret)
 			goto fail;
 	}
@@ -485,8 +486,8 @@ transport_receive (transport_t *this, char **hdr_p, size_t *hdrlen_p,
 	}
 
 	if (this->crypto.ops && this->crypto.ops->decrypt)
-		ret = this->crypto.ops->decrypt (this, *hdr_p, *hdrlen_p,
-						 *iobuf_p, buflen);
+		ret = this->crypto.ops->decrypt (&this->crypto, *hdr_p,
+						 *hdrlen_p, *iobuf_p, buflen);
 fail:
 	return ret;
 }
diff --git a/libglusterfs/src/transport.h b/libglusterfs/src/transport.h
index 393aa7e..a92506e 100644
--- a/libglusterfs/src/transport.h
+++ b/libglusterfs/src/transport.h
@@ -89,9 +89,9 @@ struct transport {
 };
 
 struct transport_crypto_ops {
-	int32_t (*decrypt)    (transport_t *this, char *hdr, size_t len,
+	int32_t (*decrypt)    (transport_crypto_t *this, char *hdr, size_t len,
 			       struct iobuf *iobuf_p, size_t buflen);
-	int32_t (*encrypt)    (transport_t *this, char *hdr, size_t len,
+	int32_t (*encrypt)    (transport_crypto_t *this, char *hdr, size_t len,
 			       struct iovec *vector, int count);
 };
 
diff --git a/transport/encryption/rot-13c/src/rot-13c.c b/transport/encryption/rot-13c/src/rot-13c.c
index d37d389..29b9bcb 100644
--- a/transport/encryption/rot-13c/src/rot-13c.c
+++ b/transport/encryption/rot-13c/src/rot-13c.c
@@ -62,7 +62,7 @@ rot13_iovec (struct iovec *vector, int count)
 }
 
 int32_t
-rot13c_encrypt (transport_t *this, char *hdr, size_t len,
+rot13c_encrypt (transport_crypto_t *this, char *hdr, size_t len,
 		struct iovec *vector, int count)
 {
 	rot13 (gf_param((gf_hdr_common_t *)hdr), len - GF_HDR_COMMON_SIZE);
@@ -71,7 +71,7 @@ rot13c_encrypt (transport_t *this, char *hdr, size_t len,
 }
 
 int32_t
-rot13c_decrypt (transport_t *this, char *hdr, size_t len,
+rot13c_decrypt (transport_crypto_t *this, char *hdr, size_t len,
 		struct iobuf *iobuf, size_t buflen)
 {
 	rot13 (gf_param((gf_hdr_common_t *)hdr), len - GF_HDR_COMMON_SIZE);
-- 
1.6.4.4






More information about the Gluster-devel mailing list