-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libostree: Add support for finding remote URIs by ref name
WIP work to add an OstreeRepoFinder interface and implementations which find remote URIs by ref names, which we consider to be globally unique. This is an API preview. It compiles, but has not been tested beyond that, and the implementation is unfinished in various places, and unpolished everywhere else. It is intended as a strawman for the proposed API. The new API is used in a new ostree_repo_find_updates() function, which resolves a list of ref names to update into a set of remote URIs to pull them from, which can be treated as mirrors. A major feature this adds is the ability to automatically pull from other machines on the local network (as long as they are running an OSTree server and appropriate Avahi DNS-SD adverts, support for which will be added separately). Similarly, it adds the ability to pull from removable file systems without needing further configuration. This bumps the GLib dependency to 2.50, and adds an optional dependency on Avahi. Signed-off-by: Philip Withnall <[email protected]>
- Loading branch information
Showing
27 changed files
with
5,112 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- | ||
* | ||
* Copyright © 2017 Endless Mobile, Inc. | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the | ||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
* Boston, MA 02111-1307, USA. | ||
* | ||
* Authors: | ||
* - Philip Withnall <[email protected]> | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <gio/gio.h> | ||
#include <glib.h> | ||
#include <glib-object.h> | ||
|
||
G_BEGIN_DECLS | ||
|
||
/* TODO: Docs */ | ||
typedef struct _OstreeBloom OstreeBloom; | ||
|
||
/* TODO: Docs */ | ||
typedef guint64 (*OstreeBloomHashFunc) (gconstpointer element, | ||
guint8 k); | ||
|
||
#define OSTREE_TYPE_BLOOM (ostree_bloom_get_type ()) | ||
|
||
G_GNUC_INTERNAL | ||
GType ostree_bloom_get_type (void); | ||
|
||
G_GNUC_INTERNAL | ||
OstreeBloom *ostree_bloom_new (gsize n_bytes, | ||
guint8 k, | ||
OstreeBloomHashFunc hash); | ||
|
||
G_GNUC_INTERNAL | ||
OstreeBloom *ostree_bloom_new_from_bytes (GBytes *bytes, | ||
guint8 k, | ||
OstreeBloomHashFunc hash); | ||
|
||
G_GNUC_INTERNAL | ||
OstreeBloom *ostree_bloom_ref (OstreeBloom *bloom); | ||
G_GNUC_INTERNAL | ||
void ostree_bloom_unref (OstreeBloom *bloom); | ||
|
||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeBloom, ostree_bloom_unref) | ||
|
||
G_GNUC_INTERNAL | ||
gboolean ostree_bloom_maybe_contains (OstreeBloom *bloom, | ||
gconstpointer element); | ||
|
||
G_GNUC_INTERNAL | ||
GBytes *ostree_bloom_seal (OstreeBloom *bloom); | ||
|
||
G_GNUC_INTERNAL | ||
void ostree_bloom_add_element (OstreeBloom *bloom, | ||
gconstpointer element); | ||
|
||
G_GNUC_INTERNAL | ||
guint64 ostree_str_bloom_hash (gconstpointer element, | ||
guint8 k); | ||
|
||
/* TODO: Building functions */ | ||
|
||
G_END_DECLS |
Oops, something went wrong.