Re: [j-nsp] Multi Core on JUNOS?

2015-10-23 Thread Stepan Kucherenko


On 22.10.2015 22:37, Phil Shafer wrote:
> Stepan Kucherenko writes:
>> What else...oh, annotate ! It's clunky and not very easy to use.
> 
> Yes, annotate is a sore spot.  I made the grammar production:
> 
>  K_ANNOTATE annotate_target T_STRING
> 
> with the expectation that I'd be able to coerce a path into the
> target, but it didn't happen.  I should have done it as:
> 
>  K_ANNOTATE T_STRING annotate_target
> 
> and then allow anything as a target, like:
> 
>  cli# annotate "Client X" interfaces ge-0/0/0.0 family inet address 
> 1.2.3.4/5
> 
> but can't make that work without making a new command ("comment"?).
> 
>> I wish we could just add a comment in the end of a line instead, like
>> "set interface ge-0/0/0.0 family inet address x.x.x.x/y //client X" and
>> then see "x.x.x.x/y //client X" and the same line when asking for
>> |display set.
> 
> We generate line comments in JUNOS, so we need to discard them (and
> comments before close braces) to prevent out-of-date comments from
> getting loaded as real annotations.
> 
> Hmm  I should make a M-, keybinding to copy all arguments from the
> previous command so you can:
> 
>  [edit interfaces ge-0/0/0 unit 0]
>  cli# set family inet address 1.2.3.4/5
> 
>  [edit interfaces ge-0/0/0 unit 0]
>  cli# comment "Client X" [ESC-,]
> 
> and it will insert the "family inet address 1.2.3.4/5" from
> the previous "set" command.
> 
> This is similar to the existing M-. and M-/ bindings.

So when we say show interfaces ge-0/0/0.0 we'll see something like

family inet {
/* Client X */
address 1.2.3.4/5;
}

But let's say we want to add another address for another client

[edit interfaces ge-0/0/0 unit 0]
cli# set family inet address 6.7.8.9/10

[edit interfaces ge-0/0/0 unit 0]
сli# comment "Client Y" [ESC-,]

family inet {
/* Client Y */
address 1.2.3.4/5;
address 6.7.8.9/10;
}

Correct ?

I was thinking of something like that:

[edit]
cli# set interfaces ge-0/0/0.0 family inet address 1.2.3.4/5 // Client X //

[edit]
cli# set interfaces ge-0/0/0.0 family inet address 6.7.8.9/10 // Client Y //

[edit]
cli# show interfaces ge-0/0/0.0
family inet {
address 1.2.3.4/5;   // Client X //
address 6.7.8.9/10;   // Client Y //
}

Or maybe set interfaces ge-0/0/0.0 family inet address 1.2.3.4/5 comment 
"Client X"  instead of "//", or /* Client X */ in "show" output, whatever, 
it'll be cosmetic anyway.

Basically the same as descr command but available at any hierarchy level for 
any element but which doesn't use a separate line. Configurations are way too 
big already and separate line comments will eat into precious screen real 
estate.


It'll be easier to parse, easier to work with, will stay in the configuration 
with the same rules as everything else, it'll be deleted after deleting the 
element it comments and it won't be necessary to say "edit interfaces 
ge-0/0/0.0" first to work with it, you'll be able to do it from top (inability 
to do that probably annoys me the most in annotate).




Maybe even something like 

set protocols bgp group ix-v4 type external import [ reject-some-prefixes 
///don't like them// set-community //for further filtering// ] peer-as X 
neighbor 1.2.4.5 //location// export customers-only //please don't delete this//

then if we say show protocols bgp group ix-v4 we'll get:

type external;
import [ reject-some-prefixes ///don't like them// set-community //for further 
filtering// ];
peer-as X;
neighbor 1.2.4.5 //location// {
export customers-only; //please don't delete this//
}


Or with |display set:

set protocols bgp group ix-iv type external
set protocols bgp group ix-iv import reject-some-prefixes ///don't like them//
set protocols bgp group ix-iv import set-community //for further filtering//
set protocols bgp group ix-iv peer-as X
set protocols bgp group ix-iv neighbor 1.2.4.5 //location// 
set protocols bgp group ix-iv neighbor 1.2.4.5 export customers-only //please 
don't delete this//

Makes sense ? 


___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp

Re: [j-nsp] Multi Core on JUNOS?

2015-10-23 Thread Phil Shafer
Stepan Kucherenko writes:
>But let's say we want to add another address for another client
>
>[edit interfaces ge-0/0/0 unit 0]
>cli# set family inet address 6.7.8.9/10
>
>[edit interfaces ge-0/0/0 unit 0]
>сli# comment "Client Y" [ESC-,]
>
>family inet {
>/* Client Y */
>address 1.2.3.4/5;
>address 6.7.8.9/10;
>}
>
>Correct ?

No, each object in the database can have its own comment attached,
and since the two addresses are distinct objects, each can carry a
comment, like:

[edit]
phil@dent# show interfaces
ge-0/0/0 {
unit 0 {
family inet {
/* one */
address 10.1.2.3/30;
/* two */
address 10.4.5.6/30;
}
}
}

>set protocols bgp group ix-v4 type external import [ reject-some-prefixes 
>///don't like 
>them// set-community //for further filtering// ] peer-as X neighbor 1.2.4.5 
>//location//
> export customers-only //please don't delete this//

Personally, I dislike this.  It makes command lines less readable and
more likely to cause errors.

But along the same line, I have kicked around the idea of making
"load" be truly interactive, so I could to stuff like:

[edit]
cli# load terminal merge interactive
[Type ^D at a new line to end input]
protocols bgp group foo local?
Possible completions:
  local-addressAddress of local end of BGP session
> local-as Local autonomous system number
  local-interface  Local interface for IPv6 link local EBGP peering
  local-preference Value of LOCAL_PREF path attribute
protocols bgp group foo local-as ?
Possible completions:
Autonomous system number in plain number or 'higher 
16bits'.'Lower 16 bits' (asdot notation) format
  aliasTreat this AS as an alias to the system AS
  loopsMaximum number of times this AS can be in an AS path 
(1..10)
  no-prepend-global-as  Do not prepend global autonomous-system number in 
advertised paths
  private  Hide this local AS in paths learned from this peering
protocols bgp group foo local-as 42;
^D
load complete

This would allow set-ish style (since the UI really doesn't need the
braces on input) as well as allowing the placement of comments:

[edit]
cli# load terminal merge interactive
[Type ^D at a new line to end input]
protocols bgp /* foo is cool */ group foo /* local-as is also */ local-as 42;
/* You can also put braces here */
protocols {
   bgp {
  /* goo is not */
  group goo { local-as 51; }}}
^D
load complete


But I need to work out what (and how) would get redrawn when you
type "?" deep under braces (like at the "51" above).  I can't emit
the [edit] line, but just redrawing the current line doesn't give
the context the way I'd like it to.  Perhaps a distinct key to give
the content-as-edit-line?

Thanks,
 Phil
___
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp