blob: 0e4a085707623edcb835387d9a8057a4cc12c8a9 [file] [log] [blame]
Zack Williams41513bf2018-07-07 20:08:35 -07001/*
2 * Copyright 2017-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 */
Stephane Barbarie35595062018-02-08 08:34:39 -050016package common
17
18import (
19 "github.com/opencord/voltha/protos/go/openflow_13"
20)
21
22type SortByPriority []*openflow_13.OfpFlowStats
23
24func (s SortByPriority) Len() int {
25 return len(s)
26}
27func (s SortByPriority) Swap(i, j int) {
28 s[i], s[j] = s[j], s[i]
29}
30func (s SortByPriority) Less(i, j int) bool {
31 return s[i].Priority < s[j].Priority
32}