Ejemplo n.º 1
0
 internal virtual void Write(AAssociateRQ rq)
 {
     throw new SystemException();
 }
Ejemplo n.º 2
0
 public PduI Connect(AAssociateRQ rq, int timeout)
 {
     NDC.Push(name);
     try
     {
         fsm.Write(rq);
         return fsm.Read(timeout, b10);
     }
     finally
     {
         NDC.Pop();
     }
 }
Ejemplo n.º 3
0
 internal override void Write(AAssociateRQ rq)
 {
     try
     {
         rq.WriteTo(m_fsm.stream);
     }
     catch (IOException e)
     {
         m_fsm.ChangeState(m_fsm.STA1);
         throw e;
     }
     m_fsm.ChangeState(m_fsm.STA5);
 }
Ejemplo n.º 4
0
 public void Write(AAssociateRQ rq)
 {
     FireWrite(rq);
     try
     {
         lock( stream )
         {
             state.Write(rq);
         }
     }
     catch (IOException ioe)
     {
         if (assocListener != null)
             assocListener.Error(assoc, ioe);
         throw ioe;
     }
     this.rq = rq;
 }
Ejemplo n.º 5
0
 private void NegotiateRoleSelection(AAssociateRQ rq, AAssociateAC ac)
 {
     for ( IEnumerator enu= rq.ListRoleSelections().GetEnumerator(); enu.MoveNext(); )
         ac.AddRoleSelection(NegotiateRoleSelection((RoleSelection) enu.Current));
 }
Ejemplo n.º 6
0
 private void NegotiatePresCtx(AAssociateRQ rq, AAssociateAC ac)
 {
     for ( IEnumerator enu= rq.ListPresContext().GetEnumerator(); enu.MoveNext(); )
         ac.AddPresContext(NegotiatePresCtx((PresContext) enu.Current));
 }
Ejemplo n.º 7
0
 private void NegotiateExt(AAssociateRQ rq, AAssociateAC ac)
 {
     for ( IEnumerator enu= rq.ListExtNegotiations().GetEnumerator(); enu.MoveNext(); )
     {
         ExtNegotiation offered = (ExtNegotiation) enu.Current;
         String uid = offered.SOPClassUID;
         ExtNegotiatorI enp = GetExtNegPolicy(uid);
         if (enp != null)
             ac.AddExtNegotiation(new ExtNegotiation(uid, enp.Negotiate(offered.info())));
     }
 }
Ejemplo n.º 8
0
 private PduI doNegotiate(AAssociateRQ rq)
 {
     String appCtx = NegotiateAppCtx(rq.ApplicationContext);
     if (appCtx == null)
     {
         return new AAssociateRJ(AAssociateRJ.REJECTED_PERMANENT, AAssociateRJ.SERVICE_USER, AAssociateRJ.APPLICATION_CONTEXT_NAME_NOT_SUPPORTED);
     }
     AAssociateAC ac = new AAssociateAC();
     ac.ApplicationContext = appCtx;
     ac.CalledAET = rq.CalledAET;
     ac.CallingAET = rq.CallingAET;
     ac.MaxPduLength = this.maxLength;
     ac.ClassUID = this.ClassUID;
     ac.VersionName = this.Vers;
     ac.AsyncOpsWindow = NegotiateAOW(rq.AsyncOpsWindow);
     NegotiatePresCtx(rq, ac);
     NegotiateRoleSelection(rq, ac);
     NegotiateExt(rq, ac);
     return ac;
 }
Ejemplo n.º 9
0
        public virtual PduI Negotiate(AAssociateRQ rq)
        {
            if ((rq.ProtocolVersion & 0x0001) == 0)
            {
                return new AAssociateRJ(AAssociateRJ.REJECTED_PERMANENT, AAssociateRJ.SERVICE_PROVIDER_ACSE, AAssociateRJ.PROTOCOL_VERSION_NOT_SUPPORTED);
            }
            String calledAET = rq.CalledAET;
            if (calledAETs != null && !calledAETs.Contains(calledAET))
            {
                return new AAssociateRJ(AAssociateRJ.REJECTED_PERMANENT, AAssociateRJ.SERVICE_USER, AAssociateRJ.CALLED_AE_TITLE_NOT_RECOGNIZED);
            }
            AcceptorPolicy policy1 = (AcceptorPolicy) GetPolicyForCalledAET(calledAET);
            if (policy1 == null)
                policy1 = this;

            String callingAET = rq.CalledAET;
            if (policy1.callingAETs != null && !policy1.callingAETs.Contains(callingAET))
            {
                return new AAssociateRJ(AAssociateRJ.REJECTED_PERMANENT, AAssociateRJ.SERVICE_USER, AAssociateRJ.CALLING_AE_TITLE_NOT_RECOGNIZED);
            }
            AcceptorPolicy policy2 = (AcceptorPolicy) policy1.GetPolicyForCallingAET(callingAET);
            if (policy2 == null)
                policy2 = policy1;

            return policy2.doNegotiate(rq);
        }