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

isisd: Command "show isis interface IFNAME json" displays all interfaces's circuit id. #17158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

baozhen-H3C
Copy link
Contributor

@baozhen-H3C baozhen-H3C commented Oct 18, 2024

The change is only to skip showing circuits that do not have any interfaces assigned.

Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put the outputs before/after in the commit message?

isisd/isisd.c Outdated Show resolved Hide resolved
@@ -955,6 +955,8 @@ void isis_circuit_print_json(struct isis_circuit *circuit,
char buf_prx[INET6_BUFSIZ];
char buf[255];

json_object_int_add(json, "circuit", circuit->circuit_id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add this value a second time, with a new key - isn't it being added just below with "circuit-id"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to print the circuit_id only when printing a specific interface, if this modification is allowed.

@baozhen-H3C baozhen-H3C force-pushed the 202410180184 branch 2 times, most recently from 09dc643 to 0a845f7 Compare October 21, 2024 03:00
@ton31337
Copy link
Member

@baozhen-H3C please put the description in the commit, not in the PR's description.

@ton31337
Copy link
Member

So, is this change only to skip showing circuits that do not have any interfaces assigned?

@baozhen-H3C
Copy link
Contributor Author

@ton31337 Yes, it now seems unnecessary.Perhaps what I'm doing is pointless.

@ton31337
Copy link
Member

@ton31337 Yes, it now seems unnecessary.Perhaps what I'm doing is pointless.

TBH, this is kinda of a breaking change (at some level).

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waiting on the other comments, otherwise good

… ID of all interfaces

1.before the commit
if the interface exists:
sonic# show isis interface lo json
{
 "areas":[
   {
     "area":"10",
     "circuits":[
       {
         "circuit":13
       },
       {
         "circuit":14
       },
       {
         "circuit":0,
         "interface":{
           "name":"lo",
           "state":"Up",
           "is-passive":"passive",
           "circuit-id":"0x0",
           "type":"loopback",
           "level":"L1",
           "levels":[
             {
               "level":"L1",
               "metric":10
             }
           ],
           "ip-prefix":{
             "ip":"7.7.7.7/32"
           }
         }
       }
     ]
   }
 ]
}

if the interface doesn't exist:
sonic# show isis interface abc json
{
 "areas":[
   {
     "area":"10",
     "circuits":[
       {
         "circuit":13
       },
       {
         "circuit":14
       },
       {
         "circuit":0
       }
     ]
   }
 ]
}

2.after the commit
if the interface exists:
sonic# show isis interface lo json
{
 "areas":[
   {
     "area":"10",
     "circuits":[
       {
         "circuit":0,
         "interface":{
           "name":"lo",
           "state":"Up",
           "is-passive":"passive",
           "circuit-id":"0x0",
           "type":"loopback",
           "level":"L1",
           "levels":[
             {
               "level":"L1",
               "metric":10
             }
           ],
           "ip-prefix":{
             "ip":"7.7.7.7/32"
           }
         }
       }
     ]
   }
 ]
}

if the interface doesn't exist:
sonic# show isis interface abc json
{
 "areas":[
   {
     "area":"10",
     "circuits":[
     ]
   }
 ]
}

Signed-off-by: baozhen-H3C <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants