diff options
Diffstat (limited to 'sualibrary/sua/sua_database.cpp')
-rw-r--r-- | sualibrary/sua/sua_database.cpp | 165 |
1 files changed, 163 insertions, 2 deletions
diff --git a/sualibrary/sua/sua_database.cpp b/sualibrary/sua/sua_database.cpp index a8987b7..f636bbc 100644 --- a/sualibrary/sua/sua_database.cpp +++ b/sualibrary/sua/sua_database.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ /* - * $Id: sua_database.cpp,v 1.2 2003/01/16 15:07:56 p82609 Exp $ + * $Id: sua_database.cpp,v 1.5 2003/08/28 09:30:20 p82609 Exp $ * * SUA implementation according to SUA draft issue 6. * @@ -411,6 +411,29 @@ return(0); } /***********************************************************************/ +/* Sua_LocalList::found */ +/***********************************************************************/ +bool db_Sua_LocalList:: found( SS7union pc ){ + int i = 1; + bool found_pc = false; + + while (( i <= num_of_instance ) && (!found_pc)) + { + if (pc.ITU14.family == ITU14bit) // standard ITU: 14 bits + found_pc = ((pc.ITU14.pc == instance[i].Source.pc.ITU14.pc)); + else if (pc.ITU24.family == ITU24bit) // chinese PC length: 24 bits + found_pc = ((pc.ITU24.pc == instance[i].Source.pc.ITU24.pc)); + else if (pc.ANSI24.family == ANSI24bit) // ANSI PC length: 24 bits + found_pc = ((pc.ANSI24.pc == instance[i].Source.pc.ANSI24.pc)); + else + found_pc = false; + + i++; + } + return(found_pc); +} + +/***********************************************************************/ /* functions of the object class SUA Remote Object */ /***********************************************************************/ /***********************************************************************/ @@ -418,7 +441,7 @@ return(0); /***********************************************************************/ void db_Sua_RemoteObject::initialize(){ - ; + status = ssnm_unavailable; } /***********************************************************************/ @@ -461,6 +484,144 @@ void db_Sua_RemoteList:: increase_instance(){ }; /***********************************************************************/ +/* Sua_RemoteList::Dest_Available */ +/***********************************************************************/ +void db_Sua_RemoteList:: Dest_Available( SS7union pc) +{ + int i = 0; + bool found_pc = false; + + while (( i < num_of_instance ) && (!found_pc)) + { + i++; + if (pc.ITU14.family == ITU14bit) // standard ITU: 14 bits + found_pc = ((pc.ITU14.pc == instance[i].Dest.pc.ITU14.pc)); + else if (pc.ITU24.family == ITU24bit) // chinese PC length: 24 bits + found_pc = ((pc.ITU24.pc == instance[i].Dest.pc.ITU24.pc)); + else if (pc.ANSI24.family == ANSI24bit) // ANSI PC length: 24 bits + found_pc = ((pc.ANSI24.pc == instance[i].Dest.pc.ANSI24.pc)); + else + found_pc = false; + + }; + if (found_pc) + instance[i].status = ssnm_available; + +} + +/***********************************************************************/ +/* Sua_RemoteList::Dest_Unavailable */ +/***********************************************************************/ +void db_Sua_RemoteList:: Dest_Unavailable( SS7union pc) +{ + int i = 0; + bool found_pc = false; + + while (( i < num_of_instance ) && (!found_pc)) + { + i++; + if (pc.ITU14.family == ITU14bit) // standard ITU: 14 bits + found_pc = ((pc.ITU14.pc == instance[i].Dest.pc.ITU14.pc)); + else if (pc.ITU24.family == ITU24bit) // chinese PC length: 24 bits + found_pc = ((pc.ITU24.pc == instance[i].Dest.pc.ITU24.pc)); + else if (pc.ANSI24.family == ANSI24bit) // ANSI PC length: 24 bits + found_pc = ((pc.ANSI24.pc == instance[i].Dest.pc.ANSI24.pc)); + else + found_pc = false; + + }; + if (found_pc) + instance[i].status = ssnm_unavailable; +} + +/***********************************************************************/ +/* Sua_RemoteList::deactivate_dests */ +/***********************************************************************/ +void db_Sua_RemoteList:: Deactivate_dests( unsigned int sua_assoc_id) +{ + int i = 0; + + while (( i < num_of_instance )) + { + i++; + if (sua_assoc_id == instance[i].SUA_assoc_id) // found assoc_id + instance[i].status = ssnm_unavailable; + + } + +} + +/***********************************************************************/ +/* Sua_RemoteList::Activate_dests */ +/***********************************************************************/ +void db_Sua_RemoteList:: Activate_dests( unsigned int sua_assoc_id) +{ + int i = 0; + + while (( i < num_of_instance )) + { + i++; + if (sua_assoc_id == instance[i].SUA_assoc_id) // found assoc_id + instance[i].status = ssnm_available; + + } + +} +/***********************************************************************/ +/* Sua_RemoteList::get_Dest_status */ +/***********************************************************************/ +snm_Sua_pc_state_set db_Sua_RemoteList:: get_Dest_status( SS7union pc ) +{ + int i = 0; + bool found_pc = false; + + while (( i < num_of_instance ) && (!found_pc)) + { + i++; + if (pc.ITU14.family == ITU14bit) // standard ITU: 14 bits + found_pc = ((pc.ITU14.pc == instance[i].Dest.pc.ITU14.pc)); + else if (pc.ITU24.family == ITU24bit) // chinese PC length: 24 bits + found_pc = ((pc.ITU24.pc == instance[i].Dest.pc.ITU24.pc)); + else if (pc.ANSI24.family == ANSI24bit) // ANSI PC length: 24 bits + found_pc = ((pc.ANSI24.pc == instance[i].Dest.pc.ANSI24.pc)); + else + found_pc = false; + + } + if (found_pc) + return(instance[i].status); + else + return(ssnm_unavailable); + +} + +/***********************************************************************/ +/* Sua_RemoteList::found */ +/***********************************************************************/ +bool db_Sua_RemoteList:: found( SS7union pc ){ + int i = 0; + bool found_pc = false; + + while (( i < num_of_instance ) && (!found_pc)) + { + i++; + if (pc.ITU14.family == ITU14bit) // standard ITU: 14 bits + found_pc = ((pc.ITU14.pc == instance[i].Dest.pc.ITU14.pc)); + else if (pc.ITU24.family == ITU24bit) // chinese PC length: 24 bits + found_pc = ((pc.ITU24.pc == instance[i].Dest.pc.ITU24.pc)); + else if (pc.ANSI24.family == ANSI24bit) // ANSI PC length: 24 bits + found_pc = ((pc.ANSI24.pc == instance[i].Dest.pc.ANSI24.pc)); + else + found_pc = false; + + } + + return(found_pc); + +} + + +/***********************************************************************/ /* functions of the object class SUA Application Server Process (ASP) */ /***********************************************************************/ /***********************************************************************/ |