@@ -668,7 +668,7 @@ decode_NXAST_RAW_CONTROLLER(const struct nx_action_controller *nac,
668
668
oc -> max_len = ntohs (nac -> max_len );
669
669
oc -> controller_id = ntohs (nac -> controller_id );
670
670
oc -> reason = nac -> reason ;
671
- ofpact_finish (out , & oc -> ofpact );
671
+ ofpact_finish_CONTROLLER (out , & oc );
672
672
673
673
return 0 ;
674
674
}
@@ -737,7 +737,7 @@ decode_NXAST_RAW_CONTROLLER2(const struct nx_action_controller2 *nac2,
737
737
}
738
738
}
739
739
740
- ofpact_finish (out , & oc -> ofpact );
740
+ ofpact_finish_CONTROLLER (out , & oc );
741
741
742
742
return 0 ;
743
743
}
@@ -852,7 +852,7 @@ parse_CONTROLLER(char *arg, struct ofpbuf *ofpacts,
852
852
controller = ofpacts -> header ;
853
853
controller -> userdata_len = userdata_len ;
854
854
}
855
- ofpact_finish (ofpacts , & controller -> ofpact );
855
+ ofpact_finish_CONTROLLER (ofpacts , & controller );
856
856
}
857
857
858
858
return NULL ;
@@ -1262,7 +1262,7 @@ decode_bundle(bool load, const struct nx_action_bundle *nab,
1262
1262
bundle = ofpacts -> header ;
1263
1263
}
1264
1264
1265
- bundle = ofpact_finish (ofpacts , & bundle -> ofpact );
1265
+ ofpact_finish_BUNDLE (ofpacts , & bundle );
1266
1266
if (!error ) {
1267
1267
error = bundle_check (bundle , OFPP_MAX , NULL );
1268
1268
}
@@ -3096,7 +3096,7 @@ decode_OFPAT_RAW_DEC_NW_TTL(struct ofpbuf *out)
3096
3096
ids -> n_controllers = 1 ;
3097
3097
ofpbuf_put (out , & id , sizeof id );
3098
3098
ids = out -> header ;
3099
- ofpact_finish (out , & ids -> ofpact );
3099
+ ofpact_finish_DEC_TTL (out , & ids );
3100
3100
return error ;
3101
3101
}
3102
3102
@@ -3133,7 +3133,7 @@ decode_NXAST_RAW_DEC_TTL_CNT_IDS(const struct nx_action_cnt_ids *nac_ids,
3133
3133
ids = out -> header ;
3134
3134
}
3135
3135
3136
- ofpact_finish (out , & ids -> ofpact );
3136
+ ofpact_finish_DEC_TTL (out , & ids );
3137
3137
3138
3138
return 0 ;
3139
3139
}
@@ -3172,7 +3172,7 @@ parse_noargs_dec_ttl(struct ofpbuf *ofpacts)
3172
3172
ofpbuf_put (ofpacts , & id , sizeof id );
3173
3173
ids = ofpacts -> header ;
3174
3174
ids -> n_controllers ++ ;
3175
- ofpact_finish (ofpacts , & ids -> ofpact );
3175
+ ofpact_finish_DEC_TTL (ofpacts , & ids );
3176
3176
}
3177
3177
3178
3178
static char * OVS_WARN_UNUSED_RESULT
@@ -3199,7 +3199,7 @@ parse_DEC_TTL(char *arg, struct ofpbuf *ofpacts,
3199
3199
return xstrdup ("dec_ttl_cnt_ids: expected at least one controller "
3200
3200
"id." );
3201
3201
}
3202
- ofpact_finish (ofpacts , & ids -> ofpact );
3202
+ ofpact_finish_DEC_TTL (ofpacts , & ids );
3203
3203
}
3204
3204
return NULL ;
3205
3205
}
@@ -4228,7 +4228,7 @@ decode_NXAST_RAW_LEARN(const struct nx_action_learn *nal,
4228
4228
get_subfield (spec -> n_bits , & p , & spec -> dst );
4229
4229
}
4230
4230
}
4231
- ofpact_finish (ofpacts , & learn -> ofpact );
4231
+ ofpact_finish_LEARN (ofpacts , & learn );
4232
4232
4233
4233
if (!is_all_zeros (p , (char * ) end - (char * ) p )) {
4234
4234
return OFPERR_OFPBAC_BAD_ARGUMENT ;
@@ -4554,7 +4554,7 @@ decode_NXAST_RAW_NOTE(const struct nx_action_note *nan,
4554
4554
note = ofpact_put_NOTE (out );
4555
4555
note -> length = length ;
4556
4556
ofpbuf_put (out , nan -> note , length );
4557
- ofpact_finish (out , out -> header );
4557
+ ofpact_finish_NOTE (out , & note );
4558
4558
4559
4559
return 0 ;
4560
4560
}
@@ -4586,7 +4586,7 @@ parse_NOTE(const char *arg, struct ofpbuf *ofpacts,
4586
4586
struct ofpact_note * note = ofpbuf_at_assert (ofpacts , start_ofs ,
4587
4587
sizeof * note );
4588
4588
note -> length = ofpacts -> size - (start_ofs + sizeof * note );
4589
- ofpact_finish (ofpacts , & note -> ofpact );
4589
+ ofpact_finish_NOTE (ofpacts , & note );
4590
4590
return NULL ;
4591
4591
}
4592
4592
@@ -4994,7 +4994,7 @@ decode_NXAST_RAW_CT(const struct nx_action_conntrack *nac,
4994
4994
4995
4995
conntrack = ofpbuf_push_uninit (out , sizeof (* conntrack ));
4996
4996
out -> header = & conntrack -> ofpact ;
4997
- conntrack = ofpact_finish (out , & conntrack -> ofpact );
4997
+ ofpact_finish_CT (out , & conntrack );
4998
4998
4999
4999
if (conntrack -> ofpact .len > sizeof (* conntrack )
5000
5000
&& !(conntrack -> flags & NX_CT_F_COMMIT )) {
@@ -5115,7 +5115,7 @@ parse_CT(char *arg, struct ofpbuf *ofpacts,
5115
5115
}
5116
5116
}
5117
5117
5118
- ofpact_finish (ofpacts , & oc -> ofpact );
5118
+ ofpact_finish_CT (ofpacts , & oc );
5119
5119
ofpbuf_push_uninit (ofpacts , ct_offset );
5120
5120
return error ;
5121
5121
}
@@ -7419,6 +7419,7 @@ ofpacts_format(const struct ofpact *ofpacts, size_t ofpacts_len,
7419
7419
7420
7420
/* Internal use by helpers. */
7421
7421
7422
+ /* Implementation of ofpact_put_<ENUM>(). */
7422
7423
void *
7423
7424
ofpact_put (struct ofpbuf * ofpacts , enum ofpact_type type , size_t len )
7424
7425
{
@@ -7430,6 +7431,7 @@ ofpact_put(struct ofpbuf *ofpacts, enum ofpact_type type, size_t len)
7430
7431
return ofpact ;
7431
7432
}
7432
7433
7434
+ /* Implementation of ofpact_init_<ENUM>(). */
7433
7435
void
7434
7436
ofpact_init (struct ofpact * ofpact , enum ofpact_type type , size_t len )
7435
7437
{
@@ -7438,8 +7440,10 @@ ofpact_init(struct ofpact *ofpact, enum ofpact_type type, size_t len)
7438
7440
ofpact -> raw = -1 ;
7439
7441
ofpact -> len = len ;
7440
7442
}
7441
-
7442
- /* Finishes composing a variable-length action (begun using
7443
+
7444
+ /* Implementation of ofpact_finish_<ENUM>().
7445
+ *
7446
+ * Finishes composing a variable-length action (begun using
7443
7447
* ofpact_put_<NAME>()), by padding the action to a multiple of OFPACT_ALIGNTO
7444
7448
* bytes and updating its embedded length field. See the large comment near
7445
7449
* the end of ofp-actions.h for more information.
0 commit comments