{"id":23547940,"url":"https://github.com/serngawy/libopenflow","last_synced_at":"2025-05-15T13:09:29.189Z","repository":{"id":144205212,"uuid":"123164413","full_name":"serngawy/libOpenflow","owner":"serngawy","description":null,"archived":false,"fork":false,"pushed_at":"2018-11-05T19:16:24.000Z","size":116,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T11:24:57.187Z","etag":null,"topics":["golang","openflow","openflow-app","openflow-controller"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serngawy.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}},"created_at":"2018-02-27T17:32:39.000Z","updated_at":"2020-05-25T09:19:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"c801cc0d-92fa-4de1-8f44-8f43e1bf2110","html_url":"https://github.com/serngawy/libOpenflow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serngawy%2FlibOpenflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serngawy%2FlibOpenflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serngawy%2FlibOpenflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serngawy%2FlibOpenflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serngawy","download_url":"https://codeload.github.com/serngawy/libOpenflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346626,"owners_count":22055809,"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":["golang","openflow","openflow-app","openflow-controller"],"created_at":"2024-12-26T09:19:49.451Z","updated_at":"2025-05-15T13:09:29.184Z","avatar_url":"https://github.com/serngawy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## LibOpenflow and OF controller\n\nOfctrl implements a simple openflow controller using libOpenflow.\n\nofapp is the interface for Applcations \"Consumers\" in order to receiv events from the OF-Switch such as; connected, disconnected and packet-received.\n\n# OF App implements the ConsumerInterface\n\n    type OfApp struct {\n      Switch *OFSwitch\n    }\n\n    func (o *OfApp) PacketRcvd(sw *OFSwitch, packet *openflow13.PacketIn) {\n      log.Printf(\"App: Received packet: %+v\", packet)\n    }\n\n    func (o *OfApp) SwitchConnected(sw *OFSwitch) {\n      log.Printf(\"App: Switch connected: %v\", sw.DPID())\n\n      // Store switch for later use\n      o.Switch = sw\n    }\n\n    func (o *OfApp) SwitchDisconnected(sw *OFSwitch) {\n      log.Printf(\"App: Switch disconnected: %v\", sw.DPID())\n    }\n\n    func (o *OfApp) MultipartReply(sw *OFSwitch, rep *openflow13.MultipartReply) {\n      log.Println(rep.Body)\n    }\n\n# Example:\n\n    func testExample() {\n\n      // Main app\n      var app ofctrl.OfApp\n\n      // Create a controller\n      ctrler := ofctrl.NewController(\u0026app)\n\n      // start listening\n      ctrler.Listen(\":6633\")\n    }\n\n# Build:\n\nWe assume you already installed golang and dep. If not check the below links for more info\n- install golang\n https://golang.org/doc/install\n- install dep\n https://github.com/golang/dep/blob/master/docs/installation.md\n\nTo build the binary execute the ./build.sh script, it will create ofctrl binary under the $GOPATH bin directory.\n\nExecute the ofctrl binary using the following command:\n        $ sudo ./ofctrl\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserngawy%2Flibopenflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserngawy%2Flibopenflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserngawy%2Flibopenflow/lists"}