def get_ospf(engine):
    """
    Get OSPF settings for the engine
    
    :return: dict of entries only if OSPF is enabled
    """
    ospf = engine.dynamic_routing.ospf
    data = dict(
        enabled=ospf.status,
        router_id=ospf.router_id)
    if ospf.status:
        data.update(ospf_profile=ospf.profile.name)

    ospf_areas = []
    for interface, network, peering in engine.routing.ospf_areas:
        area_data = {}
        area_data.update(interface_id=interface.nicid,
                         name=peering.name)
        if network:
            area_data.update(network=network.ip)
        ospf_areas.append(area_data)
    if ospf_areas:
        data.update(ospf_areas=ospf_areas)
    return data