MCPcopy Create free account
hub / github.com/NetSys/bess / ProcessBatch

Method ProcessBatch

core/modules/set_metadata.cc:218–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218void SetMetadata::ProcessBatch(Context *ctx, bess::PacketBatch *batch) {
219 for (size_t i = 0; i < attrs_.size(); i++) {
220 const struct Attr *attr = &attrs_[i];
221 mt_offset_t mt_offset = attr_offset(i);
222
223 if (!bess::metadata::IsValidOffset(mt_offset)) {
224 continue;
225 }
226
227 if (attr->offset >= 0) {
228 DoProcessBatch<Mode::FromPacket>(batch, attr, mt_offset);
229 } else {
230 DoProcessBatch<Mode::FromValue>(batch, attr, mt_offset);
231 }
232 }
233
234 RunNextModule(ctx, batch);
235}
236
237ADD_MODULE(SetMetadata, "setattr", "Set metadata attributes to packets")

Callers

nothing calls this directly

Calls 2

IsValidOffsetFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected