7 /*****************************************************************************/
8 /* Local prototypes. */
9 /*****************************************************************************/
10 static void demo_mobile_flow(void);
12 int main(int argc, char ** argv)
14 EVEL_ERR_CODES evel_rc = EVEL_SUCCESS;
15 EVENT_HEADER * heartbeat = NULL;
17 printf("\nHello AT&T Vendor Event world!\n");
23 "Usage: %s <FQDN>|<IP address> <port> "
24 "<username> <password>\n", argv[0]);
28 /***************************************************************************/
30 /***************************************************************************/
31 if (evel_initialize(argv[1], /* FQDN */
32 atoi(argv[2]), /* Port */
33 NULL, /* optional path */
34 NULL, /* optional topic */
36 argv[3], /* Username */
37 argv[4], /* Password */
38 EVEL_SOURCE_VIRTUAL_MACHINE, /* Source type */
39 "EVEL training demo", /* Role */
42 fprintf(stderr, "\nFailed to initialize the EVEL library!!!\n");
47 printf("\nInitialization completed\n");
50 /***************************************************************************/
51 /* Send a heartbeat just to show we're alive! */
52 /***************************************************************************/
53 heartbeat = evel_new_heartbeat();
54 if (heartbeat != NULL)
56 evel_rc = evel_post_event(heartbeat);
57 if (evel_rc != EVEL_SUCCESS)
59 printf("Post failed %d (%s)", evel_rc, evel_error_string());
64 printf("New heartbeat failed");
67 /***************************************************************************/
68 /* Raise a measurement */
69 /***************************************************************************/
72 /***************************************************************************/
74 /***************************************************************************/
77 printf("Terminated\n");
82 /**************************************************************************//**
83 * Create and send three mobile flow events.
84 *****************************************************************************/
85 void demo_mobile_flow(void)
87 MOBILE_GTP_PER_FLOW_METRICS * metrics = NULL;
88 EVENT_MOBILE_FLOW * mobile_flow = NULL;
89 EVEL_ERR_CODES evel_rc = EVEL_SUCCESS;
91 metrics = evel_new_mobile_gtp_flow_metrics(12.32,
123 evel_mobile_gtp_metrics_dur_con_fail_set(metrics, 12);
124 evel_mobile_gtp_metrics_dur_tun_fail_set(metrics, 13);
125 evel_mobile_gtp_metrics_act_by_set(metrics, "Remote");
126 evel_mobile_gtp_metrics_act_time_set(metrics, (time_t)1470409423);
127 evel_mobile_gtp_metrics_deact_by_set(metrics, "Remote");
128 evel_mobile_gtp_metrics_con_status_set(metrics, "Connected");
129 evel_mobile_gtp_metrics_tun_status_set(metrics, "Not tunneling");
130 evel_mobile_gtp_metrics_iptos_set(metrics, 1, 13);
131 evel_mobile_gtp_metrics_iptos_set(metrics, 17, 1);
132 evel_mobile_gtp_metrics_iptos_set(metrics, 4, 99);
133 evel_mobile_gtp_metrics_large_pkt_rtt_set(metrics, 80);
134 evel_mobile_gtp_metrics_large_pkt_thresh_set(metrics, 600.0);
135 evel_mobile_gtp_metrics_max_rcv_bit_rate_set(metrics, 1357924680);
136 evel_mobile_gtp_metrics_max_trx_bit_rate_set(metrics, 235711);
137 evel_mobile_gtp_metrics_num_echo_fail_set(metrics, 1);
138 evel_mobile_gtp_metrics_num_tun_fail_set(metrics, 4);
139 evel_mobile_gtp_metrics_num_http_errors_set(metrics, 2);
140 evel_mobile_gtp_metrics_tcp_flag_count_add(metrics, EVEL_TCP_CWR, 10);
141 evel_mobile_gtp_metrics_tcp_flag_count_add(metrics, EVEL_TCP_URG, 121);
142 evel_mobile_gtp_metrics_qci_cos_count_add(
143 metrics, EVEL_QCI_COS_UMTS_CONVERSATIONAL, 11);
144 evel_mobile_gtp_metrics_qci_cos_count_add(
145 metrics, EVEL_QCI_COS_LTE_65, 122);
147 mobile_flow = evel_new_mobile_flow("Outbound",
155 if (mobile_flow != NULL)
157 evel_mobile_flow_app_type_set(mobile_flow, "Demo application 2");
158 evel_mobile_flow_app_prot_type_set(mobile_flow, "GSM");
159 evel_mobile_flow_app_prot_ver_set(mobile_flow, "2");
160 evel_mobile_flow_cid_set(mobile_flow, "1");
161 evel_mobile_flow_con_type_set(mobile_flow, "S1-U");
162 evel_mobile_flow_ecgi_set(mobile_flow, "e1");
163 evel_mobile_flow_gtp_prot_type_set(mobile_flow, "GTP-U");
164 evel_mobile_flow_gtp_prot_ver_set(mobile_flow, "1");
165 evel_mobile_flow_http_header_set(mobile_flow, "http://www.google.com");
166 evel_mobile_flow_imei_set(mobile_flow, "209917614823");
167 evel_mobile_flow_imsi_set(mobile_flow, "355251/05/850925/8");
168 evel_mobile_flow_lac_set(mobile_flow, "1");
169 evel_mobile_flow_mcc_set(mobile_flow, "410");
170 evel_mobile_flow_mnc_set(mobile_flow, "04");
171 evel_mobile_flow_msisdn_set(mobile_flow, "6017123456789");
172 evel_mobile_flow_other_func_role_set(mobile_flow, "MMF");
173 evel_mobile_flow_rac_set(mobile_flow, "514");
174 evel_mobile_flow_radio_acc_tech_set(mobile_flow, "3G");
175 evel_mobile_flow_sac_set(mobile_flow, "1");
176 evel_mobile_flow_samp_alg_set(mobile_flow, 2);
177 evel_mobile_flow_tac_set(mobile_flow, "2099");
178 evel_mobile_flow_tunnel_id_set(mobile_flow, "Tunnel 2");
179 evel_mobile_flow_vlan_id_set(mobile_flow, "4096");
181 evel_rc = evel_post_event((EVENT_HEADER *)mobile_flow);
182 if (evel_rc == EVEL_SUCCESS)
184 printf("Post OK!\n");
188 printf("Post Failed %d (%s)\n", evel_rc, evel_error_string());
193 printf("Failed to create event (%s)\n", evel_error_string());
195 printf(" Processed full Mobile Flow\n");
199 printf("New GTP Per Flow Metrics failed\n");