Jump to content
Sign in to follow this  
atnextc

GUI CTRL Create Edit Erasing Information When Scrolling

Recommended Posts

atnextc

Hello all,

I have a script that I created to help with our router configs at work. The script is working as expected, but there are a few small issues.

Pressing "Clear" after you have input information in the input boxes "works" but some times its messing with the format of the "edit box" on the right. Also some times its not clearing all the data on the right.

Also, I can't figure out how to get "save" working.

script included. Any help would be appreciated.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiEdit.au3>
$_1 = GUICreate("Cox Public Peering Turn Up", 920, 614, 191, 123)
$Label1 = GUICtrlCreateLabel("Cox Multipath Private BGP Turn Up", 208, 24, 397, 33)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
$Router = GUICtrlCreateInput("", 136, 128, 84, 21)
$Circuit = GUICtrlCreateInput("", 136, 158, 84, 21)
$Peer = GUICtrlCreateInput("", 136, 184, 84, 21)
$PeerA = GUICtrlCreateInput("", 136, 216, 84, 21)
$Interface = GUICtrlCreateInput("", 136, 246, 84, 21)
$IPv4 = GUICtrlCreateInput("", 136, 272, 84, 21)
$IPv4SubnetMask = GUICtrlCreateInput("", 136, 304, 84, 21)
$IPv6 = GUICtrlCreateInput("", 136, 336, 84, 21)
$IPv6SubnetMask = GUICtrlCreateInput("", 136, 368, 84, 21)
$md5 = GUICtrlCreateInput("", 136, 400, 84, 21)
$LocIP = GUICtrlCreateInput("", 136, 432, 81, 21)
$LocalIP6 = GUICtrlCreateInput("", 136, 464, 81, 21)
$Submit = GUICtrlCreateButton("Submit", 136, 504, 97, 33)
$RouterName = GUICtrlCreateLabel("Router Name", 40, 132, 94, 17)
$Label3 = GUICtrlCreateLabel("Interface", 40, 249, 73, 17)
$Label4 = GUICtrlCreateLabel("Peer Name", 40, 186, 84, 17)
$V4IP = GUICtrlCreateLabel("Peer v4 IP", 40, 276, 56, 17)
$Label5 = GUICtrlCreateLabel("Peer v4 Mask", 40, 306, 72, 17)
$v6IP = GUICtrlCreateLabel("Peer v6 IP", 40, 338, 56, 17)
$v6Mask = GUICtrlCreateLabel("Peer v6 Mask", 40, 370, 72, 17)
$PeerAS = GUICtrlCreateLabel("Peer AS", 40, 218, 70, 17)
$Label6 = GUICtrlCreateLabel("Circuit ID", 40, 162, 74, 17)
$MD5key = GUICtrlCreateLabel("MD5 Key", 40, 402, 75, 17)
$LocalIP = GUICtrlCreateLabel("Local v4 IP", 40, 434, 70, 17)
$LocaIP6 = GUICtrlCreateLabel("Local v6 IP", 40, 466, 58, 17)
$Clear = GUICtrlCreateButton("Clear", 24, 504, 99, 33)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   ExitLoop
  Case $Clear
   _GUICtrlEdit_SetText($md5, "")
   _GUICtrlEdit_SetText($Interface, "")
   _GUICtrlEdit_SetText($IPv4, "")
   _GUICtrlEdit_SetText($IPv4SubnetMask, "")
   _GUICtrlEdit_SetText($IPv6, "")
   _GUICtrlEdit_SetText($IPv6SubnetMask, "")
   _GUICtrlEdit_SetText($Router, "")
   _GUICtrlEdit_SetText($Peer, "")
   _GUICtrlEdit_SetText($PeerA, "")
   _GUICtrlEdit_SetText($LocIP, "")
   _GUICtrlEdit_SetText($LocalIP6, "")
   _GUICtrlEdit_SetText($Circuit, "")
   $CircuitRead = GUICtrlRead($Circuit);Reads the value of the Circuit ID input Box
   $InterfaceRead = GUICtrlRead($Interface);Reads the value of the Interface ID input Box
   $PeerRead = GUICtrlRead($Peer);Reads the value of the Peer Name ID input Box
   $ASRead = GUICtrlRead($PeerA);Reads the value of the Peer Name ID input Box
   $RouterRead = GUICtrlRead($Router)
   $IPv4Read = GUICtrlRead($IPv4);Reads the value of the IP v 4 ID input Box
   $IPv4SubnetMaskRead = GUICtrlRead($IPv4SubnetMask);Reads the value of the IP v4 Subnet ID input Box
   $IPv6Read = GUICtrlRead($IPv6);Reads the value of the IP v 6 ID input Box
   $IPv6SubnetMaskRead = GUICtrlRead($IPv6SubnetMask);Reads the value of the IP v6 Subnet ID input Box
   $LocalIPRead = GUICtrlRead($LocIP);Reads the value of the IP v6 Subnet ID input Box
   $MD5Read = GUICtrlRead($MD5);Reads the value of the IP v6 Subnet ID input Box
   $LocalIP6Read = GUICtrlRead($LocalIP6);Reads the value of the IP v6 Subnet ID input Box
   $MOP = GUICtrlCreateEdit($RouterRead & @CRLF  & @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 description "";" & $CircuitRead & ";Peer " & $PeerRead & ' (AS ' & $ASRead & ");;MR;10GE To " & $PeerRead &' (AS ' & $ASRead & ")"""& @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet mtu 1500"& @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet filter input EDGE-IN"& @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet filter output EDGE-OUT"& @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet address " & $LocalIPRead & "/" & $IPv4SubnetMaskRead& @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet6 filter input EDGE-INV6"& @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet6 filter output EDGE-OUTV6"& @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet6 address " & $LocalIP6Read & "/" & $IPv6SubnetMaskRead& @CRLF & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & " description ""Peering with " & $PeerRead & ' (AS ' & $ASRead & ")"""&@CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & " local-address " & $LocalIPRead &@CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & " authentication-key " & $MD5Read&@CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & " peer-as " & $ASRead&@CRLF &@CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & " description ""Peering with " & $PeerRead & ' (AS ' & $ASRead & ")"""&@CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & " local-address " & $LocalIP6Read &@CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & " authentication-key " & $MD5Read&@CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & " peer-as " & $ASRead&@CRLF &@CRLF & "show | compare"& @CRLF & "commit check"& @CRLF &"commit sync and quit"& @CRLF & "show log messages | last" & @CRLF & @CRLF & "ping " & $IPv4Read & " rapid count 1000"& @CRLF & "show bgp neighbor "&  $IPv4Read & @CRLF & @CRLF & "ping " & $IPv6Read & " rapid count 1000"& @CRLF & "show bgp neighbor " & $IPv6Read ,248, 128, 641, 353)

  Case $Submit
   $CircuitRead = GUICtrlRead($Circuit);Reads the value of the Circuit ID input Box
   $InterfaceRead = GUICtrlRead($Interface);Reads the value of the Interface ID input Box
   $PeerRead = GUICtrlRead($Peer);Reads the value of the Peer Name ID input Box
   $ASRead = GUICtrlRead($PeerA);Reads the value of the Peer Name ID input Box
   $RouterRead = GUICtrlRead($Router)
   $IPv4Read = GUICtrlRead($IPv4);Reads the value of the IP v 4 ID input Box
   $IPv4SubnetMaskRead = GUICtrlRead($IPv4SubnetMask);Reads the value of the IP v4 Subnet ID input Box
   $IPv6Read = GUICtrlRead($IPv6);Reads the value of the IP v 6 ID input Box
   $IPv6SubnetMaskRead = GUICtrlRead($IPv6SubnetMask);Reads the value of the IP v6 Subnet ID input Box
   $LocalIPRead = GUICtrlRead($LocIP);Reads the value of the IP v6 Subnet ID input Box
   $MD5Read = GUICtrlRead($MD5);Reads the value of the IP v6 Subnet ID input Box
   $LocalIP6Read = GUICtrlRead($LocalIP6);Reads the value of the IP v6 Subnet ID input Box
   $CopyClipboard = GUICtrlCreateButton("Copy To Clipboard", 776, 504, 113, 33)
   $Save = GUICtrlCreateButton("Save", 664, 504, 97, 33)
$MOP = GUICtrlCreateEdit($RouterRead & @CRLF  & @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 description "";" & $CircuitRead & ";Peer " & $PeerRead & ' (AS ' & $ASRead & ");;MR;10GE To " & $PeerRead &' (AS ' & $ASRead & ")"""& @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet mtu 1500"& @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet filter input EDGE-IN"& @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet filter output EDGE-OUT"& @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet address " & $LocalIPRead & "/" & $IPv4SubnetMaskRead& @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet6 filter input EDGE-INV6"& @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet6 filter output EDGE-OUTV6"& @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet6 address " & $LocalIP6Read & "/" & $IPv6SubnetMaskRead& @CRLF & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & " description ""Peering with " & $PeerRead & ' (AS ' & $ASRead & ")"""&@CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & " local-address " & $LocalIPRead &@CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & " authentication-key " & $MD5Read&@CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & " peer-as " & $ASRead&@CRLF &@CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & " description ""Peering with " & $PeerRead & ' (AS ' & $ASRead & ")"""&@CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & " local-address " & $LocalIP6Read &@CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & " authentication-key " & $MD5Read&@CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & " peer-as " & $ASRead&@CRLF &@CRLF & "show | compare"& @CRLF & "commit check"& @CRLF &"commit sync and quit"& @CRLF & "show log messages | last" & @CRLF & @CRLF & "ping " & $IPv4Read & " rapid count 1000"& @CRLF & "show bgp neighbor "&  $IPv4Read & @CRLF & @CRLF & "ping " & $IPv6Read & " rapid count 1000"& @CRLF & "show bgp neighbor " & $IPv6Read ,248, 128, 641, 353)
   ClipPut(GUICtrlRead ($MOP))
EndSwitch
WEnd

Share this post


Link to post
Share on other sites
Melba23

atnextc,

A couple of things led to the problems you were having. I have rewritten the script to create controls initially and then hide/show them or reset their content rather then recreating them each time:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiEdit.au3>

$_1 = GUICreate("Cox Public Peering Turn Up", 920, 614, 191, 123)

$Label1 = GUICtrlCreateLabel("Cox Multipath Private BGP Turn Up", 208, 24, 397, 33)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
$Router = GUICtrlCreateInput("", 136, 128, 84, 21)
$Circuit = GUICtrlCreateInput("", 136, 158, 84, 21)
$Peer = GUICtrlCreateInput("", 136, 184, 84, 21)
$PeerA = GUICtrlCreateInput("", 136, 216, 84, 21)
$Interface = GUICtrlCreateInput("", 136, 246, 84, 21)
$IPv4 = GUICtrlCreateInput("", 136, 272, 84, 21)
$IPv4SubnetMask = GUICtrlCreateInput("", 136, 304, 84, 21)
$IPv6 = GUICtrlCreateInput("", 136, 336, 84, 21)
$IPv6SubnetMask = GUICtrlCreateInput("", 136, 368, 84, 21)
$md5 = GUICtrlCreateInput("", 136, 400, 84, 21)
$LocIP = GUICtrlCreateInput("", 136, 432, 81, 21)
$LocalIP6 = GUICtrlCreateInput("", 136, 464, 81, 21)
$Submit = GUICtrlCreateButton("Submit", 136, 504, 97, 33)
$RouterName = GUICtrlCreateLabel("Router Name", 40, 132, 94, 17)
$Label3 = GUICtrlCreateLabel("Interface", 40, 249, 73, 17)
$Label4 = GUICtrlCreateLabel("Peer Name", 40, 186, 84, 17)
$V4IP = GUICtrlCreateLabel("Peer v4 IP", 40, 276, 56, 17)
$Label5 = GUICtrlCreateLabel("Peer v4 Mask", 40, 306, 72, 17)
$v6IP = GUICtrlCreateLabel("Peer v6 IP", 40, 338, 56, 17)
$v6Mask = GUICtrlCreateLabel("Peer v6 Mask", 40, 370, 72, 17)
$PeerAS = GUICtrlCreateLabel("Peer AS", 40, 218, 70, 17)
$Label6 = GUICtrlCreateLabel("Circuit ID", 40, 162, 74, 17)
$MD5key = GUICtrlCreateLabel("MD5 Key", 40, 402, 75, 17)
$LocalIP = GUICtrlCreateLabel("Local v4 IP", 40, 434, 70, 17)
$LocaIP6 = GUICtrlCreateLabel("Local v6 IP", 40, 466, 58, 17)
$Clear = GUICtrlCreateButton("Clear", 24, 504, 99, 33)
; Create Edit and Buttons here <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$MOP = GUICtrlCreateEdit("", 248, 128, 641, 353)
$CopyClipboard = GUICtrlCreateButton("Copy To Clipboard", 776, 504, 113, 33)
GUICtrlSetState(-1, $GUI_SHOW) ; Hide buttons <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$Save = GUICtrlCreateButton("Save", 664, 504, 97, 33)
GUICtrlSetState(-1, $GUI_SHOW)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $Clear
            GUICtrlSetData($md5, "") ; Use native functions on native controls <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            GUICtrlSetData($Interface, "")
            GUICtrlSetData($IPv4, "")
            GUICtrlSetData($IPv4SubnetMask, "")
            GUICtrlSetData($IPv6, "")
            GUICtrlSetData($IPv6SubnetMask, "")
            GUICtrlSetData($Router, "")
            GUICtrlSetData($Peer, "")
            GUICtrlSetData($PeerA, "")
            GUICtrlSetData($LocIP, "")
            GUICtrlSetData($LocalIP6, "")
            GUICtrlSetData($Circuit, "")
            _Action()
            GUICtrlSetState($CopyClipboard, $GUI_HIDE) ; Hide the buttons again <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            GUICtrlSetState($Save, $GUI_HIDE)
        Case $Submit
            _Action()
            ClipPut(GUICtrlRead($MOP))
            GUICtrlSetState($CopyClipboard, $GUI_SHOW) ; Show the buttons <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            GUICtrlSetState($Save, $GUI_SHOW)
    EndSwitch
WEnd

Func _Action()

    $CircuitRead = GUICtrlRead($Circuit);Reads the value of the Circuit ID input Box
    $InterfaceRead = GUICtrlRead($Interface);Reads the value of the Interface ID input Box
    $PeerRead = GUICtrlRead($Peer);Reads the value of the Peer Name ID input Box
    $ASRead = GUICtrlRead($PeerA);Reads the value of the Peer Name ID input Box
    $RouterRead = GUICtrlRead($Router)
    $IPv4Read = GUICtrlRead($IPv4);Reads the value of the IP v 4 ID input Box
    $IPv4SubnetMaskRead = GUICtrlRead($IPv4SubnetMask);Reads the value of the IP v4 Subnet ID input Box
    $IPv6Read = GUICtrlRead($IPv6);Reads the value of the IP v 6 ID input Box
    $IPv6SubnetMaskRead = GUICtrlRead($IPv6SubnetMask);Reads the value of the IP v6 Subnet ID input Box
    $LocalIPRead = GUICtrlRead($LocIP);Reads the value of the IP v6 Subnet ID input Box
    $MD5Read = GUICtrlRead($md5);Reads the value of the IP v6 Subnet ID input Box
    $LocalIP6Read = GUICtrlRead($LocalIP6);Reads the value of the IP v6 Subnet ID input Box
    ; Here we just reset the content of the edit - not recreate it <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    GUICtrlSetData($MOP, $RouterRead & @CRLF & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                        " unit 0 description "";" & $CircuitRead & ";Peer " & $PeerRead & ' (AS ' & $ASRead & _
                        ");;MR;10GE To " & $PeerRead & ' (AS ' & $ASRead & ")""" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                        " unit 0 family inet mtu 1500" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                        " unit 0 family inet filter input EDGE-IN" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                        " unit 0 family inet filter output EDGE-OUT" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                        " unit 0 family inet address " & $LocalIPRead & "/" & $IPv4SubnetMaskRead & _
                        @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet6 filter input EDGE-INV6" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                        " unit 0 family inet6 filter output EDGE-OUTV6" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                        " unit 0 family inet6 address " & $LocalIP6Read & "/" & $IPv6SubnetMaskRead & @CRLF & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & _
                        " description ""Peering with " & $PeerRead & ' (AS ' & $ASRead & ")""" & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & _
                        " local-address " & $LocalIPRead & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & " authentication-key " & $MD5Read & _
                        @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & " peer-as " & $ASRead & @CRLF & @CRLF & _
                        "set protocols bgp group PEERv6 neighbor " & $IPv6Read & " description ""Peering with " & $PeerRead & ' (AS ' & $ASRead & ")""" & @CRLF & _
                        "set protocols bgp group PEERv6 neighbor " & $IPv6Read & " local-address " & $LocalIP6Read & @CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & _
                        " authentication-key " & $MD5Read & @CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & _
                        " peer-as " & $ASRead & @CRLF & @CRLF & "show | compare" & @CRLF & "commit check" & @CRLF & "commit sync and quit" & @CRLF & _
                        "show log messages | last" & @CRLF & @CRLF & "ping " & $IPv4Read & " rapid count 1000" & @CRLF & "show bgp neighbor " & $IPv4Read & @CRLF & @CRLF & _
                        "ping " & $IPv6Read & " rapid count 1000" & @CRLF & "show bgp neighbor " & $IPv6Read)

EndFunc

Look for the <<<<<<<<<<<<<<<<<< lines. I also broke up the very long line which should make it easier to edit in future. ;)

Everything seems to work for me now - same for you? :)

M23

P.S. When you post code please use Code tags - put [autoit] before and [/autoit] after your posted code. Then you get a scrolling box and syntax colouring as you can see in my post. ;)


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
atnextc

Thanks I'll check it out and let you know how it goes. Thanks for breaking up that long line I couldn't figure out how to do it.

Share this post


Link to post
Share on other sites
atnextc

Thanks that seems to have solved that problem.

Now I have a new one......I"m trying to create "main menu" for the 4 scripts that I have created and save this one file to an exe so I can give this out instead of 4 exe's to compile these scripts.

Below is what I have but it's not working as planned.

"MAIN MENU"

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include "Multipath.au3"
#include "Multihop.au3"
#include "LACP.au3"
#include "Public.au3"

$Form1_1 = GUICreate("Cox C4 Process", 476, 229, 191, 255)
$C4lbl = GUICtrlCreateLabel("COX BGP Configs", 248, 32, 89, 17)
$Multipath = GUICtrlCreateRadio("Multipath Private", 40, 72, 193, 17)
$LACP = GUICtrlCreateRadio("LACP Private", 40, 96, 169, 17)
$Multihop = GUICtrlCreateRadio("Multihop Private", 40, 120, 241, 17)
$OK = GUICtrlCreateButton("OK", 40, 176, 75, 25)
$Public = GUICtrlCreateRadio("Public Peer", 40, 144, 241, 17)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $OK
If GUICtrlRead($Multipath) = 1 Then
Run('AutoIt3.exe Multipath.au3')
EndIf
If GUICtrlRead($LACP) = 1 Then
Run('AutoIt3.exe LACP.au3')
EndIf
If GUICtrlRead($Multihop) = 1 Then
Run('AutoIt3.exe Multihop.au3')
EndIf
If GUICtrlRead($Public) = 1 Then
Run('AutoIt3.exe Public.au3')
EndIf
EndSwitch
WEnd

"LACP"

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#Region ### START Koda GUI section ### Form=\\catl0fs03\tcovert$\data\autoit scripts\lacp.kxf
$_1 = GUICreate("Cox LACP Private Peering Turn Up", 920, 614, 191, 123)
$Label1 = GUICtrlCreateLabel("Cox LACP Private BGP Turn Up", 208, 24, 370, 33)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
$Router = GUICtrlCreateInput("", 136, 128, 84, 21)
$Circuit = GUICtrlCreateInput("", 136, 158, 84, 21)
$Peer = GUICtrlCreateInput("", 136, 184, 84, 21)
$AE = GUICtrlCreateInput("", 136, 216, 84, 21)
$PeerA = GUICtrlCreateInput("", 136, 242, 84, 21)
$Interface = GUICtrlCreateInput("", 136, 270, 84, 21)
$IPv4 = GUICtrlCreateInput("", 136, 320, 84, 21)
$IPv4SubnetMask = GUICtrlCreateInput("", 136, 352, 84, 21)
$IPv6 = GUICtrlCreateInput("", 136, 384, 84, 21)
$IPv6SubnetMask = GUICtrlCreateInput("", 136, 416, 84, 21)
$md5 = GUICtrlCreateInput("", 136, 448, 84, 21)
$locip = GUICtrlCreateInput("", 136, 480, 81, 21)
$LocalIP6 = GUICtrlCreateInput("", 136, 512, 81, 21)
$Submit = GUICtrlCreateButton("Submit", 136, 544, 97, 33)
$Save = GUICtrlCreateButton("Save", 664, 536, 97, 33)
$CopyClipboard = GUICtrlCreateButton("Copy To Clipboard", 776, 536, 113, 33)
$MOP = GUICtrlCreateEdit("", 248, 128, 641, 353)
GUICtrlSetData(-1, "")
$RouterName = GUICtrlCreateLabel("Input Router Name", 40, 132, 94, 17)
$Label3 = GUICtrlCreateLabel("Input Interface", 40, 273, 73, 17)
$Label4 = GUICtrlCreateLabel("Input Peer Name", 40, 186, 84, 17)
$V4IP = GUICtrlCreateLabel("Peer v4 IP", 40, 324, 56, 17)
$Label5 = GUICtrlCreateLabel("Input v4 Mask", 40, 354, 72, 17)
$v6IP = GUICtrlCreateLabel("Peer v6 IP", 40, 386, 56, 17)
$v6Mask = GUICtrlCreateLabel("Input v6 Mask", 40, 418, 72, 17)
$PeerAS = GUICtrlCreateLabel("Input Peer AS", 40, 246, 70, 17)
$Label6 = GUICtrlCreateLabel("Input Circuit ID", 40, 162, 74, 17)
$MD5key = GUICtrlCreateLabel("Input MD5 Key", 40, 450, 75, 17)
$LocalIP = GUICtrlCreateLabel("Input Local IP", 40, 482, 70, 17)
$Label2 = GUICtrlCreateLabel("Local v6 IP", 40, 514, 58, 17)
$Clear = GUICtrlCreateButton("Clear", 24, 544, 99, 33)
$Label7 = GUICtrlCreateLabel("Input AE", 40, 218, 45, 17)
$Checkbox1 = GUICtrlCreateCheckbox("Does the AE already exist?", 40, 300, 145, 17)
GUISetState(@SW_SHOW)
GUICtrlSetState(-1, $GUI_SHOW)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
     Case $GUI_EVENT_CLOSE
         ExitLoop
Case $Checkbox1
If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
         GUICtrlSetState($locip, $GUI_HIDE) ; Hide the buttons again <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
         GUICtrlSetState($LocalIP6, $GUI_HIDE)
GUICtrlSetState($IPv4SubnetMask, $GUI_HIDE)
GUICtrlSetState($IPv6SubnetMask, $GUI_HIDE)
GUICtrlSetState($md5, $GUI_HIDE)
GUICtrlSetState($V4IP, $GUI_HIDE)
GUICtrlSetState($Label5, $GUI_HIDE)
GUICtrlSetState($v6IP, $GUI_HIDE)
GUICtrlSetState($v6Mask, $GUI_HIDE)
GUICtrlSetState($LocalIP, $GUI_HIDE)
GUICtrlSetState($Label2, $GUI_HIDE)
GUICtrlSetState($MD5key, $GUI_HIDE)
GUICtrlSetState($ipv4, $GUI_HIDE)
GUICtrlSetState($IPv6, $GUI_HIDE)
Else
GUICtrlSetState($locip, $GUI_SHOW) ; SHOW the buttons again <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
         GUICtrlSetState($LocalIP6, $GUI_SHOW)
GUICtrlSetState($IPv4, $GUI_SHOW)
GUICtrlSetState($IPv4SubnetMask, $GUI_SHOW)
GUICtrlSetState($IPv6SubnetMask, $GUI_SHOW)
GUICtrlSetState($IPv6, $GUI_SHOW)
GUICtrlSetState($md5, $GUI_SHOW)
GUICtrlSetState($V4IP, $GUI_SHOW)
GUICtrlSetState($Label5, $GUI_SHOW)
GUICtrlSetState($v6IP, $GUI_SHOW)
GUICtrlSetState($V4IP, $GUI_SHOW)
GUICtrlSetState($v6Mask, $GUI_SHOW)
GUICtrlSetState($LocalIP, $GUI_SHOW)
GUICtrlSetState($Label2, $GUI_SHOW)
GUICtrlSetState($MD5key, $GUI_SHOW)
GUICtrlSetData($MOP,"")
EndIf
     Case $Clear
         GUICtrlSetData($md5, "") ; Use native functions on native controls <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
         GUICtrlSetData($Interface, "")
         GUICtrlSetData($IPv4, "")
         GUICtrlSetData($IPv4SubnetMask, "")
         GUICtrlSetData($IPv6, "")
         GUICtrlSetData($IPv6SubnetMask, "")
         GUICtrlSetData($Router, "")
         GUICtrlSetData($Peer, "")
         GUICtrlSetData($PeerA, "")
         GUICtrlSetData($LocIP, "")
         GUICtrlSetData($LocalIP6, "")
         GUICtrlSetData($Circuit, "")
GUICtrlSetData($AE, "")
GUICtrlSetData($MOP,"")
Case $Submit
_Action4()
If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
_AE_Exists()
Else
If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
_AE_Exists()
     ClipPut(GUICtrlRead($MOP))
     ;GUICtrlSetState($CopyClipboard, $GUI_SHOW) ; Show the buttons <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     ;GUICtrlSetState($Save, $GUI_SHOW)
EndIf
EndIf
Case $CopyClipboard
ClipPut(GUICtrlRead($MOP))
EndSwitch
WEnd
Func _Action4()
$CircuitRead = GUICtrlRead($Circuit);Reads the value of the Circuit ID input Box
$InterfaceRead = GUICtrlRead($Interface);Reads the value of the Interface ID input Box
$PeerRead = GUICtrlRead($Peer);Reads the value of the Peer Name ID input Box
$ASRead = GUICtrlRead($PeerA);Reads the value of the Peer Name ID input Box
$RouterRead = GUICtrlRead($Router)
$IPv4Read = GUICtrlRead($IPv4);Reads the value of the IP v 4 ID input Box
$IPv4SubnetMaskRead = GUICtrlRead($IPv4SubnetMask);Reads the value of the IP v4 Subnet ID input Box
$IPv6Read = GUICtrlRead($IPv6);Reads the value of the IP v 6 ID input Box
$IPv6SubnetMaskRead = GUICtrlRead($IPv6SubnetMask);Reads the value of the IP v6 Subnet ID input Box
$LocalIPRead = GUICtrlRead($LocIP);Reads the value of the IP v6 Subnet ID input Box
$MD5Read = GUICtrlRead($md5);Reads the value of the IP v6 Subnet ID input Box
$LocalIP6Read = GUICtrlRead($LocalIP6);Reads the value of the IP v6 Subnet ID input Box
$AERead= GUICtrlRead($AE);Reads the value of the IP v6 Subnet ID input Box
; Here we just reset the content of the edit - not recreate it <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GUICtrlSetData($MOP, $RouterRead & @CRLF & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " description "";" & $CircuitRead & ";Peer " & $PeerRead & ' (AS ' & $ASRead & _
                     ");;MR;10GE To " & $PeerRead & ' (AS ' & $ASRead & ")""" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " gigether-options 802.3ad ae" & $AERead & @CRLF & @CRLF & @CRLF & "set interfaces ae" & $AERead & _
                     " mtu 4484" & @CRLF & "set interfaces ae" & $AERead & _
                     " aggregated-ether-options no-flow-control" & @CRLF & "set interfaces ae" & $AERead & _
                     " aggregated-ether-options minimum-links 1 " & @CRLF & "set interfaces ae" & $AERead & _
                     " aggregated-ether-options link-speed 10g " & @CRLF & "set interfaces ae" & $AERead & _
     " aggregated-ether-options lacp active" & @CRLF & "set interfaces ae" & $AERead & _
     " unit 0 description "";" & $CircuitRead & ";Peer " & $PeerRead & ' (AS ' & $ASRead & _
                     ");;MR;10GE To " & $PeerRead & ' (AS ' & $ASRead & ")" & _
     @CRLF &"set interfaces ae" & $AERead & _
                     " unit 0 family inet mtu 1500" & @CRLF & "set interfaces ae" & $AERead & _
                     " unit 0 family inet filter input EDGE-IN" & @CRLF & "set interfaces ae" & $AERead & _
                     " unit 0 family inet filter output EDGE-OUT" & @CRLF & "set interfaces ae" & $AERead & _
                     " unit 0 family inet address " & $LocalIPRead & "/" & $IPv4SubnetMaskRead & _
                     @CRLF & "set interfaces ae" & $AERead & " unit 0 family inet6 filter input EDGE-INV6" & @CRLF & "set interfaces ae" & $AERead & _
                     " unit 0 family inet6 filter output EDGE-OUTV6" & @CRLF & "set interfaces ae" & $AERead & _
                     " unit 0 family inet6 address " & $LocalIP6Read & "/" & $IPv6SubnetMaskRead & @CRLF & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & _
                     "description ""Peering with " & $PeerRead & ' (AS ' & $ASRead & ")""" & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & _
                     "local-address " & $LocalIPRead & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & "authentication-key " & $MD5Read & _
                     @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & "peer-as " & $ASRead & @CRLF & @CRLF & _
                     "set protocols bgp group PEERv6 neighbor " & $IPv6Read & "description ""Peering with " & $PeerRead & ' (AS ' & $ASRead & ")""" & @CRLF & _
                     "set protocols bgp group PEERv6 neighbor " & $IPv6Read & "local-address " & $LocalIP6Read & @CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & _
                     "authentication-key " & $MD5Read & @CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & _
                     "peer-as " & $ASRead & @CRLF & @CRLF & "show | compare" & @CRLF & "commit check" & @CRLF & "commit sync and quit" & @CRLF & _
                     "show log messages | last"& @CRLF & @CRLF & "==========================================" & @CRLF & @CRLF &"VERIFICATION COMMANDS" & @CRLF & @CRLF & "ping " & $IPv4Read & " rapid count 1000" & @CRLF & "show bgp neighbor " & $IPv4Read & @CRLF & @CRLF & _
                     "ping " & $IPv6Read & " rapid count 1000" & @CRLF & "show bgp neighbor " & $IPv6Read)
EndFunc
Func _AE_Exists()
$CircuitRead = GUICtrlRead($Circuit);Reads the value of the Circuit ID input Box
$InterfaceRead = GUICtrlRead($Interface);Reads the value of the Interface ID input Box
$PeerRead = GUICtrlRead($Peer);Reads the value of the Peer Name ID input Box
$ASRead = GUICtrlRead($PeerA);Reads the value of the Peer Name ID input Box
$RouterRead = GUICtrlRead($Router)
$IPv4Read = GUICtrlRead($IPv4);Reads the value of the IP v 4 ID input Box
$IPv4SubnetMaskRead = GUICtrlRead($IPv4SubnetMask);Reads the value of the IP v4 Subnet ID input Box
$IPv6Read = GUICtrlRead($IPv6);Reads the value of the IP v 6 ID input Box
$IPv6SubnetMaskRead = GUICtrlRead($IPv6SubnetMask);Reads the value of the IP v6 Subnet ID input Box
$LocalIPRead = GUICtrlRead($LocIP);Reads the value of the IP v6 Subnet ID input Box
$MD5Read = GUICtrlRead($md5);Reads the value of the IP v6 Subnet ID input Box
$LocalIP6Read = GUICtrlRead($LocalIP6);Reads the value of the IP v6 Subnet ID input Box
$AERead= GUICtrlRead($AE);Reads the value of the IP v6 Subnet ID input Box

;LACP AE INTERFACE ALREADY EXISTS AND BGP IS NOT SETUP YET!!
GUICtrlSetData($MOP,$RouterRead & @CRLF & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " description "";" & $CircuitRead & ";Peer " & $PeerRead & ' (AS ' & $ASRead & _
                     ");;MR;10GE To " & $AERead & ' (AS ' & $ASRead & ")""" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " gigether-options ae" & $AERead & @CRLF & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & _
                     "description ""Peering with " & $PeerRead & ' (AS ' & $ASRead & ")""" & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & _
                     "local-address " & $LocalIPRead & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & "authentication-key " & $MD5Read & _
                     @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & "peer-as " & $ASRead & @CRLF & @CRLF & _
                     "set protocols bgp group PEERv6 neighbor " & $IPv6Read & "description ""Peering with " & $PeerRead & ' (AS ' & $ASRead & ")""" & @CRLF & _
                     "set protocols bgp group PEERv6 neighbor " & $IPv6Read & "local-address " & $LocalIP6Read & @CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & _
                     "authentication-key " & $MD5Read & @CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & _
                     "peer-as " & $ASRead & @CRLF & @CRLF &"show | compare" & @CRLF & "commit check" & @CRLF & "commit sync and quit" & @CRLF & _
                     "show log messages | last" & @CRLF & @CRLF & "==========================================" & @CRLF & @CRLF &"VERIFICATION COMMANDS" & @CRLF & @CRLF & "ping " & $IPv4Read & " rapid count 1000" & @CRLF & "show bgp neighbor " & $IPv4Read & @CRLF & @CRLF & _
                     "ping " & $IPv6Read & " rapid count 1000" & @CRLF & "show bgp neighbor " & $IPv6Read)
     EndFunc

"Multipath"

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiEdit.au3>
$_1 = GUICreate("Cox Multipath Private BGP Turn Up", 920, 614, 191, 123)
$Label1 = GUICtrlCreateLabel("Cox Multipath Private BGP Turn Up", 208, 24, 397, 33)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
$Router = GUICtrlCreateInput("", 136, 128, 84, 21)
$Circuit = GUICtrlCreateInput("", 136, 158, 84, 21)
$Peer = GUICtrlCreateInput("", 136, 184, 84, 21)
$PeerA = GUICtrlCreateInput("", 136, 216, 84, 21)
$Interface = GUICtrlCreateInput("", 136, 246, 84, 21)
$IPv4 = GUICtrlCreateInput("", 136, 272, 84, 21)
$IPv4SubnetMask = GUICtrlCreateInput("", 136, 304, 84, 21)
$IPv6 = GUICtrlCreateInput("", 136, 336, 84, 21)
$IPv6SubnetMask = GUICtrlCreateInput("", 136, 368, 84, 21)
$md5 = GUICtrlCreateInput("", 136, 400, 84, 21)
$LocIP = GUICtrlCreateInput("", 136, 432, 81, 21)
$LocalIP6 = GUICtrlCreateInput("", 136, 464, 81, 21)
$Submit = GUICtrlCreateButton("Submit", 136, 504, 97, 33)
$RouterName = GUICtrlCreateLabel("Router Name", 40, 132, 94, 17)
$Label3 = GUICtrlCreateLabel("Interface", 40, 249, 73, 17)
$Label4 = GUICtrlCreateLabel("Peer Name", 40, 186, 84, 17)
$V4IP = GUICtrlCreateLabel("Peer v4 IP", 40, 276, 56, 17)
$Label5 = GUICtrlCreateLabel("Peer v4 Mask", 40, 306, 72, 17)
$v6IP = GUICtrlCreateLabel("Peer v6 IP", 40, 338, 56, 17)
$v6Mask = GUICtrlCreateLabel("Peer v6 Mask", 40, 370, 72, 17)
$PeerAS = GUICtrlCreateLabel("Peer AS", 40, 218, 70, 17)
$Label6 = GUICtrlCreateLabel("Circuit ID", 40, 162, 74, 17)
$MD5key = GUICtrlCreateLabel("MD5 Key", 40, 402, 75, 17)
$LocalIP = GUICtrlCreateLabel("Local v4 IP", 40, 434, 70, 17)
$LocaIP6 = GUICtrlCreateLabel("Local v6 IP", 40, 466, 58, 17)
$Clear = GUICtrlCreateButton("Clear", 24, 504, 99, 33)
; Create Edit and Buttons here <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$MOP = GUICtrlCreateEdit("", 248, 128, 641, 353)
$CopyClipboard = GUICtrlCreateButton("Copy To Clipboard", 776, 504, 113, 33)
GUICtrlSetState(-1, $GUI_SHOW) ; Hide buttons <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$Save = GUICtrlCreateButton("Save", 664, 504, 97, 33)
GUICtrlSetState(-1, $GUI_SHOW)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
     Case $GUI_EVENT_CLOSE
         ExitLoop
     Case $Clear
GUICtrlSetData($md5, "") ; Use native functions on native controls <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
         GUICtrlSetData($Interface, "")
         GUICtrlSetData($IPv4, "")
         GUICtrlSetData($IPv4SubnetMask, "")
         GUICtrlSetData($IPv6, "")
         GUICtrlSetData($IPv6SubnetMask, "")
         GUICtrlSetData($Router, "")
         GUICtrlSetData($Peer, "")
         GUICtrlSetData($PeerA, "")
         GUICtrlSetData($LocIP, "")
         GUICtrlSetData($LocalIP6, "")
         GUICtrlSetData($Circuit, "")
GUICtrlSetData($MOP,"")
     Case $Submit
         _Action()
         GUICtrlSetState($CopyClipboard, $GUI_SHOW) ; Show the buttons <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
         GUICtrlSetState($Save, $GUI_SHOW)
Case $CopyClipboard
ClipPut(GUICtrlRead($MOP))
EndSwitch
WEnd
Func _Action()
$CircuitRead = GUICtrlRead($Circuit);Reads the value of the Circuit ID input Box
$InterfaceRead = GUICtrlRead($Interface);Reads the value of the Interface ID input Box
$PeerRead = GUICtrlRead($Peer);Reads the value of the Peer Name ID input Box
$ASRead = GUICtrlRead($PeerA);Reads the value of the Peer Name ID input Box
$RouterRead = GUICtrlRead($Router)
$IPv4Read = GUICtrlRead($IPv4);Reads the value of the IP v 4 ID input Box
$IPv4SubnetMaskRead = GUICtrlRead($IPv4SubnetMask);Reads the value of the IP v4 Subnet ID input Box
$IPv6Read = GUICtrlRead($IPv6);Reads the value of the IP v 6 ID input Box
$IPv6SubnetMaskRead = GUICtrlRead($IPv6SubnetMask);Reads the value of the IP v6 Subnet ID input Box
$LocalIPRead = GUICtrlRead($LocIP);Reads the value of the IP v6 Subnet ID input Box
$MD5Read = GUICtrlRead($md5);Reads the value of the IP v6 Subnet ID input Box
$LocalIP6Read = GUICtrlRead($LocalIP6);Reads the value of the IP v6 Subnet ID input Box
; Here we just reset the content of the edit - not recreate it <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GUICtrlSetData($MOP, $RouterRead & @CRLF & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " unit 0 description "";" & $CircuitRead & ";Peer " & $PeerRead & ' (AS ' & $ASRead & _
                     ");;MR;10GE To " & $PeerRead & ' (AS ' & $ASRead & ")""" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " unit 0 family inet mtu 1500" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " unit 0 family inet filter input EDGE-IN" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " unit 0 family inet filter output EDGE-OUT" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " unit 0 family inet address " & $LocalIPRead & "/" & $IPv4SubnetMaskRead & _
                     @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet6 filter input EDGE-INV6" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " unit 0 family inet6 filter output EDGE-OUTV6" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " unit 0 family inet6 address " & $LocalIP6Read & "/" & $IPv6SubnetMaskRead & @CRLF & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & _
                     "description ""Peering with " & $PeerRead & ' (AS ' & $ASRead & ")""" & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & _
                     "local-address " & $LocalIPRead & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & "authentication-key " & $MD5Read & _
                     @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & "peer-as " & $ASRead & @CRLF & @CRLF & _
                     "set protocols bgp group PEERv6 neighbor " & $IPv6Read & "description ""Peering with " & $PeerRead & ' (AS ' & $ASRead & ")""" & @CRLF & _
                     "set protocols bgp group PEERv6 neighbor " & $IPv6Read & "local-address " & $LocalIP6Read & @CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & _
                     "authentication-key " & $MD5Read & @CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & _
                     "peer-as " & $ASRead & @CRLF & @CRLF & "show | compare" & @CRLF & "commit check" & @CRLF & "commit sync and quit" & @CRLF & _
                     "show log messages | last"& @CRLF & @CRLF & "==========================================" & @CRLF & @CRLF &"VERIFICATION COMMANDS" & @CRLF & @CRLF & "ping " & $IPv4Read & " rapid count 1000" & @CRLF & "show bgp neighbor " & $IPv4Read & @CRLF & @CRLF & _
                     "ping " & $IPv6Read & " rapid count 1000" & @CRLF & "show bgp neighbor " & $IPv6Read)
EndFunc

"Multihop"

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$_1 = GUICreate("Cox Multihop BGP Turn Up", 920, 614, 191, 123)
$Label1 = GUICtrlCreateLabel("Cox Multihop BGP Turn Up", 208, 24, 397, 33)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
$Router = GUICtrlCreateInput("", 136, 128, 84, 21)
$Circuit = GUICtrlCreateInput("", 136, 158, 84, 21)
$Peer = GUICtrlCreateInput("", 136, 184, 84, 21)
$PeerA = GUICtrlCreateInput("", 136, 216, 84, 21)
$Interface = GUICtrlCreateInput("", 136, 246, 84, 21)
$IPv4 = GUICtrlCreateInput("", 136, 272, 84, 21)
$IPv4SubnetMask = GUICtrlCreateInput("", 136, 304, 84, 21)
$IPv6 = GUICtrlCreateInput("", 136, 336, 84, 21)
$IPv6SubnetMask = GUICtrlCreateInput("", 136, 368, 84, 21)
$md5 = GUICtrlCreateInput("", 136, 400, 84, 21)
$LocIP = GUICtrlCreateInput("", 136, 432, 81, 21)
$LocalIP6 = GUICtrlCreateInput("", 136, 464, 81, 21)
$RouterName = GUICtrlCreateLabel("Router Name", 40, 132, 94, 17)
$Label3 = GUICtrlCreateLabel("Interface", 40, 249, 73, 17)
$Label4 = GUICtrlCreateLabel("Peer Name", 40, 186, 84, 17)
$V4IP = GUICtrlCreateLabel("Peer v4 IP", 40, 276, 56, 17)
$Label5 = GUICtrlCreateLabel("Peer v4 Mask", 40, 306, 72, 17)
$v6IP = GUICtrlCreateLabel("Peer v6 IP", 40, 338, 56, 17)
$v6Mask = GUICtrlCreateLabel("Peer v6 Mask", 40, 370, 72, 17)
$PeerAS = GUICtrlCreateLabel("Peer AS", 40, 218, 70, 17)
$Label6 = GUICtrlCreateLabel("Circuit ID", 40, 162, 74, 17)
$MD5key = GUICtrlCreateLabel("MD5 Key", 40, 402, 75, 17)
$LocalIP = GUICtrlCreateLabel("Local v4 IP", 40, 434, 70, 17)
$LocaIP6 = GUICtrlCreateLabel("Local v6 IP", 40, 466, 58, 17)
$Label7 = GUICtrlCreateLabel("Next Hop v4 IP", 40, 498, 77, 17)
$Label8 = GUICtrlCreateLabel("Next Hop v6 IP", 40, 530, 77, 17)
$NH = GUICtrlCreateInput("", 136, 496, 81, 21)
$NH6 = GUICtrlCreateInput("", 136, 528, 81, 21)
$Clear = GUICtrlCreateButton("Clear", 24, 568, 99, 33)
$Submit = GUICtrlCreateButton("Submit", 136, 568, 97, 33)
$Save = GUICtrlCreateButton("Save", 664, 560, 97, 33)
$CopyClipboard = GUICtrlCreateButton("Copy To Clipboard", 776, 560, 113, 33)
$MOP = GUICtrlCreateEdit("", 248, 128, 641, 353)
GUICtrlSetState(-1, $GUI_SHOW)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
     Case $GUI_EVENT_CLOSE
         ExitLoop
     Case $Clear
GUICtrlSetData($md5, "") ; Use native functions on native controls <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
         GUICtrlSetData($Interface, "")
         GUICtrlSetData($IPv4, "")
         GUICtrlSetData($IPv4SubnetMask, "")
         GUICtrlSetData($IPv6, "")
         GUICtrlSetData($IPv6SubnetMask, "")
         GUICtrlSetData($Router, "")
         GUICtrlSetData($Peer, "")
         GUICtrlSetData($PeerA, "")
         GUICtrlSetData($LocIP, "")
         GUICtrlSetData($LocalIP6, "")
         GUICtrlSetData($Circuit, "")
GUICtrlSetData($MOP,"")
     Case $Submit
         _Action3()
         GUICtrlSetState($CopyClipboard, $GUI_SHOW) ; Show the buttons <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
         GUICtrlSetState($Save, $GUI_SHOW)
Case $CopyClipboard
ClipPut(GUICtrlRead($MOP))
EndSwitch
WEnd
Func _Action3()
$CircuitRead = GUICtrlRead($Circuit);Reads the value of the Circuit ID input Box
$InterfaceRead = GUICtrlRead($Interface);Reads the value of the Interface ID input Box
$PeerRead = GUICtrlRead($Peer);Reads the value of the Peer Name ID input Box
$ASRead = GUICtrlRead($PeerA);Reads the value of the Peer Name ID input Box
$RouterRead = GUICtrlRead($Router)
$IPv4Read = GUICtrlRead($IPv4);Reads the value of the IP v 4 ID input Box
$IPv4SubnetMaskRead = GUICtrlRead($IPv4SubnetMask);Reads the value of the IP v4 Subnet ID input Box
$IPv6Read = GUICtrlRead($IPv6);Reads the value of the IP v 6 ID input Box
$IPv6SubnetMaskRead = GUICtrlRead($IPv6SubnetMask);Reads the value of the IP v6 Subnet ID input Box
$LocalIPRead = GUICtrlRead($LocIP);Reads the value of the IP v6 Subnet ID input Box
$MD5Read = GUICtrlRead($md5);Reads the value of the IP v6 Subnet ID input Box
$LocalIP6Read = GUICtrlRead($LocalIP6);Reads the value of the IP v6 Subnet ID input Box
$NHRead = GUICtrlRead($NH)
$NH6Read = GUICtrlRead($NH6)
; Here we just reset the content of the edit - not recreate it <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GUICtrlSetData($MOP, $RouterRead & @CRLF & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " unit 0 description "";" & $CircuitRead & ";Peer " & $PeerRead & ' (AS ' & $ASRead & _
                     ");;MR;10GE To " & $PeerRead & ' (AS ' & $ASRead & ")""" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " unit 0 family inet mtu 1500" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " unit 0 family inet filter input EDGE-IN" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " unit 0 family inet filter output EDGE-OUT" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " unit 0 family inet address " & $LocalIPRead & "/" & $IPv4SubnetMaskRead & _
                     @CRLF & "set interfaces xe-" & $InterfaceRead & " unit 0 family inet6 filter input EDGE-INV6" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " unit 0 family inet6 filter output EDGE-OUTV6" & @CRLF & "set interfaces xe-" & $InterfaceRead & _
                     " unit 0 family inet6 address " & $LocalIP6Read & "/" & $IPv6SubnetMaskRead & @CRLF & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & _
                     "description ""Peering with " & $PeerRead & ' (AS ' & $ASRead & ")""" & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & _
     "multihop ttl 2"& @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & _
                     "local-address " & $LocalIPRead & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & "authentication-key " & $MD5Read & _
                     @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & "peer-as " & $ASRead & @CRLF & @CRLF & _
                     "set protocols bgp group PEERv6 neighbor " & $IPv6Read & "description ""Peering with " & $PeerRead & ' (AS ' & $ASRead & ")""" & @CRLF & _
                     "set protocols bgp group PEERv6 neighbor " & $IPv6Read & "local-address " & $LocalIP6Read & @CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & _
                     "authentication-key " & $MD5Read & @CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & _
                     "peer-as " & $ASRead & @CRLF & @CRLF & "set routing-options static route " & $IPv4Read & "/32 next-hop" & $NHRead & @CRLF & "set routing-options rib inet6.0 static route " & $IPv6Read & "/32 next-hop" & $NH6Read & @CRLF & _
     @CRLF & @CRLF &"show | compare" & @CRLF & "commit check" & @CRLF & "commit sync and quit" & @CRLF & _
                     "show log messages | last"& @CRLF & @CRLF & "==========================================" & @CRLF & @CRLF &"VERIFICATION COMMANDS" & @CRLF & @CRLF & "ping " & $IPv4Read & " rapid count 1000" & @CRLF & "show bgp neighbor " & $IPv4Read & @CRLF & @CRLF & _
                     "ping " & $IPv6Read & " rapid count 1000" & @CRLF & "show bgp neighbor " & $IPv6Read)
EndFunc

"Public"

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=\\catl0fs03\tcovert$\data\autoit scripts\public peering turn up.kxf
$_1 = GUICreate("Cox Public Peering Turn Up", 920, 614, -1183, 123)
$Label1 = GUICtrlCreateLabel("Cox Public Peering Turn Up", 208, 24, 397, 33)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
$Router = GUICtrlCreateInput("", 136, 128, 84, 21)
$Peer = GUICtrlCreateInput("", 136, 160, 84, 21)
$PeerA = GUICtrlCreateInput("", 136, 192, 84, 21)
$IPv4 = GUICtrlCreateInput("", 136, 224, 84, 21)
$IPv6 = GUICtrlCreateInput("", 136, 256, 84, 21)
$md5 = GUICtrlCreateInput("", 136, 288, 84, 21)
$Clear = GUICtrlCreateButton("Clear", 24, 504, 99, 33)
$Submit = GUICtrlCreateButton("Submit", 136, 504, 97, 33)
$Save = GUICtrlCreateButton("Save", 664, 504, 97, 33)
$CopyClipboard = GUICtrlCreateButton("Copy To Clipboard", 776, 504, 113, 33)
$MOP = GUICtrlCreateEdit("", 248, 128, 641, 353)
GUICtrlSetData(-1, "")
$RouterName = GUICtrlCreateLabel("Input Router Name", 40, 132, 94, 17)
$Label4 = GUICtrlCreateLabel("Input Peer Name", 40, 162, 84, 17)
$V4IP = GUICtrlCreateLabel("Peer v4 IP", 40, 228, 54, 17)
$v6IP = GUICtrlCreateLabel("Peer v6 IP", 40, 258, 54, 17)
$PeerAS = GUICtrlCreateLabel("Input Peer AS", 40, 194, 70, 17)
$MD5key = GUICtrlCreateLabel("Input MD5 Key", 40, 290, 75, 17)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
     Case $GUI_EVENT_CLOSE
         ExitLoop
     Case $Clear
GUICtrlSetData($md5, "") ; Use native functions on native controls <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
         GUICtrlSetData($IPv4, "")
         GUICtrlSetData($IPv6, "")
         GUICtrlSetData($Router, "")
         GUICtrlSetData($Peer, "")
         GUICtrlSetData($PeerA, "")
         GUICtrlSetData($MOP,"")
     Case $Submit
         _Action5()
         GUICtrlSetState($Save, $GUI_SHOW)
Case $CopyClipboard
ClipPut(GUICtrlRead($MOP))
EndSwitch
WEnd
Func _Action5()

$PeerRead = GUICtrlRead($Peer);Reads the value of the Peer Name ID input Box
$ASRead = GUICtrlRead($PeerA);Reads the value of the Peer Name ID input Box
$RouterRead = GUICtrlRead($Router)
$IPv4Read = GUICtrlRead($IPv4);Reads the value of the IP v 4 ID input Box
$IPv6Read = GUICtrlRead($IPv6);Reads the value of the IP v 6 ID input Box
$MD5Read = GUICtrlRead($md5);Reads the value of the IP v6 Subnet ID input Box
; Here we just reset the content of the edit - not recreate it <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GUICtrlSetData($MOP, $RouterRead & @CRLF & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & _
                     " description ""Public Peering with " & $PeerRead & ' (AS ' & $ASRead & ")""" & @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & " authentication-key " & $MD5Read & _
                     @CRLF & "set protocols bgp group PEERS neighbor " & $IPv4Read & " peer-as " & $ASRead & @CRLF & @CRLF & _
                     "set protocols bgp group PEERv6 neighbor " & $IPv6Read & " description ""Public Peering with " & $PeerRead & ' IPv6 (AS ' & $ASRead & ")""" & @CRLF & _
                     "set protocols bgp group PEERv6 neighbor " & $IPv6Read & _
                     " authentication-key " & $MD5Read & @CRLF & "set protocols bgp group PEERv6 neighbor " & $IPv6Read & _
                     " peer-as " & $ASRead & @CRLF & @CRLF & "show | compare" & @CRLF & "commit check" & @CRLF & "commit sync and quit" & @CRLF & _
                     "show log messages | last"& @CRLF & @CRLF & "==========================================" & @CRLF & @CRLF &"VERIFICATION COMMANDS" & @CRLF & @CRLF & "ping " & $IPv4Read & " rapid count 1000" & @CRLF & "show bgp neighbor " & $IPv4Read & @CRLF & @CRLF & _
                     "ping " & $IPv6Read & " rapid count 1000" & @CRLF & "show bgp neighbor " & $IPv6Read)
EndFunc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×