diff options
-rw-r--r-- | gobgp/lib/lib.go | 7 | ||||
-rw-r--r-- | gobgp/lib/path.go | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/gobgp/lib/lib.go b/gobgp/lib/lib.go index b6103ed3..ee71a859 100644 --- a/gobgp/lib/lib.go +++ b/gobgp/lib/lib.go @@ -34,7 +34,7 @@ package main // path* p; // int cap = 32; // p = (path*)malloc(sizeof(path)); -// memset(p, 0, sizeof(p)); +// memset(p, 0, sizeof(path)); // p->nlri.len = 0; // p->path_attributes_len = 0; // p->path_attributes_cap = cap; @@ -42,7 +42,7 @@ package main // return p; // } // -// free_path(path* p) { +// void free_path(path* p) { // int i; // if (p->nlri.value != NULL) { // free(p->nlri.value); @@ -57,7 +57,7 @@ package main // free(p); // } // -// append_path_attribute(path* p, int len, char* value) { +// int append_path_attribute(path* p, int len, char* value) { // buf* b; // if (p->path_attributes_len >= p->path_attributes_cap) { // return -1; @@ -67,6 +67,7 @@ package main // b->len = len; // p->path_attributes[p->path_attributes_len] = b; // p->path_attributes_len++; +// return 0; // } // buf* get_path_attribute(path* p, int idx) { // if (idx < 0 || idx >= p->path_attributes_len) { diff --git a/gobgp/lib/path.go b/gobgp/lib/path.go index 124a994a..f55bf96d 100644 --- a/gobgp/lib/path.go +++ b/gobgp/lib/path.go @@ -27,14 +27,13 @@ package main // int path_attributes_cap; // } path; // extern path* new_path(); -// extern free_path(path*); -// extern append_path_attribute(path*, int, char*); +// extern void free_path(path*); +// extern int append_path_attribute(path*, int, char*); // extern buf* get_path_attribute(path*, int); import "C" import ( "encoding/json" - "fmt" "strings" "github.com/osrg/gobgp/gobgp/cmd" @@ -73,7 +72,6 @@ func decode_path(p *C.path) *C.char { var buf []byte var nlri bgp.AddrPrefixInterface if p.nlri.len > 0 { - fmt.Println(p.nlri.len) buf = []byte(C.GoStringN(p.nlri.value, p.nlri.len)) nlri = &bgp.NLRInfo{} err := nlri.DecodeFromBytes(buf) |