VOL-1282 BBSim - Add reboot-related features

Change-Id: I9a1ce85eae18e42361956942aaf8d8fae0cc0802
diff --git a/device/device_olt.go b/device/device_olt.go
index a01dda1..b87bc53 100644
--- a/device/device_olt.go
+++ b/device/device_olt.go
@@ -26,7 +26,7 @@
 	SerialNumber       string
 	Manufacture        string
 	Name               string
-	InternalState      oltState
+	InternalState      *oltState
 	OperState          string
 	Intfs              []intf
 	HeartbeatSignature uint32
@@ -51,7 +51,8 @@
 	olt.NumPonIntf = npon
 	olt.NumNniIntf = nnni
 	olt.Name = "BBSIM OLT"
-	olt.InternalState = PRE_ENABLE
+	olt.InternalState = new(oltState)
+	*olt.InternalState = PRE_ENABLE
 	olt.OperState = "up"
 	olt.Intfs = make([]intf, olt.NumPonIntf+olt.NumNniIntf)
 	olt.HeartbeatSignature = oltid
@@ -67,3 +68,18 @@
 	}
 	return &olt
 }
+
+func (olt *Olt)InitializeStatus(){
+	*olt.InternalState = PRE_ENABLE
+	olt.OperState = "up"
+	for i := uint32(0); i < olt.NumNniIntf; i++ {
+		olt.Intfs[i].IntfID = i
+		olt.Intfs[i].OperState = "up"
+		olt.Intfs[i].Type = "nni"
+	}
+	for i := uint32(olt.NumNniIntf); i < olt.NumPonIntf+olt.NumNniIntf; i++ {
+		olt.Intfs[i].IntfID = i
+		olt.Intfs[i].OperState = "up"
+		olt.Intfs[i].Type = "pon"
+	}
+}
diff --git a/device/device_onu.go b/device/device_onu.go
index e7b7c0c..3448799 100644
--- a/device/device_onu.go
+++ b/device/device_onu.go
@@ -30,7 +30,7 @@
 )
 
 type Onu struct {
-	InternalState onuState
+	InternalState *onuState
 	IntfID        uint32
 	OperState     string
 	SerialNumber  *openolt.SerialNumber
@@ -46,7 +46,8 @@
 	onus := []*Onu{}
 	for i := 0; i < int(nonus); i++ {
 		onu := Onu{}
-		onu.InternalState = ONU_PRE_ACTIVATED
+		onu.InternalState = new(onuState)
+		*onu.InternalState = ONU_PRE_ACTIVATED
 		onu.IntfID = intfid
 		onu.OperState = "up"
 		onu.SerialNumber = new(openolt.SerialNumber)
@@ -57,6 +58,11 @@
 	return onus
 }
 
+func (onu *Onu) InitializeStatus(){
+	onu.OperState = "up"
+	*onu.InternalState = ONU_PRE_ACTIVATED
+}
+
 func ValidateONU(targetonu openolt.Onu, regonus map[uint32][]*Onu) bool {
 	for _, onus := range regonus {
 		for _, onu := range onus {