Skip to content

Commit b9a5692

Browse files
committed
confd: drop ietf/infix prefix from function names
SIMPLIFY, Simplify, simplify ... as my uni English professor always said. > “Perfection is achieved not when there is nothing more to add, but when > there is nothing left to take away.” -- Antoine de Saint-Exupéry Signed-off-by: Joachim Wiberg <[email protected]>
1 parent c398e42 commit b9a5692

20 files changed

+83
-83
lines changed

src/confd/src/containers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static int del(const char *name)
349349
return SR_ERR_OK;
350350
}
351351

352-
int infix_containers_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd)
352+
int containers_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd)
353353
{
354354
struct lyd_node *cifs, *difs, *cif, *dif;
355355
sr_error_t err = 0;
@@ -465,7 +465,7 @@ static int oci_load(sr_session_ctx_t *session, uint32_t sub_id, const char *xpat
465465
return SR_ERR_OK;
466466
}
467467

468-
int infix_containers_rpc_init(struct confd *confd)
468+
int containers_rpc_init(struct confd *confd)
469469
{
470470
int rc;
471471

src/confd/src/core.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -191,57 +191,57 @@ static int change_cb(sr_session_ctx_t *session, uint32_t sub_id, const char *mod
191191
}
192192

193193
/* ietf-interfaces */
194-
if ((rc = ietf_interfaces_change(session, config, diff, event, confd)))
194+
if ((rc = interfaces_change(session, config, diff, event, confd)))
195195
goto free_diff;
196196

197197
/* infix-dhcp-client*/
198-
if ((rc = infix_dhcp_client_change(session, config, diff, event, confd)))
198+
if ((rc = dhcp_client_change(session, config, diff, event, confd)))
199199
goto free_diff;
200200

201201
/* infix-dhcpv6-client*/
202-
if ((rc = infix_dhcpv6_client_change(session, config, diff, event, confd)))
202+
if ((rc = dhcpv6_client_change(session, config, diff, event, confd)))
203203
goto free_diff;
204204

205205
/* ietf-keystore */
206-
if ((rc = ietf_keystore_change(session, config, diff, event, confd)))
206+
if ((rc = keystore_change(session, config, diff, event, confd)))
207207
goto free_diff;
208208

209209
/* infix-services */
210-
if ((rc = infix_services_change(session, config, diff, event, confd)))
210+
if ((rc = services_change(session, config, diff, event, confd)))
211211
goto free_diff;
212212

213213
/* ietf-syslog*/
214-
if ((rc = ietf_syslog_change(session, config, diff, event, confd)))
214+
if ((rc = syslog_change(session, config, diff, event, confd)))
215215
goto free_diff;
216216

217217
/* ietf-system */
218-
if ((rc = ietf_system_change(session, config, diff, event, confd)))
218+
if ((rc = system_change(session, config, diff, event, confd)))
219219
goto free_diff;
220220

221221
/* infix-containers */
222222
#ifdef CONTAINERS
223-
if ((rc = infix_containers_change(session, config, diff, event, confd)))
223+
if ((rc = containers_change(session, config, diff, event, confd)))
224224
goto free_diff;
225225
#endif
226226

227227
/* ietf-hardware */
228-
if ((rc = ietf_hardware_change(session, config, diff, event, confd)))
228+
if ((rc = hardware_change(session, config, diff, event, confd)))
229229
goto free_diff;
230230

231231
/* ietf-routing */
232-
if ((rc = ietf_routing_change(session, config, diff, event, confd)))
232+
if ((rc = routing_change(session, config, diff, event, confd)))
233233
goto free_diff;
234234

235235
/* infix-dhcp-server */
236-
if ((rc = infix_dhcp_server_change(session, config, diff, event, confd)))
236+
if ((rc = dhcp_server_change(session, config, diff, event, confd)))
237237
goto free_diff;
238238

239239
/* infix-firewall */
240-
if ((rc = infix_firewall_change(session, config, diff, event, confd)))
240+
if ((rc = firewall_change(session, config, diff, event, confd)))
241241
goto free_diff;
242242

243243
/* infix-meta */
244-
if ((rc = infix_meta_change_cb(session, config, diff, event, confd)))
244+
if ((rc = meta_change_cb(session, config, diff, event, confd)))
245245
goto free_diff;
246246

247247
if (cfg)
@@ -390,48 +390,48 @@ int sr_plugin_init_cb(sr_session_ctx_t *session, void **priv)
390390
goto err;
391391
}
392392

393-
rc = ietf_system_rpc_init(&confd);
393+
rc = system_rpc_init(&confd);
394394
if (rc)
395395
goto err;
396396
#ifdef CONTAINERS
397-
rc = infix_containers_rpc_init(&confd);
397+
rc = containers_rpc_init(&confd);
398398
if (rc)
399399
goto err;
400400
#endif
401-
rc = infix_dhcp_server_rpc_init(&confd);
401+
rc = dhcp_server_rpc_init(&confd);
402402
if (rc)
403403
goto err;
404404

405-
rc = infix_factory_rpc_init(&confd);
405+
rc = factory_rpc_init(&confd);
406406
if (rc)
407407
goto err;
408408

409-
rc = ietf_factory_default_rpc_init(&confd);
409+
rc = factory_default_rpc_init(&confd);
410410
if (rc)
411411
goto err;
412412

413-
rc = infix_firewall_rpc_init(&confd);
413+
rc = firewall_rpc_init(&confd);
414414
if (rc)
415415
goto err;
416416

417-
rc = infix_system_sw_rpc_init(&confd);
417+
rc = system_sw_rpc_init(&confd);
418418
if (rc)
419419
goto err;
420420

421421
/* Candidate infer configurations */
422-
rc = ietf_interfaces_cand_init(&confd);
422+
rc = interfaces_cand_init(&confd);
423423
if (rc)
424424
goto err;
425425

426-
rc = ietf_hardware_candidate_init(&confd);
426+
rc = hardware_candidate_init(&confd);
427427
if (rc)
428428
goto err;
429429

430-
rc = infix_firewall_candidate_init(&confd);
430+
rc = firewall_candidate_init(&confd);
431431
if (rc)
432432
goto err;
433433

434-
rc = infix_dhcp_server_candidate_init(&confd);
434+
rc = dhcp_server_candidate_init(&confd);
435435
if (rc)
436436
goto err;
437437
/* YOUR_INIT GOES HERE */

src/confd/src/core.h

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -184,67 +184,67 @@ static inline int register_rpc(sr_session_ctx_t *session, const char *xpath,
184184

185185

186186
/* interfaces.c */
187-
int ietf_interfaces_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
188-
int ietf_interfaces_cand_init(struct confd *confd);
187+
int interfaces_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
188+
int interfaces_cand_init(struct confd *confd);
189189

190190
/* syslog.c */
191-
int ietf_syslog_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
191+
int syslog_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
192192

193193
/* system.c */
194-
int ietf_system_rpc_init (struct confd *confd);
194+
int system_rpc_init (struct confd *confd);
195195
int hostnamefmt (struct confd *confd, const char *fmt, char *hostnm, size_t hostlen, char *domain, size_t domlen);
196-
int ietf_system_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
196+
int system_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
197197

198198
/* containers.c */
199199
#ifdef CONTAINERS
200-
int infix_containers_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
201-
int infix_containers_rpc_init(struct confd *confd);
200+
int containers_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
201+
int containers_rpc_init(struct confd *confd);
202202
#else
203-
static inline int infix_containers_rpc_init(struct confd *confd) { return 0; }
204-
static inline int infix_containers_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd) { return 0; }
203+
static inline int containers_rpc_init(struct confd *confd) { return 0; }
204+
static inline int containers_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd) { return 0; }
205205
#endif
206206

207207
/* dhcp-client.c */
208-
int infix_dhcp_client_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
208+
int dhcp_client_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
209209

210210
/* dhcpv6-client.c */
211-
int infix_dhcpv6_client_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
211+
int dhcpv6_client_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
212212

213213
/* dhcp-server.c */
214-
int infix_dhcp_server_candidate_init(struct confd *confd);
215-
int infix_dhcp_server_rpc_init(struct confd *confd);
216-
int infix_dhcp_server_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
214+
int dhcp_server_candidate_init(struct confd *confd);
215+
int dhcp_server_rpc_init(struct confd *confd);
216+
int dhcp_server_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
217217

218218
/* ietf-routing */
219-
int ietf_routing_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
219+
int routing_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
220220

221221
/* factory.c */
222-
int infix_factory_rpc_init(struct confd *confd);
222+
int factory_rpc_init(struct confd *confd);
223223

224224
/* ietf-factory-default */
225-
int ietf_factory_default_rpc_init(struct confd *confd);
225+
int factory_default_rpc_init(struct confd *confd);
226226

227227
/* meta.c */
228-
int infix_meta_change_cb(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
228+
int meta_change_cb(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
229229

230230
/* system-software.c */
231-
int infix_system_sw_rpc_init(struct confd *confd);
231+
int system_sw_rpc_init(struct confd *confd);
232232

233233
/* services.c */
234-
int infix_services_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
234+
int services_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
235235

236236
/* hardware.c */
237-
int ietf_hardware_candidate_init(struct confd *confd);
238-
int ietf_hardware_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
237+
int hardware_candidate_init(struct confd *confd);
238+
int hardware_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
239239

240240
/* keystore.c */
241241
#define SSH_HOSTKEYS "/etc/ssh/hostkeys"
242242
#define SSH_HOSTKEYS_NEXT SSH_HOSTKEYS"+"
243-
int ietf_keystore_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
243+
int keystore_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
244244

245245
/* firewall.c */
246-
int infix_firewall_rpc_init(struct confd *confd);
247-
int infix_firewall_candidate_init(struct confd *confd);
248-
int infix_firewall_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
246+
int firewall_rpc_init(struct confd *confd);
247+
int firewall_candidate_init(struct confd *confd);
248+
int firewall_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd);
249249

250250
#endif /* CONFD_CORE_H_ */

src/confd/src/dhcp-client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static void del(const char *ifname)
167167
systemf("initctl -bfq delete dhcp-client-%s", ifname);
168168
}
169169

170-
int infix_dhcp_client_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff,
170+
int dhcp_client_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff,
171171
sr_event_t event, struct confd *confd)
172172
{
173173
struct lyd_node *ifaces, *difaces, *iface, *diface, *ipv4, *dhcp, *ddhcp;

src/confd/src/dhcp-common.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* SPDX-License-Identifier: BSD-3-Clause */
22

3-
#ifndef INFIX_DHCP_COMMON_H_
4-
#define INFIX_DHCP_COMMON_H_
3+
#ifndef DHCP_COMMON_H_
4+
#define DHCP_COMMON_H_
55

66
#include <libyang/libyang.h>
77

@@ -16,4 +16,4 @@ char *dhcp_compose_options(struct lyd_node *cfg, const char *ifname, char **opti
1616
struct lyd_node *id, const char *val, const char *hex,
1717
char *(*ip_cache_cb)(const char *, char *, size_t));
1818

19-
#endif /* INFIX_DHCP_COMMON_H_ */
19+
#endif /* DHCP_COMMON_H_ */

src/confd/src/dhcp-server.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static void del(const char *subnet, struct lyd_node *cfg)
295295
ERRNO("Failed switching to new %s", DNSMASQ_LEASES);
296296
}
297297

298-
int infix_dhcp_server_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd)
298+
int dhcp_server_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd)
299299
{
300300
struct lyd_node *global, *cifs, *difs, *cif, *dif;
301301
int enabled = 0, added = 0, deleted = 0;
@@ -450,7 +450,7 @@ static int clear_stats(sr_session_ctx_t *session, uint32_t sub_id, const char *x
450450
return SR_ERR_OK;
451451
}
452452

453-
int infix_dhcp_server_candidate_init(struct confd *confd)
453+
int dhcp_server_candidate_init(struct confd *confd)
454454
{
455455
int rc;
456456

@@ -462,7 +462,7 @@ int infix_dhcp_server_candidate_init(struct confd *confd)
462462
return rc;
463463
}
464464

465-
int infix_dhcp_server_rpc_init(struct confd *confd)
465+
int dhcp_server_rpc_init(struct confd *confd)
466466
{
467467
int rc;
468468

src/confd/src/dhcpv6-client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static void del_v6(const char *ifname)
112112
systemf("initctl -bfq delete dhcpv6-client-%s", ifname);
113113
}
114114

115-
int infix_dhcpv6_client_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff,
115+
int dhcpv6_client_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff,
116116
sr_event_t event, struct confd *confd)
117117
{
118118
struct lyd_node *ifaces, *difaces, *iface, *diface, *ipv6, *dhcp, *ddhcp;

src/confd/src/factory-default.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static int factory_reset(sr_session_ctx_t *session, uint32_t sub_id, const char
1616
return 0;
1717
}
1818

19-
int ietf_factory_default_rpc_init(struct confd *confd)
19+
int factory_default_rpc_init(struct confd *confd)
2020
{
2121
int rc;
2222

src/confd/src/factory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static int rpc(sr_session_ctx_t *session, uint32_t sub_id, const char *xpath,
3333
return rc;
3434
}
3535

36-
int infix_factory_rpc_init(struct confd *confd)
36+
int factory_rpc_init(struct confd *confd)
3737
{
3838
int rc;
3939
REGISTER_RPC(confd->session, "/infix-factory-default:factory-default", rpc, NULL, &confd->fsub);

src/confd/src/firewall.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ static int infer_policy(sr_session_ctx_t *session, const char *name, const char
480480
}
481481
#endif
482482

483-
int infix_firewall_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd)
483+
int firewall_change(sr_session_ctx_t *session, struct lyd_node *config, struct lyd_node *diff, sr_event_t event, struct confd *confd)
484484
{
485485
struct lyd_node *tree, *global;
486486
struct lyd_node *clist, *cnode;
@@ -534,7 +534,7 @@ int infix_firewall_change(sr_session_ctx_t *session, struct lyd_node *config, st
534534
}
535535

536536
/* Get L3 interfaces for default zone assignment */
537-
if (ietf_interfaces_get_all_l3(tree, &ifaces) != 0) {
537+
if (interfaces_get_all_l3(tree, &ifaces) != 0) {
538538
ERROR("Failed to get L3 interfaces");
539539
ifaces = NULL;
540540
}
@@ -711,7 +711,7 @@ static int lockdown(sr_session_ctx_t *session, uint32_t sub_id, const char *xpat
711711
return SR_ERR_OK;
712712
}
713713

714-
int infix_firewall_rpc_init(struct confd *confd)
714+
int firewall_rpc_init(struct confd *confd)
715715
{
716716
int rc;
717717

@@ -724,7 +724,7 @@ int infix_firewall_rpc_init(struct confd *confd)
724724
}
725725

726726

727-
int infix_firewall_candidate_init(struct confd *confd)
727+
int firewall_candidate_init(struct confd *confd)
728728
{
729729
int rc;
730730

0 commit comments

Comments
 (0)