{"id":29506602,"url":"https://github.com/twr14152/netwk-automation-using-c","last_synced_at":"2025-07-16T02:04:32.722Z","repository":{"id":304175857,"uuid":"1017998074","full_name":"twr14152/netwk-automation-using-c","owner":"twr14152","description":"Network automation scripts using C","archived":false,"fork":false,"pushed_at":"2025-07-14T22:25:57.000Z","size":176,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-14T23:58:51.499Z","etag":null,"topics":["arista","automation","c","c-programming","cisco","network","network-automation","network-programming","scripts"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twr14152.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-11T12:40:03.000Z","updated_at":"2025-07-14T22:26:00.000Z","dependencies_parsed_at":"2025-07-14T23:58:58.047Z","dependency_job_id":null,"html_url":"https://github.com/twr14152/netwk-automation-using-c","commit_stats":null,"previous_names":["twr14152/c_network_automation_scripts","twr14152/c-network-automation-scripts","twr14152/network-automation-scripts-c","twr14152/netwk-automation-using-c"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/twr14152/netwk-automation-using-c","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twr14152%2Fnetwk-automation-using-c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twr14152%2Fnetwk-automation-using-c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twr14152%2Fnetwk-automation-using-c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twr14152%2Fnetwk-automation-using-c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twr14152","download_url":"https://codeload.github.com/twr14152/netwk-automation-using-c/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twr14152%2Fnetwk-automation-using-c/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265476111,"owners_count":23772730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arista","automation","c","c-programming","cisco","network","network-automation","network-programming","scripts"],"created_at":"2025-07-16T02:02:25.486Z","updated_at":"2025-07-16T02:04:32.714Z","avatar_url":"https://github.com/twr14152.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Network Scripts written in C to configure and operate network devices\n\n### 07/14/2025\n- I ended up breaking up the config and exec commands functions into seperate scripts\n- The logic seemed cleaner as interactive shell seem appropriate for config functions more than exec commands\n  * cisco/example2/ssh_conf.c - configuration script\n  * cisco/example2/ssh_exec_cmds.c - show commands script\n- Next task is to try and come up with a way to configure multiple devices\n- So example3 show's how you could deploy and validate changes to your network using this code.\n- I didn't write additional c code to perform this I actually used a little bash to act as the orchestrator for this change.\n- The README shows the examples and how they were rolled out and validated\n  * arista/example3/pre_change_status.sh\n  * arista/example3/push_conf_change.sh\n  * arista/example3/post_change_status.sh\n  * arista/example3/rem_conf_change.sh\n\n### 07/13/2025\n- Added option for configure file to the Cisco device we are testing\n- ~cisco/example2/ssh_script.c~ \n- The cisco device did not honor end of line \";\" that arista ceos did the result was anything beyond the interface description became part of the description.\n- I had to use interactive shell to get it to properly take the commands.\n- Techinically this the more appropriate way of dealing with multiple nested commands in configuration mode.\n\n### 07/12/2025\n- In example2 I added the option to have a seperate file which can hold your device configuration or show commands. Its just a text file. Call it what ever you want. Then call it when your run your script. Its based off of a positional argument. So the name of the file could be anything.\n- arista/example2/ssh_script.c\n- I've include a readme file in that directory to help explain\n- I have not started on the Cisco example2 yet.\n\n### 07/11/2025\n- I really enjoy working with C. My background is in networking so why not try and see if I can make some use of it? I know screen scraping is not real sexy in the automation community but like it or not,  it's useful...\n- This repository will hold scripts that I write for the purposes of knowledge building, retention, and sharing.\n- So far I've created two scripts using libssh library. I pieced them together from the tutorial (https://api.libssh.org/stable/libssh_tutorial.html)\n- Not going to lie these first scripts were challenging and took sometime and effort to get working properly. Lots of debugging, especially the arista because of its authentication method.\n- These two scripts represent two very different forms of authentication using SSH. The Cisco device was more straight forward. \n   * arista/example1/ssh_cli_script.c - This script that works by using keyboard_interactive authentication\n   * cisco/example1/ssh_cli_script.c - This script works by using password authentication\n- The test envionments will probably change over time but for now \n   * I will use Containerlab for arista ceos and potentially other devices\n   * Devnet sandbox for cisco - This first example used always on nxos.\n- Now I understand the the usefulness of using a script in this fashion is more for a lab environment without and need for safeguards. My goal is to create more production ready format for these scripts. But you need to start somewhere. I also hope to grow beyond screen scraping but for now, it is what it is.\n- It would seem using the right tool for the right job may not have a place in this repo after all we are using c for network scripting. That said I may include some bash rather using c as an orchestrator to launch multiple instances of a script.\n- I will try an improve the scripts as I gain more understanding\n- This may not go very far, but wont know your limits until you try.\n- Lastly why c? Why not? I like it...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwr14152%2Fnetwk-automation-using-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwr14152%2Fnetwk-automation-using-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwr14152%2Fnetwk-automation-using-c/lists"}