public void CallbackAlert(MessageNetAlert netAlert, NetRateControllerState state)
 {
     //
     // Turn the network alert into an oktofs alert and post it to work item queue for dispatch to policy module.
     //
     //throw new NotImplementedException("OktofsRateController CallbackAlert should never get called.");
     MessageAlert mAlert = MessageAlert.CreateFromNetAlert(netAlert);
     Log(String.Format("netAlert {0}", netAlert));
     RcWorkItem rcWorkItem = new RcWorkItem(RcWorkItemType.Alert, mAlert, 0, null);
     RcWorkQueue.Enqueue(rcWorkItem);
 }
Exemple #2
0
 public static MessageAlert CreateFromNetAlert(MessageNetAlert netAlert)
 {
     MessageAlert msg = new MessageAlert();
     msg.Length = netAlert.Length;
     msg.SeqNo = netAlert.SeqNo;
     msg.MessageType = netAlert.MessageType;
     msg.netAlertVec= netAlert.AlertVec;
     msg.args = new ulong[8];
     msg.args[0] = netAlert.EthSrcAddr;
     msg.args[1] = netAlert.EthDestAddr;
     msg.args[2] = netAlert.IPv4SrcAddr;
     msg.args[3] = netAlert.IPv4DestAddr;
     msg.args[4] = netAlert.TenantId;
     msg.args[5] = netAlert.FlowId;
     msg.args[6] = netAlert.i_index;
     msg.args[7] = netAlert.j_index;
     return msg;
 }