Exemplo n.º 1
0
        public override void Logon(NetElementConfig netElementAddress)
        {
            MsgGtsm2GtsaLogonReq logonReq = new MsgGtsm2GtsaLogonReq()
            {
                u16LinkId         = NbLinkType.NB_DSAP_NO_OSP_DSP_PC_GTSA,
                u16Port           = NbLinkType.NB_IP_PORT_NO_OSP_DSP_PC_GTSA,
                u32TraceDspIpAddr = NetActHelper.inet_addr(netElementAddress.TraceIp),
                u8MacAddr         = NetActHelper.GetMacAddrByIp(netElementAddress.TraceIp),
                u8AgentSlot       = netElementAddress.AgentSlot,

                header =
                {
                    u8RemoteMode = GtsMsgType.CONNECT_DIRECT_MSG,
                    u16SourceID  = GtsMsgType.DEST_GTSM,
                    u16Opcode    = GtsMsgType.O_GTSMGTSA_LOGON_REQ,
                    u16DestID    = netElementAddress.Index
                }
            };

            logonReq.header.u16Length = logonReq.ContentLen;

            SendPackets(SerializeHelper.SerializeStructToBytes(logonReq), true);

            base.Logon(netElementAddress);
        }
Exemplo n.º 2
0
        public override void Logon(NetElementConfig netElementAddress)
        {
            //登录请求
            MsgGtsm2GtsaLogonReq logonReq = new MsgGtsm2GtsaLogonReq()
            {
                u16LinkId = NbLinkType.NB_DSAP_NO_OSP_DSP_PC_GTSA,
                u16Port   = NbLinkType.NB_IP_PORT_NO_OSP_DSP_PC_GTSA,
            };

            //建链请求
            MsgGtsm2GtsaAddFlowReq addFlowReq = new MsgGtsm2GtsaAddFlowReq()
            {
                u32IpType  = GtsMsgType.OM_GTS_IPV4,
                u16RackNo  = 0xff,
                u16ProcId  = 0xff,
                u16FrameNo = netElementAddress.FrameNo,
                u16SlotNo  = netElementAddress.SlotNo,

                header =
                {
                    u16Opcode = GtsMsgType.O_GTSMGTSA_ADDFLOW_REQ,
                }
            };

            //TODO 只有建链通过后才能发送登录请求。这里需要同步处理。
            //SendPackets(SerializeHelper.SerializeStructToBytes(addFlowReq));
        }