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

Method Init

core/modules/set_metadata.cc:180–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180CommandResponse SetMetadata::Init(const bess::pb::SetMetadataArg &arg) {
181 if (!arg.attrs_size()) {
182 return CommandFailure(EINVAL, "'attrs' must be specified");
183 }
184
185 for (int i = 0; i < arg.attrs_size(); i++) {
186 const auto &attr = arg.attrs(i);
187 CommandResponse err;
188
189 err = AddAttrOne(attr);
190 if (err.error().code() != 0) {
191 return err;
192 }
193 }
194
195 return CommandSuccess();
196}
197
198template <SetMetadata::Mode mode>
199inline void SetMetadata::DoProcessBatch(bess::PacketBatch *batch,

Callers

nothing calls this directly

Calls 2

CommandFailureFunction · 0.85
CommandSuccessFunction · 0.85

Tested by

no test coverage detected