projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Break passive vconns out into separate pvconn routines and data structures.
[openvswitch]
/
lib
/
vconn-ssl.c
diff --git
a/lib/vconn-ssl.c
b/lib/vconn-ssl.c
index d899e091f2c114203a7b81066bb4e71acc33128d..bac39b5e195624a7549de9beac6a8bba5442f7d1 100644
(file)
--- a/
lib/vconn-ssl.c
+++ b/
lib/vconn-ssl.c
@@
-663,24
+663,26
@@
struct vconn_class ssl_vconn_class = {
\f
/* Passive SSL. */
\f
/* Passive SSL. */
-struct pssl_vconn
+struct pssl_
p
vconn
{
{
- struct
vconn
vconn;
+ struct
pvconn p
vconn;
int fd;
};
int fd;
};
-static struct pssl_vconn *
-pssl_vconn_cast(struct vconn *vconn)
+struct pvconn_class pssl_pvconn_class;
+
+static struct pssl_pvconn *
+pssl_pvconn_cast(struct pvconn *pvconn)
{
{
-
vconn_assert_class(vconn, &pssl_
vconn_class);
- return CONTAINER_OF(
vconn, struct pssl_vconn,
vconn);
+
pvconn_assert_class(pvconn, &pssl_p
vconn_class);
+ return CONTAINER_OF(
pvconn, struct pssl_pvconn, p
vconn);
}
static int
}
static int
-pssl_open(const char *name, char *suffix, struct
vconn **
vconnp)
+pssl_open(const char *name, char *suffix, struct
pvconn **p
vconnp)
{
struct sockaddr_in sin;
{
struct sockaddr_in sin;
- struct pssl_vconn *pssl;
+ struct pssl_
p
vconn *pssl;
int retval;
int fd;
unsigned int yes = 1;
int retval;
int fd;
unsigned int yes = 1;
@@
-731,24
+733,24
@@
pssl_open(const char *name, char *suffix, struct vconn **vconnp)
}
pssl = xmalloc(sizeof *pssl);
}
pssl = xmalloc(sizeof *pssl);
-
vconn_init(&pssl->vconn, &pssl_vconn_class, 0, 0
, name);
+
pvconn_init(&pssl->pvconn, &pssl_pvconn_class
, name);
pssl->fd = fd;
pssl->fd = fd;
- *
vconnp = &pssl->
vconn;
+ *
pvconnp = &pssl->p
vconn;
return 0;
}
static void
return 0;
}
static void
-pssl_close(struct
vconn *
vconn)
+pssl_close(struct
pvconn *p
vconn)
{
{
- struct pssl_
vconn *pssl = pssl_vconn_cast(
vconn);
+ struct pssl_
pvconn *pssl = pssl_pvconn_cast(p
vconn);
close(pssl->fd);
free(pssl);
}
static int
close(pssl->fd);
free(pssl);
}
static int
-pssl_accept(struct
vconn *
vconn, struct vconn **new_vconnp)
+pssl_accept(struct
pvconn *p
vconn, struct vconn **new_vconnp)
{
{
- struct pssl_
vconn *pssl = pssl_vconn_cast(
vconn);
+ struct pssl_
pvconn *pssl = pssl_pvconn_cast(p
vconn);
struct sockaddr_in sin;
socklen_t sin_len = sizeof sin;
char name[128];
struct sockaddr_in sin;
socklen_t sin_len = sizeof sin;
char name[128];
@@
-779,19
+781,18
@@
pssl_accept(struct vconn *vconn, struct vconn **new_vconnp)
}
static void
}
static void
-pssl_wait(struct
vconn *vconn, enum vconn_wait_type wait
)
+pssl_wait(struct
pvconn *pvconn
)
{
{
- struct pssl_vconn *pssl = pssl_vconn_cast(vconn);
- assert(wait == WAIT_ACCEPT);
+ struct pssl_pvconn *pssl = pssl_pvconn_cast(pvconn);
poll_fd_wait(pssl->fd, POLLIN);
}
poll_fd_wait(pssl->fd, POLLIN);
}
-struct
vconn_class pssl_
vconn_class = {
-
.name =
"pssl",
-
.open =
pssl_open,
-
.close =
pssl_close,
-
.accept =
pssl_accept,
-
.wait =
pssl_wait,
+struct
pvconn_class pssl_p
vconn_class = {
+ "pssl",
+ pssl_open,
+ pssl_close,
+ pssl_accept,
+ pssl_wait,
};
\f
/*
};
\f
/*