# Actionpoint Registration

**URL:** <https://dmap-community.ductus.global/t/actionpoint-registration/2536>\
**Category:** CDB and CDB API\
**Created:** [June 13, 2019, 9:34am UTC](https://dmap-community.ductus.global/t/actionpoint-registration/2536 "2019-06-13T09:34:14Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ramakrishnan](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Ramakrishnan](https://dmap-community.ductus.global/u/Ramakrishnan)\
**Post date:** [June 13, 2019, 9:34am UTC](https://dmap-community.ductus.global/t/actionpoint-registration/2536/1 "2019-06-13T09:34:14Z")

</div>

I have the following actionpoint registered in my .ann file

> ```
> tailf:annotate "/ni:network-instances/ni:network-instance/ni:loopback" {
> tailf:actionpoint loopback-point;
> }
> 
> ```

Main .yang file

> ```
> list network-instance {
> key "name";
> description
> "List of network-instances.";
> ...
> action loopback {
> description "Loopback";
> leaf name {
> type string;
> }
> 
> }
> }//action loopback
> 
> ```

Integrating action support for loopback-poin

> ```
> //register the stream for actions to confd 
> struct confd_action_cbs ActionCallBack;
> memset(&ActionCallBack, 0, sizeof(ActionCallBack));
> strcpy(ActionCallBack.actionpoint, "loopback-point");
> ActionCallBack.init = ConfDAdaptorManager::init_action;
> ActionCallBack.abort = NULL;
> ActionCallBack.action = ConfDAdaptorManager::do_action;
> ActionCallBack.command = NULL;
> ActionCallBack.completion = NULL;
> ActionCallBack.cb_opaque = NULL;
> 
> if (confd_register_action_cbs(m_ConfigDeamonContext, &ActionCallBack) != CONFD_OK)
> {
> LERROR(netConfTraceP, <<"ConfDAdaptorManager::Init confd_register_action_cbs FAILED " );
> }
> else
> {
> DEBUG(netConfTraceP, <<"ConfDAdaptorManager::Init confd_register_action_cbs was done " );
> }
> 
> confd_register_done(m_ConfigDeamonContext);
> 
> ```

**The` confd\_register\_action\_cbs gets successfully executed**

In confd\_devel log I get this:

> 13-Jun-2019::15:01:40.387 localhost confd[846]: devel-c Daemon ‘ConfdAdaptor’ registered for non-existing actionpoint ‘loopback-point’

Why is this error being seen?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Ramakrishnan](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Ramakrishnan](https://dmap-community.ductus.global/u/Ramakrishnan)\
**Post date:** [June 14, 2019, 4:10am UTC](https://dmap-community.ductus.global/t/actionpoint-registration/2536/2 "2019-06-14T04:10:47Z")

</div>

Can someone please answer the above question?

---

<div class="post-metadata">

**Author:** ![jaka](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jaka](https://dmap-community.ductus.global/u/jaka)\
**Post date:** [June 14, 2019, 7:14am UTC](https://dmap-community.ductus.global/t/actionpoint-registration/2536/3 "2019-06-14T07:14:15Z")

</div>

Have you tried  
strcpy(ActionCallBack.actionpoint, “loopback”);

---

<div class="post-metadata">

**Author:** ![Ramakrishnan](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Ramakrishnan](https://dmap-community.ductus.global/u/Ramakrishnan)\
**Post date:** [June 14, 2019, 10:32am UTC](https://dmap-community.ductus.global/t/actionpoint-registration/2536/4 "2019-06-14T10:32:59Z")

</div>

It does not work. I get the following in confd\_devel.log  
`

> 14-Jun-2019::16:17:31.009 localhost confd[843]: devel-c Daemon ‘ConfdAdaptor’ registered for non-existing actionpoint loopback`

Please help fix this problem.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![per](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@per](https://dmap-community.ductus.global/u/per)\
**Post date:** [June 14, 2019, 11:15am UTC](https://dmap-community.ductus.global/t/actionpoint-registration/2536/5 "2019-06-14T11:15:40Z")

</div>

Disregarding the errors in your YANG snippets (e.g. `annotate` instead of `tailf:annotate`), which I assume are due to writing “from memory” instead of just cut&paste’ing from your actual modules (I don’t see why people do that, but you’re certainly not the only one:-), the most likely cause of your problem is that you haven’t actually used your annotation module when compiling the main module.

A simple way to check this, that doesn’t require starting up ConfD or your application, is to create a .h file from the .fxs (perhaps you do that anyway) - it should include #defines for all actionpoints, callpoints, etc. Demo:

```auto
$ confdc -c -a ni-ann.yang ni.yang
$ confdc --emit-h ni.h ni.fxs
$ grep point ni.h
#define ni__actionpointid_loopback_point "loopback-point"

```

Do you have such a #define in your .h file? By the way, it is a good idea to actually use the defined symbol instead of the string in your code - that way you avoid spelling errors, since they will be caught by your (C) compiler. But using the string should also work fine.

Edit: Sorry, I see that you actually had `tailf:annotate`, it was just that scrolling the snippet sideways in my browser caused exactly the `tailf:` part to “disappear”…

---

<div class="post-metadata">

**Author:** ![Ramakrishnan](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Ramakrishnan](https://dmap-community.ductus.global/u/Ramakrishnan)\
**Post date:** [June 14, 2019, 11:50am UTC](https://dmap-community.ductus.global/t/actionpoint-registration/2536/6 "2019-06-14T11:50:13Z")

</div>

Hi,

After jaka’s suggestion to try

> strcpy(ActionCallBack.actionpoint, “loopback”);

I removed the ‘-’ from loopback-point to be on the safe side and avoid any issues due to ‘-’

Anyway, I have my .h with the correct definition

`#define ni__actionpointid_loopback "loopback"`

Moreover, when I try to configure using confd\_cli I get the following:

```
localhost(config-network-instance-x)# loopback name hi
Error: not yet implemented

```

I assume the above is directly related to the error message found in confd\_devel.log as below:

`<ERR> 14-Jun-2019::16:54:48.329 localhost confd[843]: devel-c Daemon 'ConfdAdaptor' registered for non-existing actionpoint loopback`

Please suggest something else.  
Thanks in advance.

PS: I spent a minute finding the annotate without tailf:

---

<div class="post-metadata">

**Author:** ![josephm](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@josephm](https://dmap-community.ductus.global/u/josephm)\
**Post date:** [June 14, 2019, 12:00pm UTC](https://dmap-community.ductus.global/t/actionpoint-registration/2536/7 "2019-06-14T12:00:16Z")

</div>

Double check that you really have definition of actionpoint in executed fxs files/models.  
Try running “`confd --status`” command in bash, and look into “`actionpoints:`” section, you should see something like this:  
(I copy&pasted actionpoint names/status examples from ConfD example - `intro/7-c_actions`)

```
actionpoints:
  id=reboot-point ** not registered

```

when you don’t have data provider registered, or, in case you already do:

```
actionpoints:
  id=reboot-point daemonId=0 daemonName=actions_daemon callbacks=get_next,get_elem,exists
```

---

<div class="post-metadata">

**Author:** ![per](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@per](https://dmap-community.ductus.global/u/per)\
**Post date:** [June 14, 2019, 12:40pm UTC](https://dmap-community.ductus.global/t/actionpoint-registration/2536/8 "2019-06-14T12:40:31Z")

</div>

> [@Ramakrishnan](#):
>
> ```auto
> localhost(config-network-instance-x)# loopback name hi
> Error: not yet implemented
> 
> ```

Actually, this error means exactly that there is _no_ actionpoint _in the model_. If there is an actionpoint, but it hasn’t been registered for, you would get an “application communication failure” error when ConfD attemps to invoke your callback - the problem would also be logged with more details in the devel.log.

> [@Ramakrishnan](#):
>
> Anyway, I have my .h with the correct definition
> 
> `#define ni__actionpointid_loopback "loopback"`

In that case it seems that this .h file was not generated from the .fxs that you are actually loading into ConfD. One possibility (rather far-fetched) for that could be that you generate the .h from the .yang file, using the annotation module, and then compile the .yang to .fxs _without_ the annotation module:

```auto
$ confdc --emit-h ni.h -a ni-ann.yang ni.yang
$ confdc -c ni.yang
$ confdc --emit-h ni2.h ni.fxs
$ grep point ni*.h
ni.h:#define ni__actionpointid_loopback_point "loopback-point"

```

I.e. in that case there would be no actionpoint in the .fxs, as demonstrated by the ni2.h file not having the #define (while ni.h does). Please review the exact steps you are taking, starting with the .yang file, up to the point where you provide the .fxs file for ConfD to load.

---

<div class="post-metadata">

**Author:** ![Ramakrishnan](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Ramakrishnan](https://dmap-community.ductus.global/u/Ramakrishnan)\
**Post date:** [June 17, 2019, 4:58am UTC](https://dmap-community.ductus.global/t/actionpoint-registration/2536/9 "2019-06-17T04:58:33Z")

</div>

Thanks. It works now.

---

<div class="post-metadata">

**Author:** ![herenkeskin](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/herenkeskin/32/305_2.png) [@herenkeskin](https://dmap-community.ductus.global/u/herenkeskin)\
**Post date:** [September 9, 2020, 9:02pm UTC](https://dmap-community.ductus.global/t/actionpoint-registration/2536/10 "2020-09-09T21:02:45Z")

</div>

If there is a 2 or more actionpoints, can i register in a only one registration operation?

Or how can i use it?

---

<div class="post-metadata">

**Author:** ![greg](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@greg](https://dmap-community.ductus.global/u/greg)\
**Post date:** [September 14, 2020, 4:02pm UTC](https://dmap-community.ductus.global/t/actionpoint-registration/2536/11 "2020-09-14T16:02:37Z")

</div>

You can take a look at $CONFD\_DIR/examples.confd/intro/7-c\_actions for how registration works. When you register the callbacks for the action you call confd\_register\_action\_cbs(). You can set up separate sets of callback functions for the different actions, and call this again for a second action. Once you are done registering all the actions that this application will handle, then you can call confd\_register\_done() so that ConfD knows that your application is finished with the registration, and the application is ready to begin processing actions.

Note too that in this example, the same actionpoint is used for multiple actions, so that you don’t need to necessarily have a separate action handler for each action.
