Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua stack dumping #16676

Merged

Conversation

ton31337
Copy link
Member

No description provided.

Lua technically enumerates arrays from 1, not 0.

Signed-off-by: Donatas Abraitis <[email protected]>
Very handy for debugging.

In Lua script just use "log.trace(table)":

```
function on_rib_process_dplane_results(ctx)
	log.trace(ctx.rinfo.zd_ng)
end
```

You will get something like:

```
Aug 28 17:04:36 donatas-laptop zebra[3782199]: [GCZ7N-MM9D9] {
                                                 1: {
                                                   type: 2
                                                   weight: 1
                                                   flags: 5
                                                   backup_idx: 0
                                                   vrf_id: 0
                                                   nh_encap_type: 0
                                                   gate: {
                                                     value: 5.87967e+08
                                                     string: "192.168.11.35"
                                                   }
                                                   nh_label_type: 0
                                                   srte_color: 0
                                                   ifindex: 0
                                                   backup_num: 0
                                                 }
                                                 2: {
                                                   type: 3
                                                   weight: 1
                                                   flags: 3
                                                   backup_idx: 0
                                                   vrf_id: 0
                                                   nh_encap_type: 0
                                                   nh_label_type: 0
                                                   srte_color: 0
                                                   ifindex: 4
                                                   backup_num: 0
                                                 }
                                               }
```

Signed-off-by: Donatas Abraitis <[email protected]>
@frrbot frrbot bot added the libfrr label Aug 28, 2024
@donaldsharp donaldsharp merged commit 8e4389d into FRRouting:master Aug 28, 2024
14 checks passed
@ton31337 ton31337 deleted the fix/lua_nexthop_handling_in_lua branch August 28, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants