src/sgw/pgw_lite_paa.c
void
pgw_load_pool_ip_addresses (
  void)
{
  struct conf_ipv4_list_elm_s   *conf_ipv4_p = NULL;
  struct ipv4_list_elm_s        *ipv4_p = NULL;
  //struct conf_ipv6_list_elm_s   *conf_ipv6_p = NULL;
  //struct ipv6_list_elm_s        *ipv6_p = NULL;
  //char                           print_buffer[INET6_ADDRSTRLEN];

  STAILQ_INIT (&pgw_app.ipv4_list_free);
  STAILQ_INIT (&pgw_app.ipv4_list_allocated);
  STAILQ_FOREACH (conf_ipv4_p, &spgw_config.pgw_config.ipv4_pool_list, ipv4_entries) {
    ipv4_p = calloc (1, sizeof (struct ipv4_list_elm_s));
    ipv4_p->addr.s_addr = conf_ipv4_p->addr.s_addr;
    STAILQ_INSERT_TAIL (&pgw_app.ipv4_list_free, ipv4_p, ipv4_entries);
    //SPGW_APP_DEBUG("Loaded IPv4 PAA address in pool: %s\n",
    //        inet_ntoa(conf_ipv4_p->addr));
  }

//  STAILQ_FOREACH (conf_ipv6_p, &spgw_config.pgw_config.pgw_lite_ipv6_pool_list, ipv6_entries) {
//    ipv6_p = calloc (1, sizeof (struct pgw_lite_ipv6_list_elm_s));
//    ipv6_p->addr = conf_ipv6_p->addr;
//    ipv6_p->prefix_len = conf_ipv6_p->prefix_len;
//    ipv6_p->num_allocated = 0;
//    STAILQ_INSERT_TAIL (&pgw_app.pgw_lite_ipv6_list_free, ipv6_p, ipv6_entries);
//
//    if (inet_ntop (AF_INET6, &ipv6_p->addr, print_buffer, INET6_ADDRSTRLEN) == NULL) {
//      OAILOG_ERROR (LOG_SPGW_APP, "Could not Load IPv6 PAA address in pool: %s\n", strerror (errno));
//    }                           /*else {
//                                 *
//                                 * SPGW_APP_DEBUG("Loaded IPv6 PAA prefix in pool: %s\n",print_buffer);
//                                 * } */
//  }
#if PGW_LITE_FREE_ADDR_POOL_CONFIG

  while ((conf_ipv4_p = STAILQ_FIRST (&spgw_config.pgw_config.ipv4_pool_list))) {
    STAILQ_REMOVE_HEAD (&spgw_config.pgw_config.ipv4_pool_list, ipv4_entries);
    free_wrapper ((void **) &conf_ipv4_p);
  }

#endif
}
// Load in PGW pool, configured PAA address pool
Load in PGW pool, configured PAA address pool
Load in PGW pool configured PAA address pool
void
pgw_load_pool_ip_addresses (
  void)
{
  struct conf_ipv4_list_elm_s   *conf_ipv4_p = NULL;
  struct ipv4_list_elm_s        *ipv4_p = NULL;
  STAILQ_INIT (&pgw_app.ipv4_list_free);
  STAILQ_INIT (&pgw_app.ipv4_list_allocated);
  STAILQ_FOREACH (conf_ipv4_p, &spgw_config.pgw_config.ipv4_pool_list, ipv4_entries) {
    ipv4_p = calloc (1, sizeof (struct ipv4_list_elm_s));
    ipv4_p->addr.s_addr = conf_ipv4_p->addr.s_addr;
    STAILQ_INSERT_TAIL (&pgw_app.ipv4_list_free, ipv4_p, ipv4_entries);
  }
    if (inet_ntop (AF_INET6, &ipv6_p->addr, print_buffer, INET6_ADDRSTRLEN) == NULL) {
      OAILOG_ERROR (LOG_SPGW_APP, "Could not Load IPv6 PAA address in pool: %s\n", strerror (errno));
    }                           /*else {
                                 *
                                 * SPGW_APP_DEBUG("Loaded IPv6 PAA prefix in pool: %s\n",print_buffer);
                                 * } */
  }
#if PGW_LITE_FREE_ADDR_POOL_CONFIG
  while ((conf_ipv4_p = STAILQ_FIRST (&spgw_config.pgw_config.ipv4_pool_list))) {
    STAILQ_REMOVE_HEAD (&spgw_config.pgw_config.ipv4_pool_list, ipv4_entries);
    free_wrapper ((void **) &conf_ipv4_p);
  }
#endif
}
void pgw_load_pool_ip_addresses ( void ) { struct conf_ipv4_list_elm_s * conf_ipv4_p = NULL ; struct ipv4_list_elm_s * ipv4_p = NULL ; STAILQ_INIT ( & pgw_app . ipv4_list_free ) ; STAILQ_INIT ( & pgw_app . ipv4_list_allocated ) ; STAILQ_FOREACH ( conf_ipv4_p , & spgw_config . pgw_config . ipv4_pool_list , ipv4_entries ) { ipv4_p = calloc ( 1 , sizeof ( struct ipv4_list_elm_s ) ) ; ipv4_p -> addr . s_addr = conf_ipv4_p -> addr . s_addr ; STAILQ_INSERT_TAIL ( & pgw_app . ipv4_list_free , ipv4_p , ipv4_entries ) ; } #if PGW_LITE_FREE_ADDR_POOL_CONFIG while ( ( conf_ipv4_p = STAILQ_FIRST ( & spgw_config . pgw_config . ipv4_pool_list ) ) ) { STAILQ_REMOVE_HEAD ( & spgw_config . pgw_config . ipv4_pool_list , ipv4_entries ) ; free_wrapper ( ( void * * ) & conf_ipv4_p ) ; } #endif }
Load in PGW pool, configured PAA address pool
Load in PGW pool configured PAA address pool
//struct conf_ipv6_list_elm_s   *conf_ipv6_p = NULL; //struct ipv6_list_elm_s        *ipv6_p = NULL; //char                           print_buffer[INET6_ADDRSTRLEN]; //SPGW_APP_DEBUG("Loaded IPv4 PAA address in pool: %s\n", //        inet_ntoa(conf_ipv4_p->addr)); //  STAILQ_FOREACH (conf_ipv6_p, &spgw_config.pgw_config.pgw_lite_ipv6_pool_list, ipv6_entries) { //    ipv6_p = calloc (1, sizeof (struct pgw_lite_ipv6_list_elm_s)); //    ipv6_p->addr = conf_ipv6_p->addr; //    ipv6_p->prefix_len = conf_ipv6_p->prefix_len; //    ipv6_p->num_allocated = 0; //    STAILQ_INSERT_TAIL (&pgw_app.pgw_lite_ipv6_list_free, ipv6_p, ipv6_entries); // //    if (inet_ntop (AF_INET6, &ipv6_p->addr, print_buffer, INET6_ADDRSTRLEN) == NULL) { //      OAILOG_ERROR (LOG_SPGW_APP, "Could not Load IPv6 PAA address in pool: %s\n", strerror (errno)); //    }                           /*else { //                                 * //                                 * SPGW_APP_DEBUG("Loaded IPv6 PAA prefix in pool: %s\n",print_buffer); //                                 * } */ //  }