def connectNetToMs(Facility_presence=0, ProgressIndicator_presence=0, ConnectedNumber_presence=0, ConnectedSubaddress_presence=0, UserUser_presence=0):
 a = TpPd(pd=3)
 b = MessageType(mesType=7)
 packet = (a / b)
 if (Facility_presence is 1):
  c = FacilityHdr(ieiF=28, eightBitF=0)
  packet = (packet / c)
 if (ProgressIndicator_presence is 1):
  d = ProgressIndicatorHdr(ieiPI=30, eightBitPI=0)
  packet = (packet / d)
 if (ConnectedNumber_presence is 1):
  e = ConnectedNumberHdr(ieiCN=76, eightBitCN=0)
  packet = (packet / e)
 if (ConnectedSubaddress_presence is 1):
  f = ConnectedSubaddressHdr(ieiCS=77, eightBitCS=0)
  packet = (packet / f)
 if (UserUser_presence is 1):
  g = UserUserHdr(ieiUU=127, eightBitUU=0)
  packet = (packet / g)
 return packet

def connectNetToMs ( Facility_presence = 0 , ProgressIndicator_presence = 0 , ConnectedNumber_presence = 0 , ConnectedSubaddress_presence = 0 , UserUser_presence = 0 ) : a = TpPd ( pd = 3 ) b = MessageType ( mesType = 7 ) packet = ( a / b ) if ( Facility_presence is 1 ) : c = FacilityHdr ( ieiF = 28 , eightBitF = 0 ) packet = ( packet / c ) if ( ProgressIndicator_presence is 1 ) : d = ProgressIndicatorHdr ( ieiPI = 30 , eightBitPI = 0 ) packet = ( packet / d ) if ( ConnectedNumber_presence is 1 ) : e = ConnectedNumberHdr ( ieiCN = 76 , eightBitCN = 0 ) packet = ( packet / e ) if ( ConnectedSubaddress_presence is 1 ) : f = ConnectedSubaddressHdr ( ieiCS = 77 , eightBitCS = 0 ) packet = ( packet / f ) if ( UserUser_presence is 1 ) : g = UserUserHdr ( ieiUU = 127 , eightBitUU = 0 ) packet = ( packet / g ) return packet
connect section 9 .