summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-02-10 13:16:56 -0800
committerBen Pfaff <blp@nicira.com>2011-03-29 12:28:11 -0700
commit10d0a1d2a9be4c01e1b2b4e8fbd5c61d9b9e60cd (patch)
treeea68a5ea4f7be1b21d5730fe118c4faec159c951 /ofproto
parent1ce0a5fa82f1a0013dd62713d16fde973b029eb7 (diff)
downloadopenvswitch-10d0a1d2a9be4c01e1b2b4e8fbd5c61d9b9e60cd.tar.gz
ofproto: New function ofconn_pktbuf_retrieve().
This helps to increase the level of abstraction of "struct ofconn", in preparation for moving it from ofproto.c into a new file.
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index f757b5809..25a9db68c 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -361,6 +361,10 @@ static enum ofconn_type ofconn_get_type(const struct ofconn *);
static enum nx_role ofconn_get_role(const struct ofconn *);
static void ofconn_set_role(struct ofconn *, enum nx_role);
+static int ofconn_pktbuf_retrieve(struct ofconn *, uint32_t id,
+ struct ofpbuf **bufferp, uint16_t *in_port);
+
+
static void queue_tx(struct ofpbuf *msg, const struct ofconn *ofconn,
struct rconn_packet_counter *counter);
@@ -2058,6 +2062,13 @@ ofconn_set_role(struct ofconn *ofconn, enum nx_role role)
{
ofconn->role = role;
}
+
+static int
+ofconn_pktbuf_retrieve(struct ofconn *ofconn, uint32_t id,
+ struct ofpbuf **bufferp, uint16_t *in_port)
+{
+ return pktbuf_retrieve(ofconn->pktbuf, id, bufferp, in_port);
+}
static void
ofservice_reconfigure(struct ofservice *ofservice,
@@ -3353,8 +3364,8 @@ handle_packet_out(struct ofconn *ofconn, const struct ofp_header *oh)
/* Get payload. */
if (opo->buffer_id != htonl(UINT32_MAX)) {
- error = pktbuf_retrieve(ofconn->pktbuf, ntohl(opo->buffer_id),
- &buffer, &in_port);
+ error = ofconn_pktbuf_retrieve(ofconn, ntohl(opo->buffer_id),
+ &buffer, &in_port);
if (error || !buffer) {
return error;
}
@@ -4115,8 +4126,8 @@ add_flow(struct ofconn *ofconn, struct flow_mod *fm)
error = 0;
if (fm->buffer_id != UINT32_MAX) {
- error = pktbuf_retrieve(ofconn->pktbuf, fm->buffer_id,
- &packet, &in_port);
+ error = ofconn_pktbuf_retrieve(ofconn, fm->buffer_id,
+ &packet, &in_port);
} else {
packet = NULL;
in_port = UINT16_MAX;
@@ -4151,7 +4162,7 @@ send_buffered_packet(struct ofconn *ofconn,
return 0;
}
- error = pktbuf_retrieve(ofconn->pktbuf, buffer_id, &packet, &in_port);
+ error = ofconn_pktbuf_retrieve(ofconn, buffer_id, &packet, &in_port);
if (error) {
return error;
}