blob: 5821361e45905bbed1417c98a78aa683bae8d46c [file] [log] [blame]
karthik1977bc5ea1e2023-01-02 19:25:14 +05301/*
2 * Copyright 2023-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.netflow;
18
19import org.onlab.packet.IPacket;
20import org.onlab.packet.DeserializationException;
21@FunctionalInterface
22public interface DataDeserializer<U extends IPacket> {
23
24 /**
25 * Deserialize a netflow data flowset packet object from a byte array.
26 *
27 * @param data input array to take packet bytes from
28 * @param offset index where this packet header begins in the byte array
29 * @param length length of the packet header
30 * @param template data template
31 * @return a deserialized packet object
32 * @throws DeserializationException if the packet cannot be deserialized
33 * from the input
34 */
35 U deserialize(byte[] data, int offset, int length, FlowRecord template) throws DeserializationException;
36}