Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ cc_library(
""",
patch_args = ["-p1"],
patches = ["//patches:sai.patch"],
sha256 = "4e3a1d010bda0c589db46e077725a2cd9624a5cc255c89d1caa79deb408d1fa7",
strip_prefix = "SAI-1.14.0",
urls = ["https://github.com/opencomputeproject/SAI/archive/refs/tags/v1.14.0.tar.gz"],
sha256 = "94b7a7dd9dbcc46bf14ba9f12b8597e9e9c2069fcb8e383a61cdf6ca172f3511",
strip_prefix = "SAI-1.15.0",
urls = ["https://github.com/opencomputeproject/SAI/archive/refs/tags/v1.15.0.tar.gz"],
)

######################################
Expand Down
9 changes: 8 additions & 1 deletion dataplane/apigen/apigen.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ func parse(headers []string, includePaths ...string) (*cc.AST, error) {
cfg.SysIncludePaths = append(cfg.SysIncludePaths, p)
}

sources := []cc.Source{{Name: "<predefined>", Value: cfg.Predefined}, {Name: "<builtin>", Value: cc.Builtin}}
sources := []cc.Source{
{Name: "<predefined>", Value: cfg.Predefined},
{Name: "<builtin>", Value: cc.Builtin},
{Name: "stdbool.h", Value: "#define bool _Bool\n#define true 1\n#define false 0"},
{Name: "stddef.h", Value: "typedef unsigned long size_t; typedef long ptrdiff_t; typedef int wchar_t;"},
{Name: "stdint.h", Value: "typedef signed char int8_t; typedef short int int16_t; typedef int int32_t; typedef long int int64_t; typedef unsigned char uint8_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; typedef unsigned long int uint64_t;"},
}

for _, hdr := range headers {
sources = append(sources, cc.Source{Name: hdr})
}
Expand Down
6 changes: 5 additions & 1 deletion dataplane/apigen/typeinfo/typeinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,12 @@ func CreateAttrs(startIdx int, typeName string, xmlInfo *docparser.SAIInfo, attr
if strings.Contains(attr.SaiType, "sai_pointer_t") {
continue
}
// Proto field names can't begin with numbers, prepend _.
name := attr.MemberName
// Rename attribute to avoid collision with Proto _size methods.
if name == "json_formatted_debug_data_size" {
name = "json_formatted_debug_data_sz"
}
// Proto field names can't begin with numbers, prepend _.
if unicode.IsDigit(rune(attr.MemberName[0])) {
name = fmt.Sprintf("_%s", name)
}
Expand Down
5 changes: 5 additions & 0 deletions dataplane/proto/sai/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ proto_library(
"common.proto",
"counter.proto",
"dash_acl.proto",
"dash_appliance.proto",
"dash_direction_lookup.proto",
"dash_eni.proto",
"dash_flow.proto",
"dash_ha.proto",
"dash_inbound_routing.proto",
"dash_meter.proto",
"dash_outbound_ca_to_pa.proto",
"dash_outbound_routing.proto",
"dash_pa_validation.proto",
"dash_tunnel.proto",
"dash_vip.proto",
"dash_vnet.proto",
"debug_counter.proto",
Expand All @@ -32,6 +36,7 @@ proto_library(
"generic_programmable.proto",
"hash.proto",
"hostif.proto",
"icmp_echo.proto",
"ipmc.proto",
"ipmc_group.proto",
"ipsec.proto",
Expand Down
Loading
Loading