trex_stateless_dp_core.cpp revision 3b827c95
1/*
2 Itay Marom
3 Cisco Systems, Inc.
4*/
5
6/*
7Copyright (c) 2015-2015 Cisco Systems, Inc.
8
9Licensed under the Apache License, Version 2.0 (the "License");
10you may not use this file except in compliance with the License.
11You may obtain a copy of the License at
12
13    http://www.apache.org/licenses/LICENSE-2.0
14
15Unless required by applicable law or agreed to in writing, software
16distributed under the License is distributed on an "AS IS" BASIS,
17WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18See the License for the specific language governing permissions and
19limitations under the License.
20*/
21
22#include <trex_stateless_dp_core.h>
23#include <stdio.h>
24#include <unistd.h>
25#include <trex_stateless.h>
26
27TrexStatelessDpCore::TrexStatelessDpCore(uint8_t core_id) : m_core_id(core_id) {
28}
29
30void
31TrexStatelessDpCore::run() {
32    printf("On DP core %d\n", m_core_id);
33    while (true) {
34        sleep(1);
35        TrexStateless::get_instance().get_port_by_id(0)->update_stats();
36    }
37}
38