DEFINITION Vrai_660003147 1
DEFINITION Faux_660003147 0
DEFINITION MODULE_TRAIT_660003147 0x5000
DEFINITION ERR_SEM_660003147 0x040
DEFINITION ERR_CROISE_660003147 0x0F0
DEFINITION CPT_660003147 1507
DEFINITION EFFICACE_660003147 0x01
DEFINITION pt_FicNameGlob_LEN_660003147 255
REGISTRE ENTIER erreur_660003147
REGISTRE ENTIER code_rejet_660003147
REGISTRE ENTIER date_660003147
REGISTRE ENTIER indice_660003147
REGISTRE ENTIER IMSI_present_660003147
REGISTRE ENTIER Min_present_660003147
REGISTRE ENTIER NetworkType_present_660003147
REGISTRE ENTIER gprsNetworkType_present_660003147
REGISTRE ENTIER PartialTypIndic_present_660003147
REGISTRE ENTIER PdpType_present_660003147
REGISTRE ENTIER typeCtrlNode_present_660003147
REGISTRE ENTIER ic_useQosDelay_660003147
REGISTRE ENTIER ic_useQosMeanput_660003147
REGISTRE ENTIER ic_useQosPeakput_660003147
REGISTRE ENTIER ic_useQosPrecdnc_660003147
REGISTRE ENTIER ic_useQosReliabl_660003147
REGISTRE ENTIER ic_dataVolumeIN_660003147
REGISTRE ENTIER ic_dataVolumeOU_660003147
REGISTRE ENTIER ic_gprsUsageTime_660003147
REGISTRE ENTIER ic_RecEntType_660003147
REGISTRE ENTIER ic_RecEntId_660003147
REGISTRE ENTIER val_NetworkType_660003147
REGISTRE ENTIER val_gprsNetworkType_660003147
REGISTRE ENTIER val_PdpType_660003147
REGISTRE ENTIER val_typeCtrlNode_660003147
REGISTRE ENTIER val_RecEntType_660003147
REGISTRE ENTIER SGSNAddress_OK_660003147
REGISTRE ENTIER GGSNAddress_OK_660003147
REGISTRE ENTIER useQosDelay_OK_660003147
REGISTRE ENTIER useQosMeanput_OK_660003147
REGISTRE ENTIER useQosPeakput_OK_660003147
REGISTRE ENTIER useQosPrecdnc_OK_660003147
REGISTRE ENTIER useQosReliabl_OK_660003147
REGISTRE ENTIER dataVolumeIN_OK_660003147
REGISTRE ENTIER dataVolumeOU_OK_660003147
REGISTRE ENTIER gprsUsageTime_OK_660003147
REGISTRE ENTIER PREMIER_SGSNAddress_IPV6_660003147
REGISTRE ENTIER SGSNAddress_IPV6_660003147
REGISTRE ENTIER GGSNAddress_IPV6_660003147
REGISTRE ENTIER PDPAddress_IPV6_660003147
REGISTRE ENTIER CPT_X_660003147
REGISTRE ENTIER CPT_Z_660003147
REGISTRE ENTIER Nb_jourRedist_660003147
REGISTRE ENTIER dateOfRedisJ_660003147
REGISTRE ENTIER taille_660003147
REGISTRE ENTIER b_IMSI_OrangeCo_660003147
REGISTRE ENTIER date_cra_660003147
REGISTRE POINTEUR str_IMSI_660003147
REGISTRE POINTEUR str_PartialTypIndic_660003147
REGISTRE POINTEUR pt_NameOfFile_660003147
REGISTRE POINTEUR pt_NbJourRedist_660003147
REGISTRE POINTEUR pt_Address_660003147
REGISTRE POINTEUR pt_terme_660003147
REGISTRE POINTEUR pt_indice_660003147
REGISTRE POINTEUR pt_RecEntId_660003147
REGISTRE POINTEUR pt_ic_RecEntType_660003147
REGISTRE POINTEUR pt_ic_RecEntId_660003147
REGISTRE POINTEUR pt_ic_useQosDelay_660003147
REGISTRE POINTEUR pt_ic_useQosMeanput_660003147
REGISTRE POINTEUR pt_ic_useQosPeakput_660003147
REGISTRE POINTEUR pt_ic_useQosPrecdnc_660003147
REGISTRE POINTEUR pt_ic_useQosReliabl_660003147
REGISTRE POINTEUR pt_ic_dataVolumeIN_660003147
REGISTRE POINTEUR pt_ic_dataVolumeOU_660003147
REGISTRE POINTEUR pt_ic_gprsUsageTime_660003147
REGISTRE POINTEUR pt_resultat_660003147
REGISTRE POINTEUR pt_T4RecEntId1_660003147
REGISTRE POINTEUR pt_T4RecEntId_660003147
REGISTRE ENTIER Resultat_recherche_660003147
REGISTRE POINTEUR pt_FicNameTemp_660003147
REGISTRE POINTEUR pt_FicNameGlob_660003147
REGISTRE POINTEUR pt_LibelleAlarme_660003147
REGISTRE ENTIER IMSI_Transnational_M2M_660003147
REGISTRE POINTEUR pt_MCCMNCx_660003147
REGISTRE POINTEUR pt_IMSIy_660003147
REGISTRE POINTEUR str_conteneur_660003147
REGISTRE POINTEUR ptr_res_660003147
############################################################################################################
#  - Pcode du module de traitement Tcrae_gprs_trt.src : CRAE GPRS
#  - creation le 18/09/2006
#  - Auteur : SDX
#
#   HISTORIQUE
# 25/05/07 : FO 507, Reconstitution de l'adresse IPV4
# 11/01/11 - BEA - G3R1 lot4 Verification/Correction des variables (constantes, entiers, pointeurs)
# 17/08/11 - JLG - G3R4 lot3 QC852, CRAE enrichissement du libelle des alarmes par le nom du fichier collecte
# 04/05/12 - JLG - G3R7 Gestion du code MNC pour les MVNO lights
# 08/08/14 - JLG - G5R2 lot2 : Ajout variables fonctionnelles MCCMNCx, IMSIy, IMSI_Transnational_M2M, Ajout controle sur Imsi, Filtrage des IMSIs inconnus vers NVDDCH (au lieu de ECDDCH) si IMSI transnational
# 06/11/14 - JLG  - G5R2 : contournement core sur verbe pcode i_adequation_chaine_expreg (QC1441)
###########################################################################################################

##### Declaration Des Constantes #####

##### Declaration Des Variables #####




# G5R2lot2
#/G5R2lot2

##### Initialisation Des Variables #####

erreur_660003147 = 0
code_rejet_660003147 = 0
date_660003147 = 0
IMSI_present_660003147 = 0
Min_present_660003147 = 0
NetworkType_present_660003147 = 0
gprsNetworkType_present_660003147 = 0
PartialTypIndic_present_660003147 = 0
PdpType_present_660003147 = 0
typeCtrlNode_present_660003147 = 0
ic_useQosDelay_660003147 = 0
ic_useQosMeanput_660003147 = 0
ic_useQosPeakput_660003147 = 0
ic_useQosPrecdnc_660003147 = 0
ic_useQosReliabl_660003147 = 0
ic_dataVolumeIN_660003147 = 0
ic_dataVolumeOU_660003147 = 0
ic_gprsUsageTime_660003147 = 0
ic_RecEntType_660003147 = 0
ic_RecEntId_660003147 = 0
val_NetworkType_660003147 = 0
val_gprsNetworkType_660003147 = 0
val_PdpType_660003147 = 0
val_typeCtrlNode_660003147 = 0
val_RecEntType_660003147 = 0
SGSNAddress_OK_660003147 = 0
GGSNAddress_OK_660003147 = 0
PREMIER_SGSNAddress_IPV6_660003147 = 0
SGSNAddress_IPV6_660003147 = 0
GGSNAddress_IPV6_660003147 = 0
PDPAddress_IPV6_660003147 = 0
Nb_jourRedist_660003147 = 0

str_IMSI_660003147 = "IMSI012345678901"
i_strcpy(str_IMSI_660003147,"")
str_PartialTypIndic_660003147 = "PartialTypIndicZ"
i_strcpy(str_PartialTypIndic_660003147,"")
pt_NameOfFile_660003147="NameOfFile01234567801234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345"
i_strcpy(pt_NameOfFile_660003147,"")
pt_NbJourRedist_660003147="NbJourRedist345"
i_strcpy(pt_NbJourRedist_660003147,"")
pt_Address_660003147 = "Address01234567890123456789012345678901"
pt_terme_660003147 = "terme0123"
pt_indice_660003147 = "indice0123"
pt_RecEntId_660003147 = "RecEntId0123456789012345678901234567890"
pt_ic_RecEntType_660003147 = "RecEntType0123"
pt_ic_RecEntId_660003147 = "RecEntId012"
pt_ic_useQosDelay_660003147 = "useQosDelay1"
pt_ic_useQosMeanput_660003147 = "useQosMeanput1"
pt_ic_useQosPeakput_660003147 = "useQosPeakput1"
pt_ic_useQosPrecdnc_660003147 = "useQosPrecdnc1"
pt_ic_useQosReliabl_660003147 = "useQosReliabl1"
pt_ic_dataVolumeIN_660003147 = "dataVolumeIN1"
pt_ic_dataVolumeOU_660003147 = "dataVolumeOU1"
pt_ic_gprsUsageTime_660003147 = "gprsUsageTime1"
pt_resultat_660003147="0ipv4:ipv4"
i_strcpy(pt_resultat_660003147,"")
pt_T4RecEntId1_660003147="T4T28.XX"
i_strcpy(pt_T4RecEntId1_660003147,"")
pt_T4RecEntId_660003147="T4T28.XX_RecEnt"
i_strcpy(pt_T4RecEntId_660003147,"")

Resultat_recherche_660003147 = 0
pt_FicNameTemp_660003147="pt_NameOfTemp0123456789pt_NameOfTemp0123456789pt_NameOfTemp0123456789pt_NameOfTemp0123456789pt_NameOfTemp0123456789pt_NameOfTemp0123456789pt_NameOfTemp0123456789pt_NameOfTemp0123456789pt_NameOfTemp0123456789pt_NameOfTemp0123456789pt_NameOfTemp0123456789pt"
i_strcpy(pt_FicNameTemp_660003147,"")
pt_FicNameGlob_660003147="pt_NameOfGlob0123456789pt_NameOfGlob0123456789pt_NameOfGlob0123456789pt_NameOfGlob0123456789pt_NameOfGlob0123456789pt_NameOfGlob0123456789pt_NameOfGlob0123456789pt_NameOfGlob0123456789pt_NameOfGlob0123456789pt_NameOfGlob0123456789pt_NameOfGlob0123456789pt"
i_strcpy(pt_FicNameGlob_660003147,"")
pt_LibelleAlarme_660003147="pt_LibelleAlarme_111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
i_strcpy(pt_LibelleAlarme_660003147,"")

# G5R2lot2
IMSI_Transnational_M2M_660003147 = 0
pt_MCCMNCx_660003147 = "pt_MCCMNCx12"
i_strcpy(pt_MCCMNCx_660003147,"")
pt_IMSIy_660003147   = "pt_IMSIy1234"
i_strcpy(pt_IMSIy_660003147,"")
str_conteneur_660003147 = "str_conteneur123456789"
i_strcpy(str_conteneur_660003147,"")
ptr_res_660003147    = "ptr_res12345"
i_strcpy(ptr_res_660003147,"")
#/G5R2lot2




trace("**** Tcrae_gprs : Module de traitement : Debut ****")

# TT0033 plus de modification du g_iartin a cause de pd decoupe gros fichier
erreur_660003147 = i_dup_art_id(g_iartin , g_iartout12)
# /TT0033

# G3R4 lot3 QC852
SI (i_valid_field_n(g_iartin, $Tcrae_gprs::NameOfFile)&& i_valid_field_n(g_iartin, $Tcrae_gprs::DateOfRedistri))
ALORS
	erreur_660003147 = i_get_art_str(g_iartin, $Tcrae_gprs::NameOfFile, pt_NameOfFile_660003147)
SINON
	SI( pt_FicNameGlob_LEN_660003147 < i_strlen(g_isource) )
	ALORS
		trace("variable g_isource plus grande que pointeur de copie de g_isource.")
		code_rejet_660003147 = MODULE_TRAIT_660003147 + 0x0D0 + EFFICACE_660003147
		erreur_660003147 = i_PlvMessEmettre(8889, 2, g_iartout12, "", 2, code_rejet_660003147, "lg NameOfFile > 255", 0)
		SAUT STOCKE_ERRONE
	FINSI
	i_strcpy(pt_FicNameGlob_660003147, g_isource)
	POINT DEBUT_BOUCLE_FIC_NAME
	Resultat_recherche_660003147 = i_recupererValeur(pt_FicNameGlob_660003147, pt_FicNameTemp_660003147, 255, '/')
	SI( Resultat_recherche_660003147 == 0 )
	ALORS
		# On ne fait rien...
		# Le nom de fichier doit etre dans pt_FicNameTemp
		i_strcpy(pt_NameOfFile_660003147, pt_FicNameTemp_660003147)
		SAUT DEBUT_BOUCLE_FIC_NAME
	SINON
		# Le resultat a ete sauvegarde au coup precedent.
		trace("Fin boucle NameOfFile")
	FINSI
	# suppression des 9 derniers caracteres du g_isource (checksum)
	i_get_sub_str(pt_NameOfFile_660003147, 0, -10, pt_NameOfFile_660003147)
	SI (i_strlen(pt_NameOfFile_660003147) > 19)
	ALORS
		trace("**Tcrae_gprs, erreur : NameOfFile trop long **")
		code_rejet_660003147 = MODULE_TRAIT_660003147 + 0x0D0 + EFFICACE_660003147
		erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s=%s", "NameOfFile", pt_NameOfFile_660003147)
		erreur_660003147 = i_PlvMessEmettre(8889, 2, g_iartout12, "", 2, code_rejet_660003147, pt_LibelleAlarme_660003147, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI
# /G3R4 lot3 QC852

#
# OGA 507 Reconstitution de l'adresse IPV4
##########################################

###### Mise au format de l'adresse PdpAddress

SI(i_valid_field_n(g_iartin, $Tcrae_gprs::PdpAddress))
ALORS
	erreur_660003147 = i_get_field_str(g_iartin, "PdpAddress", pt_Address_660003147)
	SI (i_strlen(pt_Address_660003147) <9)
	ALORS
		erreur_660003147=Formatter_IPv4_780042427(pt_Address_660003147, pt_resultat_660003147)
		trace2("PDPAddress mise au format : <%s>", pt_resultat_660003147, 0)
# TT0033 plus de modification du g_iartin a cause de pb decoupe gros fichier
		erreur_660003147 = i_resize_tlv(g_iartout12,"T3t10_PdpAdrs","PdpAddress",9)
		erreur_660003147=i_memcpy_art_field(g_iartout12, "PdpAddress", pt_resultat_660003147, i_strlen(pt_resultat_660003147))
# /TT0033
	FINSI
FINSI

###### Mise au format de l'adresse remotePdpAddres

SI(i_valid_field_n(g_iartin, $Tcrae_gprs::remotePdpAddres))
ALORS
	erreur_660003147 = i_get_field_str(g_iartin, "remotePdpAddres", pt_Address_660003147)
	SI (i_strlen(pt_Address_660003147) <9)
	ALORS
		erreur_660003147=Formatter_IPv4_780042427(pt_Address_660003147, pt_resultat_660003147)
		trace2("remotePdpAddres mise au format : <%s>", pt_resultat_660003147, 0)
# TT0033 plus de modification du g_iartin a cause de pb decoupe gros fichier
		erreur_660003147 = i_resize_tlv(g_iartout12,"T3t25_rmtPdAdr","remotePdpAddres",9)
		erreur_660003147=i_memcpy_art_field(g_iartout12, "remotePdpAddres", pt_resultat_660003147, i_strlen(pt_resultat_660003147))
# /TT0033
	FINSI
FINSI

## FIN OGA 507
##### Controles Croises #####

IMSI_present_660003147 = i_valid_field_n(g_iartin, $Tcrae_gprs::IMSI)
Min_present_660003147  = i_valid_field_n(g_iartin, $Tcrae_gprs::Min)

# Si T3/IMSI et T3/Min sont absents => MSG 8883 et ERRONE
SI (!IMSI_present_660003147 && !Min_present_660003147)
ALORS
	trace("Absence des 2 champs IMSI et Min => ERRONE")
	code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_CROISE_660003147 + EFFICACE_660003147
	erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", "Min", pt_NameOfFile_660003147)
	erreur_660003147 = i_PlvMessEmettre(8883, 2, g_iartout12, "", 3, code_rejet_660003147, "IMSI", pt_LibelleAlarme_660003147)
	SAUT STOCKE_ERRONE
FINSI

# Si T3/IMSI et T3/Min sont presents => MSG 8884 et ERRONE
SI (IMSI_present_660003147 && Min_present_660003147)
ALORS
	trace("Presence des 2 champs IMSI et Min => ERRONE")
	code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_CROISE_660003147 + EFFICACE_660003147
	erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", "Min", pt_NameOfFile_660003147)
	erreur_660003147 = i_PlvMessEmettre(8884, 2, g_iartout12, "", 3, code_rejet_660003147, "IMSI", pt_LibelleAlarme_660003147)
	SAUT STOCKE_ERRONE
FINSI


##### Controles Semantiques #####

# G3R7 MVNO Light
date_cra_660003147 = i_get_art_field(g_iartin, $Tcrae_gprs::ddebut)



SI IMSI_present_660003147
ALORS
	# IMSI present
	erreur_660003147 = i_get_art_str(g_iartin,$Tcrae_gprs::IMSI, str_IMSI_660003147)
SINON
	# Min present
	erreur_660003147 = i_get_art_str(g_iartin,$Tcrae_gprs::Min, str_IMSI_660003147)
FINSI

# calcul de b_IMSI_OrangeCo
b_IMSI_OrangeCo_660003147 = 0
SI (i_strplcmp(str_IMSI_660003147, "20801", 0, 5) == 0) 
ALORS
	b_IMSI_OrangeCo_660003147 = 1
SINON
	SI (i_strplcmp(str_IMSI_660003147, "208", 0, 3) == 0) 
	ALORS
		i_get_sub_str(str_IMSI_660003147, 0, 4, pt_resultat_660003147)
		erreur_660003147 = i_format_str2(pt_terme_660003147, "%s%s", "L_", pt_resultat_660003147)
		SI (i_get_tab_field("MVNO", date_cra_660003147, pt_terme_660003147) != g_inull)
		ALORS
			b_IMSI_OrangeCo_660003147 = 1
		FINSI
	FINSI
FINSI

# G5R2 lot2
# calcul de pt_MCCMNCx, pt_IMSIy, IMSI_Transnational_M2M
i_get_sub_str(str_IMSI_660003147, 0, 5, pt_MCCMNCx_660003147)
i_get_sub_str(str_IMSI_660003147, 6, 6, pt_IMSIy_660003147)
erreur_660003147 = i_format_str2(str_conteneur_660003147, "%s%s", "M2M_", pt_MCCMNCx_660003147)
i_strcpy(ptr_res_660003147, i_get_tab_field("MVNO", date_cra_660003147, str_conteneur_660003147))
# equivallent a QC1441 : anomalie core de i_adequation_chaine_expreg
SI (i_strcmp(pt_IMSIy_660003147, "") != 0 && i_strcmp(ptr_res_660003147, "") != 0)
ALORS
  SI ( i_strcmp(ptr_res_660003147,"Tous") == 0 || i_adequation_chaine_expreg(ptr_res_660003147, pt_IMSIy_660003147) == 0)
  ALORS
    IMSI_Transnational_M2M_660003147 = Vrai_660003147
  SINON
    IMSI_Transnational_M2M_660003147 = Faux_660003147
  FINSI
SINON
  IMSI_Transnational_M2M_660003147 = Faux_660003147
FINSI
#/QC1441

# filtre des non transnationnaux et non orangeCo
SI (!b_IMSI_OrangeCo_660003147 && !IMSI_Transnational_M2M_660003147)
ALORS
		trace("Le champ IMSI ne commence pas par 208xx => ERRONE")
		code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
		erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", "IMSI", pt_NameOfFile_660003147)
		erreur_660003147 = i_PlvMessEmettre(8882, 2, g_iartout12, "", 2, code_rejet_660003147, pt_LibelleAlarme_660003147, 0)
		SAUT STOCKE_ERRONE
FINSI
#/G5R2 lot2


NetworkType_present_660003147 = i_valid_field_n(g_iartin, $Tcrae_gprs::NetworkType)
SI (!NetworkType_present_660003147)
ALORS
	trace("Le champ NetworkType est absent => ERRONE")
	code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
	erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", "NetworkType", pt_NameOfFile_660003147)
	erreur_660003147 = i_PlvMessEmettre(8886, 2, g_iartout12, "", 2, code_rejet_660003147, pt_LibelleAlarme_660003147, 0)
	SAUT STOCKE_ERRONE
SINON
	val_NetworkType_660003147 = i_get_art_field(g_iartin, $Tcrae_gprs::NetworkType)
	SI ( (val_NetworkType_660003147 != 0) && (val_NetworkType_660003147 != 1) && (val_NetworkType_660003147 != 2) )
	ALORS
		trace("Le champ NetworkType est different de 0, 1 et 2 => ERRONE")
		code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
		erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", "NetworkType", pt_NameOfFile_660003147)
		erreur_660003147 = i_PlvMessEmettre(8880, 2, g_iartout12, "", 3, code_rejet_660003147, val_NetworkType_660003147, pt_LibelleAlarme_660003147)
		SAUT STOCKE_ERRONE
	SINON
		SI (val_NetworkType_660003147 == 0)
		ALORS
			gprsNetworkType_present_660003147 = i_valid_field_n(g_iartin, $Tcrae_gprs::gprsNetworkType)
			SI (!gprsNetworkType_present_660003147)
			ALORS
				trace("Le champ NetworkType vaut 0 et le champ gprsNetworkType est absent => ERRONE")
				code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
				erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s%s", "f=", pt_NameOfFile_660003147)
				erreur_660003147 = i_PlvMessEmettre(8888, 2, g_iartout12, "", 2, code_rejet_660003147, pt_LibelleAlarme_660003147, 0)
				SAUT STOCKE_ERRONE
			SINON
				val_gprsNetworkType_660003147 = i_get_art_field(g_iartin, $Tcrae_gprs::gprsNetworkType)
				SI ( (val_gprsNetworkType_660003147 != 1) && (val_gprsNetworkType_660003147 != 2) )
				ALORS
					trace("Le champ NetworkType vaut 0 et le champ gprsNetworkType est different de 1 et 2 => ERRONE")
					code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
					erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s%s", "f=", pt_NameOfFile_660003147)
					erreur_660003147 = i_PlvMessEmettre(8887, 2, g_iartout12, "", 3, code_rejet_660003147, val_gprsNetworkType_660003147, pt_LibelleAlarme_660003147)
					SAUT STOCKE_ERRONE
				FINSI
			FINSI
		FINSI
	FINSI
FINSI


# Si T3/PdpType est absent ou est <> de "1" ou "2" => ERRONE

PdpType_present_660003147 = i_valid_field_n(g_iartin, $Tcrae_gprs::PdpType)
SI (!PdpType_present_660003147)
ALORS
	trace("Le champ PdpType est absent => ERRONE")
	code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
	erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", "PdpType", pt_NameOfFile_660003147)
	erreur_660003147 = i_PlvMessEmettre(8886, 2, g_iartout12, "", 2, code_rejet_660003147, pt_LibelleAlarme_660003147, 0)
	SAUT STOCKE_ERRONE
SINON
	val_PdpType_660003147 = i_get_art_field(g_iartin, $Tcrae_gprs::PdpType)
	SI ( (val_PdpType_660003147 != 1) && (val_PdpType_660003147 != 2) )
	ALORS
		trace("Le champ PdpType est different de 1 et 2 => ERRONE")
		code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
		erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", "PdpType", pt_NameOfFile_660003147)
		erreur_660003147 = i_PlvMessEmettre(8880, 2, g_iartout12, "", 3, code_rejet_660003147, val_PdpType_660003147, pt_LibelleAlarme_660003147)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

# Si T3/PDPAddress n est pas une Adresse IPV4 ou IPV6 => ERRONE
SI(i_valid_field_n(g_iartin, $Tcrae_gprs::PdpAddress))
ALORS
	erreur_660003147 = i_get_field_str(g_iartin, "PdpAddress", pt_Address_660003147)
	erreur_660003147 = i_recupererValeur(pt_Address_660003147, pt_terme_660003147, 4, ':')
	SI (i_strlen(pt_Address_660003147) != 0)
	ALORS
		erreur_660003147 = i_recupererValeur(pt_Address_660003147, pt_terme_660003147, 4, ':')
		SI (i_strlen(pt_Address_660003147) != 0)
		ALORS
			trace("Le champ PDPAddress contient une addresse IPV6")
			PDPAddress_IPV6_660003147 = 1
		SINON
			trace("Le champ PdpAddress contient une address IPV4")
		FINSI
	SINON
		trace("Le champ PDPAddress n est pas une Adresse IPV4 ou IPV6 => ERRONE")
		code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
		erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", "PdpAddress", pt_NameOfFile_660003147)
		erreur_660003147 = i_PlvMessEmettre(8895, 2, g_iartout12, "", 2, code_rejet_660003147, pt_LibelleAlarme_660003147, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI



indice_660003147 = 1

POINT SGSN_GGSN

SI ( indice_660003147 < 10)
ALORS
	erreur_660003147 = i_EntierToString(indice_660003147, pt_indice_660003147, 1)
SINON
	erreur_660003147 = i_EntierToString(indice_660003147, pt_indice_660003147, 2)
FINSI

erreur_660003147 = i_format_str2(pt_ic_RecEntType_660003147, "%s%s", "RecEntType", pt_indice_660003147)
erreur_660003147 = i_format_str2(pt_ic_RecEntId_660003147, "%s%s", "RecEntId", pt_indice_660003147)
erreur_660003147 = i_format_str2(pt_T4RecEntId1_660003147 ,"%s.%s", "T4t28",pt_indice_660003147)
erreur_660003147 = i_format_str2(pt_T4RecEntId_660003147 ,"%s_%s", pt_T4RecEntId1_660003147,"RecEn")

ic_RecEntType_660003147 = i_get_field_num(g_iartin, pt_ic_RecEntType_660003147)
ic_RecEntId_660003147 = i_get_field_num(g_iartin, pt_ic_RecEntId_660003147)

SI ( (ic_RecEntType_660003147 == -1) || (ic_RecEntId_660003147 == -1) )
ALORS
	SAUT FIN_SGSN_GGSN
FINSI

SI ( (i_valid_field_n(g_iartin, ic_RecEntType_660003147)) && (i_valid_field_n(g_iartin, ic_RecEntId_660003147)) )
ALORS
	val_RecEntType_660003147 = i_get_art_field(g_iartin, ic_RecEntType_660003147)
	erreur_660003147 = i_get_field_str(g_iartin, pt_ic_RecEntId_660003147, pt_RecEntId_660003147)
	## OGA 507 Sauvegarde de pt_RecEntId dans pt_Address
	i_strcpy(pt_Address_660003147,pt_RecEntId_660003147)
	trace1("val_RecEntType : %d", val_RecEntType_660003147)
	SI (val_RecEntType_660003147 == 4)
	ALORS
		erreur_660003147 = i_recupererValeur(pt_RecEntId_660003147, pt_terme_660003147, 4, ':')
		SI (i_strlen(pt_RecEntId_660003147) != 0)
		ALORS
			erreur_660003147 = i_recupererValeur(pt_RecEntId_660003147, pt_terme_660003147, 4, ':')
			SI (i_strlen(pt_RecEntId_660003147) != 0)
			ALORS
				SI (SGSNAddress_OK_660003147 == 0)
				ALORS
					SGSNAddress_OK_660003147 = 1
					PREMIER_SGSNAddress_IPV6_660003147 = indice_660003147
				SINON
					SGSNAddress_IPV6_660003147 = SGSNAddress_IPV6_660003147 + 1
				FINSI
				trace2("le champ <%s> contient une address SGSN IPV6", pt_ic_RecEntId_660003147, 0)
			SINON
				SI (SGSNAddress_OK_660003147 == 0)
				ALORS
					SGSNAddress_OK_660003147 = 1
					trace("IPV4 pour la premiere address SGSN")
				FINSI

				## OGA 507

				SI(i_strlen(pt_Address_660003147)<9)
				ALORS
					erreur_660003147=Formatter_IPv4_780042427(pt_Address_660003147, pt_resultat_660003147)
					trace2("RecEntity Information mise au format:<%s>", pt_resultat_660003147, 0)
# TT0033 plus de modification du g_iartin a cause de pb decoupe gros fichier
					erreur_660003147=i_resize_tlv(g_iartout12, pt_T4RecEntId_660003147, pt_ic_RecEntId_660003147, 9)
					erreur_660003147=i_memcpy_art_field(g_iartout12, pt_ic_RecEntId_660003147, pt_resultat_660003147, 9)
# /TT0033
				FINSI
				## FIN OGA 507
			FINSI
		SINON
			trace2("Le champ %s n est pas une Adresse IPV4 ou IPV6 => ERRONE",pt_ic_RecEntId_660003147,"")
			code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
			erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", pt_ic_RecEntId_660003147, pt_NameOfFile_660003147)
			erreur_660003147 = i_PlvMessEmettre(8895, 2, g_iartout12, "", 2, code_rejet_660003147, pt_LibelleAlarme_660003147, 0)
			SAUT STOCKE_ERRONE
		FINSI
	SINON
		SI (val_RecEntType_660003147 == 3)
		ALORS
			erreur_660003147 = i_recupererValeur(pt_RecEntId_660003147, pt_terme_660003147, 4, ':')
			SI (i_strlen(pt_RecEntId_660003147) != 0)
			ALORS
				erreur_660003147 = i_recupererValeur(pt_RecEntId_660003147, pt_terme_660003147, 4, ':')
				SI (i_strlen(pt_RecEntId_660003147) != 0)
				ALORS
					SI (GGSNAddress_OK_660003147 == 0)
					ALORS
						GGSNAddress_OK_660003147 = 1
						GGSNAddress_IPV6_660003147 = 1
					FINSI
					trace2("le champ <%s> contient une address GGSN IPV6", pt_ic_RecEntId_660003147, 0)
				SINON
					SI (GGSNAddress_OK_660003147 == 0)
					ALORS
						GGSNAddress_OK_660003147 = 1
						trace("IPV4 pour la premiere address GGSN")
					FINSI

					## OGA 507
					SI(i_strlen(pt_Address_660003147)<9)
					ALORS
						erreur_660003147=Formatter_IPv4_780042427(pt_Address_660003147, pt_resultat_660003147)
						trace2("RecEntity Information mise au format:<%s>", pt_resultat_660003147, 0)
# TT0033 plus de modification du g_iartin a cause de pb decoupe gros fichier
						erreur_660003147=i_resize_tlv(g_iartout12, pt_T4RecEntId_660003147, pt_ic_RecEntId_660003147, 9)
						erreur_660003147=i_memcpy_art_field(g_iartout12, pt_ic_RecEntId_660003147, pt_resultat_660003147, 9)
# TT0033
					FINSI
					## FIN OGA 507
				FINSI
			SINON
				trace2("Le champ %s n est pas une Adresse IPV4 ou IPV6 => ERRONE",pt_ic_RecEntId_660003147,"")
				code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
				erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", pt_ic_RecEntId_660003147, pt_NameOfFile_660003147)
				erreur_660003147 = i_PlvMessEmettre(8895, 2, g_iartout12, "", 2, code_rejet_660003147, pt_LibelleAlarme_660003147, 0)
				SAUT STOCKE_ERRONE
			FINSI
		FINSI
	FINSI
SINON
	SAUT FIN_SGSN_GGSN
FINSI

SI (indice_660003147 < 10)
ALORS
	indice_660003147 = indice_660003147 + 1
	SAUT SGSN_GGSN
FINSI

POINT FIN_SGSN_GGSN

# SI le Type 86 est cr?e, on controle le champ remotePdpAddres
# pour verifier qu il contient bien une adresse IPV4 ou IPV6
SI (SGSNAddress_IPV6_660003147 != 0)
ALORS
	SI(i_valid_field_n(g_iartin, $Tcrae_gprs::remotePdpAddres))
	ALORS
		erreur_660003147 = i_get_field_str(g_iartin, "remotePdpAddres", pt_Address_660003147)
		erreur_660003147 = i_recupererValeur(pt_Address_660003147, pt_terme_660003147, 4, ':')
		SI (i_strlen(pt_Address_660003147) == 0)
		ALORS
			trace("Le champ remotePdpAddres n est pas une Adresse IPV4 ou IPV6 => ERRONE")
			code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
			erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", "remotePdpAddres", pt_NameOfFile_660003147)
			erreur_660003147 = i_PlvMessEmettre(8895, 2, g_iartout12, "", 2, code_rejet_660003147, pt_LibelleAlarme_660003147, 0)
			SAUT STOCKE_ERRONE
		FINSI
	FINSI
FINSI

# Si T3/TypeOfControl est absent ou est <> de "0", "1" ou "2" => ERRONE

typeCtrlNode_present_660003147 = i_valid_field_n(g_iartin, $Tcrae_gprs::typeCtrlNode)
SI (!typeCtrlNode_present_660003147)
ALORS
	trace("Le champ typeCtrlNode est absent => ERRONE")
	code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
	erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", "typeCtrlNode", pt_NameOfFile_660003147)
	erreur_660003147 = i_PlvMessEmettre(8886, 2, g_iartin, "", 2, code_rejet_660003147, pt_LibelleAlarme_660003147, 0)
	SAUT STOCKE_ERRONE
SINON
	val_typeCtrlNode_660003147 = i_get_art_field(g_iartin, $Tcrae_gprs::typeCtrlNode)
	SI ( (val_typeCtrlNode_660003147 != 0) && (val_typeCtrlNode_660003147 != 1) && (val_typeCtrlNode_660003147 != 2) )
	ALORS
		trace("Le champ typeCtrlNode est different de 0, 1 et 2 => ERRONE")
		code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
		erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", "typeCtrlNode", pt_NameOfFile_660003147)
		erreur_660003147 = i_PlvMessEmettre(8880, 2, g_iartout12, "", 3, code_rejet_660003147, val_typeCtrlNode_660003147, pt_LibelleAlarme_660003147)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

# Si T3/PartialTypIndic a une valeur differente de "F", "I" et "L" => ERRONE
PartialTypIndic_present_660003147 = i_valid_field_n(g_iartin, $Tcrae_gprs::PartialTypIndic)
SI (PartialTypIndic_present_660003147)
ALORS
	erreur_660003147 = i_get_field_str(g_iartin, "PartialTypIndic", str_PartialTypIndic_660003147)
	SI ((i_strplcmp(str_PartialTypIndic_660003147, "F", 0, 1) != 0) &&
		(i_strplcmp(str_PartialTypIndic_660003147, "I", 0, 1) != 0) &&
		(i_strplcmp(str_PartialTypIndic_660003147, "L", 0, 1) != 0) )
	ALORS
		trace("Le champ PartialTypIndic est different de F, I et L => ERRONE")
		code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
		erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", "PartialTypIndic", pt_NameOfFile_660003147)
		erreur_660003147 = i_PlvMessEmettre(8885, 2, g_iartout12, "", 3, code_rejet_660003147, str_PartialTypIndic_660003147, pt_LibelleAlarme_660003147)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

##### Mise a jour du champ T3t1/NameOfFile #####

# Pour les articles provenant de la redistribution

SI (i_valid_field_n(g_iartin, $Tcrae_gprs::NameOfFile)&& i_valid_field_n(g_iartin, $Tcrae_gprs::DateOfRedistri))
ALORS
	trace("**Tcrae_gprs , article issu de la redistribution**")
#	erreur  = i_get_field_str(g_iartin ,"NameOfFile",pt_NameOfFile ) : fait en debut pcode
	dateOfRedisJ_660003147 = i_sdat_to_jdat(i_get_art_field(g_iartin, $Tcrae_gprs::DateOfRedistri))
	trace1("datej %x", dateOfRedisJ_660003147)
	Nb_jourRedist_660003147 = i_cur_date()- dateOfRedisJ_660003147
	trace1("cur_date %x ",i_cur_date())
	trace1("Nb_jourRedist est %x ",Nb_jourRedist_660003147)
	erreur_660003147  = i_EntierToString(Nb_jourRedist_660003147 , pt_NbJourRedist_660003147 , 4)
	erreur_660003147 =i_format_str2(pt_NameOfFile_660003147 , "%s.%s" ,pt_NameOfFile_660003147  , pt_NbJourRedist_660003147 )
	trace2("Tcrae_gprs , mis a jour <NameOfFile> par :<%s>", pt_NameOfFile_660003147 , 0)
	SI (i_strlen(pt_NameOfFile_660003147) > g_iartin.NameOfFile!TAILLE)
	ALORS
		taille_660003147 = g_iartin.NameOfFile!TAILLE
	SINON
		taille_660003147 = i_strlen(pt_NameOfFile_660003147)
	FINSI
# TT0033 plus de modification du g_iartin a cause de pb decoupe gros fichier
	erreur_660003147 = i_resize_tlv(g_iartout, "T3t1_NameOfFile", "NameOfFile", taille_660003147)
	erreur_660003147  = i_memcpy_art_field(g_iartout, "NameOfFile",pt_NameOfFile_660003147 , taille_660003147)
# /TT0033
	erreur_660003147  = i_get_field_str(g_iartin ,"NameOfFile",pt_NameOfFile_660003147 )
	trace2("Tcrae_gprs , <NameOfFile> :<%s>", pt_NameOfFile_660003147 , 0)
SINON
# Pour les articles provenant du convertisseur CRAE
# TT0033 plus de modification du g_iartin a cause de pb decoupe gros fichier
	erreur_660003147 = i_ajout_tlv(g_iartout12, "T3t1_NameOfFile" , "")
	erreur_660003147 = i_resize_tlv(g_iartout12, "T3t1_NameOfFile" , "NameOfFile", 17)
# /TT0033
	SI(erreur_660003147!=0)
	ALORS
		trace("Tcrae_gprs : Impossible d ajouter le champ <NameOfFile>")
		code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
		erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", "NameOfFile", pt_NameOfFile_660003147)
		erreur_660003147 = i_PlvMessEmettre(8889, 2, g_iartout12, "", 2, code_rejet_660003147, pt_LibelleAlarme_660003147, 0)
		SAUT STOCKE_ERRONE
	FINSI
# TT0033 plus de modification du g_iartin a cause de pb decoupe gros fichier
	erreur_660003147 = i_resize_tlv(g_iartout12, "T3t1_NameOfFile" , "NbRedist" ,2)
# /TT0033
	SI(erreur_660003147!=0)
	ALORS
		trace("Tcrae_gprs, erreur d ajout du champ <NbRedist>**")
		erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s> <f=%s", "NbRedist", pt_NameOfFile_660003147)
		erreur_660003147 = i_PlvMessEmettre(8889, 2, g_iartout12, "", 2, code_rejet_660003147, pt_LibelleAlarme_660003147, 0)
		code_rejet_660003147 = MODULE_TRAIT_660003147 + ERR_SEM_660003147 + EFFICACE_660003147
		SAUT STOCKE_ERRONE
	FINSI
# OGA 488
# TT0033 plus de modification du g_iartin a cause de pb decoupe gros fichier
	erreur_660003147 = i_memcpy_art_field(g_iartout12, "NameOfFile",pt_NameOfFile_660003147, i_strlen(pt_NameOfFile_660003147))
# /TT0033
# /OGA 488
FINSI


trace("")
trace("**** Tcrae_gprs : Module de traitement : Fin ****")


##############################################################################
# Mise a jour du compteur applicatif <Type de CRAE/EEC/Jour> :1507	     #
##############################################################################

trace("**** MAJ du compteur 1507 ****")

CPT_X_660003147 = 80
CPT_Z_660003147  = 0
trace("**** MAJ du compteur 1507 pour le type 80 ****")
date_660003147  = i_DHgetLocalTime(4, 7, i_date_audit())
erreur_660003147=i_incr_cpt(CPT_660003147,CPT_X_660003147,g_ieec,CPT_Z_660003147,date_660003147,1)
SI(erreur_660003147 !=0)
ALORS
	trace("**Tcrae_gprs, erreur de mise a jour du compteur 1507 pour le type 80 **")
	code_rejet_660003147  = MODULE_TRAIT_660003147  + ERR_SEM_660003147  + EFFICACE_660003147
	erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s%s", "f=", pt_NameOfFile_660003147)
	erreur_660003147 = i_PlvMessEmettre(8890, 2, g_iartout12, "", 3, code_rejet_660003147, 1507, pt_LibelleAlarme_660003147)
	SAUT STOCKE_ERRONE
FINSI

SI( ( i_valid_field_n(g_iartin, $Tcrae_gprs::acesPointNamNI) ) ||
	( i_valid_field_n(g_iartin, $Tcrae_gprs::acesPointNameOI) ) ||
	( i_valid_field_n(g_iartin, $Tcrae_gprs::IMEI) ) )
ALORS
	trace("**** MAJ du compteur 1507 pour le type 82 ****")
	CPT_X_660003147 = 82
	CPT_Z_660003147  = 0
	date_660003147  = i_DHgetLocalTime(4, 7, i_date_audit())
	erreur_660003147=i_incr_cpt(CPT_660003147,CPT_X_660003147,g_ieec,CPT_Z_660003147,date_660003147,1)
	SI(erreur_660003147 !=0)
	ALORS
		trace("**Tcrae_gprs, erreur de mise a jour du compteur 1507 pour le type 82 **")
		code_rejet_660003147  = MODULE_TRAIT_660003147  + ERR_SEM_660003147  + EFFICACE_660003147
		erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s%s", "f=", pt_NameOfFile_660003147)
		erreur_660003147 = i_PlvMessEmettre(8890, 2, g_iartout12, "", 3, code_rejet_660003147, 1507, pt_LibelleAlarme_660003147)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

# Le compteur 1507 est a incrementer pour le type 84 :
# Si le champ PDPAddress est present et correspond a une adresse IPV6
# Ou Si dans T3/ RecEntityInfoList la premiere SGSN_ADDRESS est une adresse IPV6
# Ou Si dans T3/ RecEntityInfoList la premiere GGSN_ADDRESS est une adresse IPV6

SI ( (PREMIER_SGSNAddress_IPV6_660003147 != 0) || (GGSNAddress_IPV6_660003147 == 1) || (PDPAddress_IPV6_660003147 == 1) )
ALORS
	trace("**** MAJ du compteur 1507 pour le type 84 ****")
	CPT_X_660003147 = 84
	CPT_Z_660003147  = 0
	date_660003147  = i_DHgetLocalTime(4, 7, i_date_audit())
	erreur_660003147=i_incr_cpt(CPT_660003147,CPT_X_660003147,g_ieec,CPT_Z_660003147,date_660003147,1)
	SI(erreur_660003147 !=0)
	ALORS
		trace("** Tcrae_gprs, erreur de mise a jour du compteur 1507 pour le type 84 **")
		code_rejet_660003147  = MODULE_TRAIT_660003147  + ERR_SEM_660003147  + EFFICACE_660003147
		erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s%s", "f=", pt_NameOfFile_660003147)
		erreur_660003147 = i_PlvMessEmettre(8890, 2, g_iartout12, "", 3, code_rejet_660003147, 1507, pt_LibelleAlarme_660003147)
		SAUT STOCKE_ERRONE
	FINSI
FINSI


SI (SGSNAddress_IPV6_660003147 != 0)
ALORS
	CPT_X_660003147 = 86
	CPT_Z_660003147  = 0
	date_660003147  = i_DHgetLocalTime(4, 7, i_date_audit())

	SI ( SGSNAddress_IPV6_660003147 <= 2)
	ALORS
		trace("**** MAJ du compteur 1507 pour le type 86 : +1  ****")
		erreur_660003147=i_incr_cpt(CPT_660003147,CPT_X_660003147,g_ieec,CPT_Z_660003147,date_660003147,1)
	SINON
		SI ( SGSNAddress_IPV6_660003147 <= 4)
		ALORS
			trace("**** MAJ du compteur 1507 pour le type 86 : +2  ****")
			erreur_660003147=i_incr_cpt(CPT_660003147,CPT_X_660003147,g_ieec,CPT_Z_660003147,date_660003147,2)
		SINON
			SI ( SGSNAddress_IPV6_660003147 <= 6)
			ALORS
				trace("**** MAJ du compteur 1507 pour le type 86 : +3  ****")
				erreur_660003147=i_incr_cpt(CPT_660003147,CPT_X_660003147,g_ieec,CPT_Z_660003147,date_660003147,3)
			SINON
				trace("**** MAJ du compteur 1507 pour le type 86 : +4  ****")
				erreur_660003147=i_incr_cpt(CPT_660003147,CPT_X_660003147,g_ieec,CPT_Z_660003147,date_660003147,4)
			FINSI
		FINSI
	FINSI

	SI(erreur_660003147 !=0)
	ALORS
		trace("** Tcrae_gprs, erreur de mise a jour du compteur 1507 pour le type 86 **")
		code_rejet_660003147  = MODULE_TRAIT_660003147  + ERR_SEM_660003147  + EFFICACE_660003147
		erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s%s", "f=", pt_NameOfFile_660003147)
		erreur_660003147 = i_PlvMessEmettre(8890, 2, g_iartin, "", 3, code_rejet_660003147, 1507, pt_LibelleAlarme_660003147)
		SAUT STOCKE_ERRONE
	FINSI
FINSI


indice_660003147 = 1

POINT CPT_TYPE88

useQosDelay_OK_660003147 = 0
useQosMeanput_OK_660003147 = 0
useQosPeakput_OK_660003147 = 0
useQosPrecdnc_OK_660003147 = 0
useQosReliabl_OK_660003147 = 0
dataVolumeIN_OK_660003147 = 0
dataVolumeOU_OK_660003147 = 0
gprsUsageTime_OK_660003147 = 0

erreur_660003147 = i_EntierToString(indice_660003147, pt_indice_660003147, 1)

erreur_660003147 = i_format_str2(pt_ic_useQosDelay_660003147, "%s%s", "useQosDelay", pt_indice_660003147)
ic_useQosDelay_660003147 = i_get_field_num(g_iartin, pt_ic_useQosDelay_660003147)
SI ( ic_useQosDelay_660003147 != -1)
ALORS
	SI ( i_valid_field_n(g_iartin, ic_useQosDelay_660003147) )
	ALORS
		useQosDelay_OK_660003147 = 1
	FINSI
FINSI

erreur_660003147 = i_format_str2(pt_ic_useQosMeanput_660003147, "%s%s", "useQosMeanput", pt_indice_660003147)
ic_useQosMeanput_660003147 = i_get_field_num(g_iartin, pt_ic_useQosMeanput_660003147)
SI ( ic_useQosMeanput_660003147 != -1)
ALORS
	SI ( i_valid_field_n(g_iartin, ic_useQosMeanput_660003147) )
	ALORS
		useQosMeanput_OK_660003147 = 1
	FINSI
FINSI

erreur_660003147 = i_format_str2(pt_ic_useQosPeakput_660003147, "%s%s", "useQosPeakput", pt_indice_660003147)
ic_useQosPeakput_660003147 = i_get_field_num(g_iartin, pt_ic_useQosPeakput_660003147)
SI ( ic_useQosPeakput_660003147 != -1)
ALORS
	SI ( i_valid_field_n(g_iartin, ic_useQosPeakput_660003147) )
	ALORS
		useQosPeakput_OK_660003147 = 1
	FINSI
FINSI

erreur_660003147 = i_format_str2(pt_ic_useQosPrecdnc_660003147, "%s%s", "useQosPrecdnc", pt_indice_660003147)
ic_useQosPrecdnc_660003147 = i_get_field_num(g_iartin, pt_ic_useQosPrecdnc_660003147)
SI ( ic_useQosPrecdnc_660003147 != -1 )
ALORS
	SI ( i_valid_field_n(g_iartin, ic_useQosPrecdnc_660003147) )
	ALORS
		useQosPrecdnc_OK_660003147 = 1
	FINSI
FINSI

erreur_660003147 = i_format_str2(pt_ic_useQosReliabl_660003147, "%s%s", "useQosReliabl", pt_indice_660003147)
ic_useQosReliabl_660003147 = i_get_field_num(g_iartin, pt_ic_useQosReliabl_660003147)
SI ( ic_useQosReliabl_660003147 != -1 )
ALORS
	SI ( i_valid_field_n(g_iartin, ic_useQosReliabl_660003147) )
	ALORS
		useQosReliabl_OK_660003147 = 1
	FINSI
FINSI

erreur_660003147 = i_format_str2(pt_ic_dataVolumeIN_660003147, "%s%s", "dataVolumeIN", pt_indice_660003147)
ic_dataVolumeIN_660003147 = i_get_field_num(g_iartin, pt_ic_dataVolumeIN_660003147)
SI ( ic_dataVolumeIN_660003147 != -1)
ALORS
	SI ( i_valid_field_n(g_iartin, ic_dataVolumeIN_660003147) )
	ALORS
		dataVolumeIN_OK_660003147 = 1
	FINSI
FINSI

erreur_660003147 = i_format_str2(pt_ic_dataVolumeOU_660003147, "%s%s", "dataVolumeOU", pt_indice_660003147)
ic_dataVolumeOU_660003147 = i_get_field_num(g_iartin, pt_ic_dataVolumeOU_660003147)
SI ( ic_dataVolumeOU_660003147 != -1)
ALORS
	SI ( i_valid_field_n(g_iartin, ic_dataVolumeOU_660003147) )
	ALORS
		dataVolumeOU_OK_660003147 = 1
	FINSI
FINSI

erreur_660003147 = i_format_str2(pt_ic_gprsUsageTime_660003147, "%s%s", "gprsUsageTime", pt_indice_660003147)
ic_gprsUsageTime_660003147 = i_get_field_num(g_iartin, pt_ic_gprsUsageTime_660003147)
SI (ic_gprsUsageTime_660003147 != -1)
ALORS
	SI ( i_valid_field_n(g_iartin, ic_gprsUsageTime_660003147) )
	ALORS
		gprsUsageTime_OK_660003147 = 1
	FINSI
FINSI

SI ( (useQosDelay_OK_660003147 == 1) || (useQosMeanput_OK_660003147 == 1) || (useQosPeakput_OK_660003147 == 1) ||
	(useQosPrecdnc_OK_660003147 == 1) || (useQosReliabl_OK_660003147 == 1) || (dataVolumeIN_OK_660003147 == 1) ||
	(dataVolumeOU_OK_660003147 == 1) || (gprsUsageTime_OK_660003147 == 1) )
ALORS
	SI (indice_660003147 < 9)
	ALORS
		indice_660003147 = indice_660003147 + 1
		SAUT  CPT_TYPE88
	FINSI
SINON
	indice_660003147 = indice_660003147 - 1
FINSI

SI ( indice_660003147 > 0)
ALORS

	CPT_X_660003147 = 88
	CPT_Z_660003147  = 0
	date_660003147  = i_DHgetLocalTime(4, 7, i_date_audit())

	SI (indice_660003147 <= 3)
	ALORS
		trace("**** MAJ du compteur 1507 pour le type 88 : + 1 ****")
		erreur_660003147=i_incr_cpt(CPT_660003147,CPT_X_660003147,g_ieec,CPT_Z_660003147,date_660003147,1)
	SINON
		SI (indice_660003147 <= 6)
		ALORS
			trace("**** MAJ du compteur 1507 pour le type 88 : + 2 ****")
			erreur_660003147=i_incr_cpt(CPT_660003147,CPT_X_660003147,g_ieec,CPT_Z_660003147,date_660003147,2)
		SINON
			SI (indice_660003147 <= 9 )
			ALORS
				trace("**** MAJ du compteur 1507 pour le type 88 : + 3 ****")
				erreur_660003147=i_incr_cpt(CPT_660003147,CPT_X_660003147,g_ieec,CPT_Z_660003147,date_660003147,3)
			FINSI
		FINSI
	FINSI

	SI(erreur_660003147 !=0)
	ALORS
		trace("**Tcrae_gprs, erreur de mise a jour du compteur 1507 pour le type 88 **")
		code_rejet_660003147  = MODULE_TRAIT_660003147  + ERR_SEM_660003147  + EFFICACE_660003147
		erreur_660003147 = i_format_str2(pt_LibelleAlarme_660003147, "%s%s", "f=", pt_NameOfFile_660003147)
		erreur_660003147 = i_PlvMessEmettre(8890, 2, g_iartout12, "", 3, code_rejet_660003147, 1507, pt_LibelleAlarme_660003147)
		SAUT STOCKE_ERRONE
	FINSI
FINSI


####################################################################
# Envoie article vers la distribution (Cas article correct)	   #
####################################################################
# TT0033 plus de modification du g_iartin a cause de pb decoupe gros fichier
erreur_660003147 = i_stocke_art(g_iartout12,0,PT_OK,0)
# /TT0033
RETOUR TRAIT_OK


####################################################################
# Stockage en errone (Cas ou il y a des erreurs dans l article)    #
####################################################################

POINT STOCKE_ERRONE

# TT0033 plus de modification du g_iartin a cause de pb decoupe gros fichier
erreur_660003147 = i_make_art_rej(g_iartout12, g_iartout11, code_rejet_660003147)
# /TT0033
erreur_660003147 = i_stocke_art(g_iartout11, 0, PT_ERRONE, 0)
#    RETOUR TRAIT_OK
RETOUR BAD_BLOC
#------------------------------- Fin Tcrae_gprs_trt.src ----------------------------
