/*
 * Copyright 2018-present Open Networking Foundation

 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at

 * http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package core

import "gerrit.opencord.org/voltha-bbsim/common/logger"

type OmciMsg struct {
	IntfId uint32
	OnuId  uint32
	Pkt    []byte
}

func OmciRun(omciOut chan OmciMsg, omciIn chan OmciMsg) {
	for {
		msg := <-omciOut
		logger.Debug("OmciRun IF %v (ONU-ID: %v) pkt:%x.", msg.IntfId, msg.OnuId, msg.Pkt)
		omciIn <- msg
	}
}
