mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
Fix #86: rename klinfix -> klish-plugin-infix
Also renames all klix_SYM@klinfix to SYM@infix, this is fine since we're always calling these symbols with @infix. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
committed by
Tobias Waldekranz
parent
f660f6e9c7
commit
83e5af33ff
@@ -116,7 +116,7 @@ BR2_PACKAGE_FINIT_PLUGIN_MODPROBE=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
|
||||
BR2_PACKAGE_KLINFIX=y
|
||||
BR2_PACKAGE_KLISH_PLUGIN_INFIX=y
|
||||
BR2_PACKAGE_LOWDOWN=y
|
||||
BR2_PACKAGE_NET=y
|
||||
BR2_PACKAGE_TETRIS=y
|
||||
|
||||
@@ -121,7 +121,7 @@ BR2_PACKAGE_FINIT_PLUGIN_MODPROBE=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
|
||||
BR2_PACKAGE_KLINFIX=y
|
||||
BR2_PACKAGE_KLISH_PLUGIN_INFIX=y
|
||||
BR2_PACKAGE_LOWDOWN=y
|
||||
BR2_PACKAGE_NET=y
|
||||
BR2_PACKAGE_TETRIS=y
|
||||
|
||||
@@ -69,7 +69,7 @@ BR2_PACKAGE_FINIT_PLUGIN_MODPROBE=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
|
||||
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
|
||||
BR2_PACKAGE_KLINFIX=y
|
||||
BR2_PACKAGE_KLISH_PLUGIN_INFIX=y
|
||||
BR2_PACKAGE_NET=y
|
||||
# SIGN_ENABLED is not set
|
||||
# GNS3_APPLIANCE is not set
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ source "$BR2_EXTERNAL_INFIX_PATH/package/factory/Config.in"
|
||||
source "$BR2_EXTERNAL_INFIX_PATH/package/faux/Config.in"
|
||||
source "$BR2_EXTERNAL_INFIX_PATH/package/finit/Config.in"
|
||||
source "$BR2_EXTERNAL_INFIX_PATH/package/ifupdown-ng/Config.in"
|
||||
source "$BR2_EXTERNAL_INFIX_PATH/package/klinfix/Config.in"
|
||||
source "$BR2_EXTERNAL_INFIX_PATH/package/klish-plugin-infix/Config.in"
|
||||
source "$BR2_EXTERNAL_INFIX_PATH/package/klish/Config.in"
|
||||
source "$BR2_EXTERNAL_INFIX_PATH/package/klish-plugin-sysrepo/Config.in"
|
||||
source "$BR2_EXTERNAL_INFIX_PATH/package/lowdown/Config.in"
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
################################################################################
|
||||
#
|
||||
# klinfix
|
||||
#
|
||||
################################################################################
|
||||
|
||||
KLINFIX_VERSION = 1.0
|
||||
KLINFIX_LICENSE = BSD-3-Clause
|
||||
KLINFIX_LICENSE_FILES = LICENSE
|
||||
KLINFIX_SITE_METHOD = local
|
||||
KLINFIX_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/klinfix
|
||||
KLINFIX_DEPENDENCIES = klish-plugin-sysrepo
|
||||
KLINFIX_AUTORECONF = YES
|
||||
|
||||
define KLINFIX_INSTALL_DOC
|
||||
$(INSTALL) -t $(TARGET_DIR)/usr/share/infix/cli -D -m 0644 \
|
||||
$(wildcard $(BR2_EXTERNAL_INFIX_PATH)/doc/cli/*.md)
|
||||
endef
|
||||
KLINFIX_POST_INSTALL_TARGET_HOOKS += KLINFIX_INSTALL_DOC
|
||||
|
||||
$(eval $(autotools-package))
|
||||
@@ -1,5 +1,5 @@
|
||||
config BR2_PACKAGE_KLINFIX
|
||||
bool "klinfix"
|
||||
config BR2_PACKAGE_KLISH_PLUGIN_INFIX
|
||||
bool "klish-plugin-infix"
|
||||
select BR2_PACKAGE_KLISH
|
||||
select BR2_PACKAGE_KLISH_PLUGIN_SYSREPO
|
||||
select BR2_PACKAGE_SYSREPO
|
||||
@@ -0,0 +1,21 @@
|
||||
################################################################################
|
||||
#
|
||||
# klish-plugin-infix
|
||||
#
|
||||
################################################################################
|
||||
|
||||
KLISH_PLUGIN_INFIX_VERSION = 1.0
|
||||
KLISH_PLUGIN_INFIX_LICENSE = BSD-3-Clause
|
||||
KLISH_PLUGIN_INFIX_LICENSE_FILES = LICENSE
|
||||
KLISH_PLUGIN_INFIX_SITE_METHOD = local
|
||||
KLISH_PLUGIN_INFIX_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/klish-plugin-infix
|
||||
KLISH_PLUGIN_INFIX_DEPENDENCIES = klish-plugin-sysrepo
|
||||
KLISH_PLUGIN_INFIX_AUTORECONF = YES
|
||||
|
||||
define KLISH_PLUGIN_INFIX_INSTALL_DOC
|
||||
$(INSTALL) -t $(TARGET_DIR)/usr/share/infix/cli -D -m 0644 \
|
||||
$(wildcard $(BR2_EXTERNAL_INFIX_PATH)/doc/cli/*.md)
|
||||
endef
|
||||
KLISH_PLUGIN_INFIX_POST_INSTALL_TARGET_HOOKS += KLISH_PLUGIN_INFIX_INSTALL_DOC
|
||||
|
||||
$(eval $(autotools-package))
|
||||
@@ -13,7 +13,7 @@ config BR2_PACKAGE_KLISH_PLUGIN_SYSREPO
|
||||
config BR2_PACKAGE_KLISH_PLUGIN_SYSREPO_XML
|
||||
bool "install xml"
|
||||
depends on BR2_PACKAGE_KLISH_PLUGIN_SYSREPO
|
||||
depends on !BR2_PACKAGE_KLINFIX
|
||||
depends on !BR2_PACKAGE_KLISH_PLUGIN_INFIX
|
||||
default y
|
||||
help
|
||||
Install the default XML spec bundled with the project, which
|
||||
|
||||
@@ -12,7 +12,7 @@ config BR2_PACKAGE_KLISH
|
||||
config BR2_PACKAGE_KLISH_DEFAULT_XML
|
||||
bool "install xml"
|
||||
depends on BR2_PACKAGE_KLISH
|
||||
depends on !BR2_PACKAGE_KLINFIX
|
||||
depends on !BR2_PACKAGE_KLISH_PLUGIN_INFIX
|
||||
default y
|
||||
help
|
||||
Install a small XML spec containing a definition of an
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
CFLAGS = -Wall -Wextra -Werror -Wno-unused-parameter
|
||||
|
||||
pluginsdir = $(KLISHLIBDIR)/plugins
|
||||
plugins_LTLIBRARIES = kplugin-klinfix.la
|
||||
|
||||
kplugin_klinfix_la_CFLAGS = $(sysrepo_CFLAGS) $(klish_CFLAGS) $(libyang_CFLAGS) $(CFLAGS)
|
||||
kplugin_klinfix_la_LIBADD = $(sysrepo_LIBS) $(klish_LIBS) $(libyang_LIBS)
|
||||
kplugin_klinfix_la_LDFLAGS = -module -avoid-version -shared
|
||||
kplugin_klinfix_la_SOURCES = klinfix.c
|
||||
@@ -1,10 +1,10 @@
|
||||
Infix Extensions to klish-plugin-sysrepo
|
||||
----------------------------------------
|
||||
Infix Extensions to Klish
|
||||
-------------------------
|
||||
|
||||
Tailor `klish` and `klish-plugin-sysrepo` to suit Infix. The resulting
|
||||
Tailor `klish` and `klish-plugin-sysrepo` to suit Infix. The resulting
|
||||
CLI is, in many respects, still very similar to Juniper's JunOS, since
|
||||
that is also the primary inspiration for klish, with some additions
|
||||
and modifications.
|
||||
that is also the primary inspiration for klish, with some additions and
|
||||
modifications.
|
||||
|
||||
Broadly speaking, the CLI is split up in two major modes:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
AC_PREREQ(2.61)
|
||||
AC_INIT([klinfix], [1.0.0],
|
||||
AC_INIT([klish-plugin-infix], [1.0.0],
|
||||
[https://github.com/kernelkit/infix/issues])
|
||||
AM_INIT_AUTOMAKE(1.11 foreign subdir-objects)
|
||||
AM_SILENT_RULES(yes)
|
||||
@@ -0,0 +1,9 @@
|
||||
CFLAGS = -Wall -Wextra -Werror -Wno-unused-parameter
|
||||
|
||||
pluginsdir = $(KLISHLIBDIR)/plugins
|
||||
plugins_LTLIBRARIES = kplugin-infix.la
|
||||
|
||||
kplugin_infix_la_CFLAGS = $(sysrepo_CFLAGS) $(klish_CFLAGS) $(libyang_CFLAGS) $(CFLAGS)
|
||||
kplugin_infix_la_LIBADD = $(sysrepo_LIBS) $(klish_LIBS) $(libyang_LIBS)
|
||||
kplugin_infix_la_LDFLAGS = -module -avoid-version -shared
|
||||
kplugin_infix_la_SOURCES = infix.c
|
||||
@@ -14,10 +14,10 @@
|
||||
|
||||
#include <libyang/libyang.h>
|
||||
|
||||
const uint8_t kplugin_klinfix_major = 1;
|
||||
const uint8_t kplugin_klinfix_minor = 0;
|
||||
const uint8_t kplugin_infix_major = 1;
|
||||
const uint8_t kplugin_infix_minor = 0;
|
||||
|
||||
int klix_files(kcontext_t *ctx)
|
||||
int infix_files(kcontext_t *ctx)
|
||||
{
|
||||
const char *path;
|
||||
struct dirent *d;
|
||||
@@ -46,14 +46,14 @@ int klix_files(kcontext_t *ctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int klix_ifaces(kcontext_t *ctx)
|
||||
int infix_ifaces(kcontext_t *ctx)
|
||||
{
|
||||
(void)ctx;
|
||||
system("ls /sys/class/net");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int klix_ds_from_str(const char *text, sr_datastore_t *ds)
|
||||
int infix_ds_from_str(const char *text, sr_datastore_t *ds)
|
||||
{
|
||||
size_t len = strlen(text);
|
||||
|
||||
@@ -73,7 +73,7 @@ int klix_ds_from_str(const char *text, sr_datastore_t *ds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int klix_copy(kcontext_t *ctx)
|
||||
int infix_copy(kcontext_t *ctx)
|
||||
{
|
||||
kpargv_t *pargv = kcontext_pargv(ctx);
|
||||
sr_datastore_t srcds, dstds;
|
||||
@@ -87,13 +87,13 @@ int klix_copy(kcontext_t *ctx)
|
||||
if (!srcarg || !dstarg)
|
||||
goto err;
|
||||
|
||||
if (klix_ds_from_str(kparg_value(srcarg), &srcds)) {
|
||||
if (infix_ds_from_str(kparg_value(srcarg), &srcds)) {
|
||||
fprintf(stderr,
|
||||
"Error: \"%s\" is not the name of any known datastore\n",
|
||||
kparg_value(srcarg));
|
||||
goto err;
|
||||
}
|
||||
if (klix_ds_from_str(kparg_value(dstarg), &dstds)) {
|
||||
if (infix_ds_from_str(kparg_value(dstarg), &dstds)) {
|
||||
fprintf(stderr,
|
||||
"Error: \"%s\" is not the name of any known datastore\n",
|
||||
kparg_value(dstarg));
|
||||
@@ -149,7 +149,7 @@ err:
|
||||
return -1;
|
||||
}
|
||||
|
||||
int klix_commit(kcontext_t *ctx)
|
||||
int infix_commit(kcontext_t *ctx)
|
||||
{
|
||||
sr_session_ctx_t *sess;
|
||||
sr_conn_ctx_t *conn;
|
||||
@@ -185,7 +185,7 @@ err:
|
||||
return -1;
|
||||
}
|
||||
|
||||
int klix_rpc(kcontext_t *ctx)
|
||||
int infix_rpc(kcontext_t *ctx)
|
||||
{
|
||||
kpargv_pargs_node_t *iter;
|
||||
size_t icnt = 0, ocnt = 0;
|
||||
@@ -252,22 +252,22 @@ err:
|
||||
return -1;
|
||||
}
|
||||
|
||||
int kplugin_klinfix_fini(kcontext_t *ctx)
|
||||
int kplugin_infix_fini(kcontext_t *ctx)
|
||||
{
|
||||
(void)ctx;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int kplugin_klinfix_init(kcontext_t *ctx)
|
||||
int kplugin_infix_init(kcontext_t *ctx)
|
||||
{
|
||||
kplugin_t *plugin = kcontext_plugin(ctx);
|
||||
|
||||
kplugin_add_syms(plugin, ksym_new("klix_copy", klix_copy));
|
||||
kplugin_add_syms(plugin, ksym_new("klix_commit", klix_commit));
|
||||
kplugin_add_syms(plugin, ksym_new("klix_files", klix_files));
|
||||
kplugin_add_syms(plugin, ksym_new("klix_ifaces", klix_ifaces));
|
||||
kplugin_add_syms(plugin, ksym_new("klix_rpc", klix_rpc));
|
||||
kplugin_add_syms(plugin, ksym_new("copy", infix_copy));
|
||||
kplugin_add_syms(plugin, ksym_new("commit", infix_commit));
|
||||
kplugin_add_syms(plugin, ksym_new("files", infix_files));
|
||||
kplugin_add_syms(plugin, ksym_new("ifaces", infix_ifaces));
|
||||
kplugin_add_syms(plugin, ksym_new("rpc", infix_rpc));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
xsi:schemaLocation="https://src.libcode.org/pkun/klish/src/master/klish.xsd">
|
||||
|
||||
<PLUGIN name="klish"/>
|
||||
<PLUGIN name="klinfix"/>
|
||||
<PLUGIN name="infix"/>
|
||||
<PLUGIN name="script"/>
|
||||
<PLUGIN name="sysrepo">
|
||||
ShowBrackets = y
|
||||
@@ -90,14 +90,14 @@
|
||||
|
||||
<PTYPE name="LOGFILES">
|
||||
<COMPL>
|
||||
<ACTION sym="klix_files@klinfix">/var/log</ACTION>
|
||||
<ACTION sym="files@infix">/var/log</ACTION>
|
||||
</COMPL>
|
||||
<ACTION sym="STRING"/>
|
||||
</PTYPE>
|
||||
|
||||
<PTYPE name="PORTAR">
|
||||
<COMPL>
|
||||
<ACTION sym="klix_ifaces@klinfix"/>
|
||||
<ACTION sym="ifaces@infix"/>
|
||||
</COMPL>
|
||||
<ACTION sym="STRING"/>
|
||||
</PTYPE>
|
||||
@@ -129,11 +129,11 @@
|
||||
</COMMAND>
|
||||
|
||||
<COMMAND name="poweroff" help="Poweroff system (system policy may yield reboot)">
|
||||
<ACTION sym="klix_rpc@klinfix" ptype="STRING">/ietf-system:system-shutdown</ACTION>
|
||||
<ACTION sym="rpc@infix" ptype="STRING">/ietf-system:system-shutdown</ACTION>
|
||||
</COMMAND>
|
||||
|
||||
<COMMAND name="reboot" help="Reboot system">
|
||||
<ACTION sym="klix_rpc@klinfix" ptype="STRING">/ietf-system:system-restart</ACTION>
|
||||
<ACTION sym="rpc@infix" ptype="STRING">/ietf-system:system-restart</ACTION>
|
||||
</COMMAND>
|
||||
|
||||
<COMMAND name="shell" help="Enter system shell">
|
||||
@@ -154,7 +154,7 @@
|
||||
<COMMAND name="copy" help="Copy">
|
||||
<PARAM name="src" ptype="/DATASTORE" help="Source datastore"/>
|
||||
<PARAM name="dst" ptype="/RW_DATASTORE" help="Destination datastore"/>
|
||||
<ACTION sym="klix_copy@klinfix"/>
|
||||
<ACTION sym="copy@infix"/>
|
||||
</COMMAND>
|
||||
|
||||
<COMMAND name="password" help="Password tools" mode="switch">
|
||||
@@ -189,7 +189,7 @@
|
||||
<COMMAND name="set" help="Set" mode="switch">
|
||||
<COMMAND name="datetime" help="Set current date and time, ISO-8601 format">
|
||||
<PARAM name="current-datetime" ptype="/STRING" help="yyyy-mm-ddThh:mm:ss(Z|+/-hh:mm)"/>
|
||||
<ACTION sym="klix_rpc@klinfix">/ietf-system:set-current-datetime</ACTION>
|
||||
<ACTION sym="rpc@infix">/ietf-system:set-current-datetime</ACTION>
|
||||
</COMMAND>
|
||||
</COMMAND>
|
||||
|
||||
@@ -384,7 +384,7 @@
|
||||
</COMMAND>
|
||||
|
||||
<COMMAND name="leave" help="Apply candidate to running-config and return to admin-exec">
|
||||
<ACTION sym="klix_commit@klinfix"/>
|
||||
<ACTION sym="commit@infix"/>
|
||||
<ACTION sym="srp_top@sysrepo"/>
|
||||
<ACTION sym="nav" exec_on="success">replace main</ACTION>
|
||||
</COMMAND>
|
||||
@@ -426,7 +426,7 @@
|
||||
</COMMAND>
|
||||
|
||||
<COMMAND name="commit" help="Commit current candidate to running-config">
|
||||
<ACTION sym="klix_commit@klinfix"/>
|
||||
<ACTION sym="commit@infix"/>
|
||||
</COMMAND>
|
||||
|
||||
<COMMAND name="reset" help="Reset candidate to running-config">
|
||||
Reference in New Issue
Block a user