| 178 | } |
| 179 | |
| 180 | CommandResponse 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 | |
| 198 | template <SetMetadata::Mode mode> |
| 199 | inline void SetMetadata::DoProcessBatch(bess::PacketBatch *batch, |
nothing calls this directly
no test coverage detected