1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/openeuler-iSulad

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
cni_operator_design.md 3.8 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
liuxu Отправлено 08.11.2023 11:03 e314c2b
Author 高华涛
Date 2021-01-22
Email -

1. Program Objectives

The cni-operator module encapsulates the libcni module, provides a more reasonable and friendly network management interface for generation, and is responsible for loading and updating network configuration files.

2. Overall Design

3. Interface Description

/*
* Description: Network management module initialization: Initialize libcni network module and network management layer data;;
* cache_dir: Network cache configuration file storage directory;
* conf_path: cni configuration file storage directory;
* bin_paths: cni plugin storage directory list;
* bin_paths_len: directory listing length;
* Return value: return 0 on success, non-zero on failure
*/
int cni_manager_store_init(const char *cache_dir, const char *conf_path, const char * const *bin_paths, size_t bin_paths_len);

/*
* Description: According to the filtering rules, load the cni configuration file to the memory;
* store: cni configuration list;
* res_len: length of cni configuration list;
* filter_ops: Customize the cni configuration loading rules, and load the configuration files that meet the rules;
* Return value: return 0 on success, non-zero on failure
*/
int get_net_conflist_from_dir(struct cni_network_list_conf ***store, size_t *res_len, cni_conf_filter_t filter_ops);

/*
* Description: Create a container loopback network
* id: container id;
* netns: container network namespace;
* Return value: return 0 on success, non-zero on failure
*/
int attach_loopback(const char *id, const char *netns);

/*
* Description: delete the container loopback network
* id: container id;
* netns: container network namespace;
* Return value: return 0 on success, non-zero on failure
*/
int detach_loopback(const char *id, const char *netns);

/*
* Description: Create a container single network plane;
* manager: The set of parameters required for container network creation;
* list: network configuration;
* result: record necessary network information;
* Return value: return 0 on success, non-zero on failure
*/
int attach_network_plane(const struct cni_manager *manager, const struct cni_network_list_conf *list, struct cni_opt_result **result);

/*
* Description: delete the container single network plane;
* manager: The set of parameters required for container network deletion;
* list: network configuration;
* result: record necessary network information;
* Return value: return 0 on success, non-zero on failure
*/
int detach_network_plane(const struct cni_manager *manager, const struct cni_network_list_conf *list, struct cni_opt_result **result);

/*
* Description: Check the status of the single network plane of the container;
* manager: set of parameters required for container network check;
* list: network configuration;
* result: record necessary network information;
* Return value: return 0 on success, non-zero on failure
*/
int check_network_plane(const struct cni_manager *manager, const struct cni_network_list_conf *list, struct cni_opt_result **result);

/*
* Description: get the CNI version information supported by the plugins required for the single network plane of the container;
* list: network configuration;
* result_version_list: record the CNI version supported by the plugins;
* Return value: return 0 on success, non-zero on failure
*/
int version_network_plane(const struct cni_network_list_conf *list, struct cni_result_version_list **result_version_list);

4. Detailed Design

4.1 load network configuration file

4.2 create network process

4.3 delete network process

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/openeuler-iSulad.git
git@api.gitlife.ru:oschina-mirror/openeuler-iSulad.git
oschina-mirror
openeuler-iSulad
openeuler-iSulad
master