<?php

function nna_sources_f(&$raw_data) {
    
    $data = array();

    foreach ($raw_data as $i => $source) {
        $data[] = array(
            'name' => $source['name'],
            'id' => $source['sid']
        );
    }

    return array('nna_sources' => $data);
    
}

function nna_sources_bandwidth_f(&$raw_data) {
    
    $data = array();

    foreach ($raw_data as $i => $source) {
        $data[] = array(
            'sid' => $source['sid'],
            'bw_data' => $source['bw_data']
        );
    }

    return array('nna_sources_bandwidth' => $data);
    
}

?>