git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofproto: Inline trivial functions.
[sliver-openvswitch.git]
/
lib
/
learning-switch.c
diff --git
a/lib/learning-switch.c
b/lib/learning-switch.c
index
8efbce1
..
c818a32
100644
(file)
--- a/
lib/learning-switch.c
+++ b/
lib/learning-switch.c
@@
-315,12
+315,12
@@
lswitch_process_packet(struct lswitch *sw, const struct ofpbuf *msg)
switch (type) {
case OFPTYPE_ECHO_REQUEST:
switch (type) {
case OFPTYPE_ECHO_REQUEST:
- process_echo_request(sw,
msg->data
);
+ process_echo_request(sw,
ofpbuf_data(msg)
);
break;
case OFPTYPE_FEATURES_REPLY:
if (sw->state == S_FEATURES_REPLY) {
break;
case OFPTYPE_FEATURES_REPLY:
if (sw->state == S_FEATURES_REPLY) {
- if (!process_switch_features(sw,
msg->data
)) {
+ if (!process_switch_features(sw,
ofpbuf_data(msg)
)) {
sw->state = S_SWITCHING;
} else {
rconn_disconnect(sw->rconn);
sw->state = S_SWITCHING;
} else {
rconn_disconnect(sw->rconn);
@@
-329,7
+329,7
@@
lswitch_process_packet(struct lswitch *sw, const struct ofpbuf *msg)
break;
case OFPTYPE_PACKET_IN:
break;
case OFPTYPE_PACKET_IN:
- process_packet_in(sw,
msg->data
);
+ process_packet_in(sw,
ofpbuf_data(msg)
);
break;
case OFPTYPE_FLOW_REMOVED:
break;
case OFPTYPE_FLOW_REMOVED:
@@
-400,7
+400,7
@@
lswitch_process_packet(struct lswitch *sw, const struct ofpbuf *msg)
case OFPTYPE_TABLE_FEATURES_STATS_REPLY:
default:
if (VLOG_IS_DBG_ENABLED()) {
case OFPTYPE_TABLE_FEATURES_STATS_REPLY:
default:
if (VLOG_IS_DBG_ENABLED()) {
- char *s = ofp_to_string(
msg->data, msg->size
, 2);
+ char *s = ofp_to_string(
ofpbuf_data(msg), ofpbuf_size(msg)
, 2);
VLOG_DBG_RL(&rl, "%016llx: OpenFlow packet ignored: %s",
sw->datapath_id, s);
free(s);
VLOG_DBG_RL(&rl, "%016llx: OpenFlow packet ignored: %s",
sw->datapath_id, s);
free(s);
@@
-556,7
+556,6
@@
process_packet_in(struct lswitch *sw, const struct ofp_header *oh)
struct ofpbuf pkt;
struct flow flow;
struct ofpbuf pkt;
struct flow flow;
- union flow_in_port in_port_;
error = ofputil_decode_packet_in(&pi, oh);
if (error) {
error = ofputil_decode_packet_in(&pi, oh);
if (error) {
@@
-574,8
+573,8
@@
process_packet_in(struct lswitch *sw, const struct ofp_header *oh)
/* Extract flow data from 'opi' into 'flow'. */
ofpbuf_use_const(&pkt, pi.packet, pi.packet_len);
/* Extract flow data from 'opi' into 'flow'. */
ofpbuf_use_const(&pkt, pi.packet, pi.packet_len);
-
in_port_.ofp_port = pi.fmd.in_port
;
- flow
_extract(&pkt, 0, 0, NULL, &in_port_, &flow)
;
+
flow_extract(&pkt, NULL, &flow)
;
+ flow
.in_port.ofp_port = pi.fmd.in_port
;
flow.tunnel.tun_id = pi.fmd.tun_id;
/* Choose output port. */
flow.tunnel.tun_id = pi.fmd.tun_id;
/* Choose output port. */
@@
-599,15
+598,15
@@
process_packet_in(struct lswitch *sw, const struct ofp_header *oh)
/* Prepare packet_out in case we need one. */
po.buffer_id = pi.buffer_id;
if (po.buffer_id == UINT32_MAX) {
/* Prepare packet_out in case we need one. */
po.buffer_id = pi.buffer_id;
if (po.buffer_id == UINT32_MAX) {
- po.packet =
pkt.data
;
- po.packet_len =
pkt.size
;
+ po.packet =
ofpbuf_data(&pkt)
;
+ po.packet_len =
ofpbuf_size(&pkt)
;
} else {
po.packet = NULL;
po.packet_len = 0;
}
po.in_port = pi.fmd.in_port;
} else {
po.packet = NULL;
po.packet_len = 0;
}
po.in_port = pi.fmd.in_port;
- po.ofpacts = ofp
acts.data
;
- po.ofpacts_len = ofp
acts.size
;
+ po.ofpacts = ofp
buf_data(&ofpacts)
;
+ po.ofpacts_len = ofp
buf_size(&ofpacts)
;
/* Send the packet, and possibly the whole flow, to the output port. */
if (sw->max_idle >= 0 && (!sw->ml || out_port != OFPP_FLOOD)) {
/* Send the packet, and possibly the whole flow, to the output port. */
if (sw->max_idle >= 0 && (!sw->ml || out_port != OFPP_FLOOD)) {
@@
-625,8
+624,8
@@
process_packet_in(struct lswitch *sw, const struct ofp_header *oh)
fm.idle_timeout = sw->max_idle;
fm.buffer_id = pi.buffer_id;
fm.out_port = OFPP_NONE;
fm.idle_timeout = sw->max_idle;
fm.buffer_id = pi.buffer_id;
fm.out_port = OFPP_NONE;
- fm.ofpacts = ofp
acts.data
;
- fm.ofpacts_len = ofp
acts.size
;
+ fm.ofpacts = ofp
buf_data(&ofpacts)
;
+ fm.ofpacts_len = ofp
buf_size(&ofpacts)
;
buffer = ofputil_encode_flow_mod(&fm, sw->protocol);
queue_tx(sw, buffer);
buffer = ofputil_encode_flow_mod(&fm, sw->protocol);
queue_tx(sw, buffer);