From 600c0bdf5211ce6d57a9495100cc8f4b7afb662a Mon Sep 17 00:00:00 2001 From: "Arrobo, Gabriel" Date: Wed, 29 May 2024 18:22:01 -0700 Subject: [PATCH] Apply `gofmt` to some files and add GO report card --- README.md | 3 ++- nas.go | 1 + nasMessage/NAS_CommInfoIE.go | 2 +- nasMessage/NAS_DLNASTransport.go | 2 +- nasType/NAS_AllowedSSCMode_test.go | 2 +- nasType/NAS_PDUSessionStatus_test.go | 8 ++++---- nasType/NAS_UplinkDataStatus_test.go | 8 ++++---- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index ea41995..8fa1cd8 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,13 @@ Copyright 2021-present Open Networking Foundation SPDX-License-Identifier: Apache-2.0 --> +[![Go Report Card](https://goreportcard.com/badge/github.com/omec-project/nas)](https://goreportcard.com/report/github.com/omec-project/nas) # nas 1. Implementation of 3gpp specification 24.501 release 15 specification. -2. Supports NAS encoding/decoding of messages. +2. Supports NAS encoding/decoding of messages. 3. This module supports integrity & Ciphering algorithms diff --git a/nas.go b/nas.go index e4669b5..3943b1a 100644 --- a/nas.go +++ b/nas.go @@ -56,6 +56,7 @@ func NewGsmMessage() *GsmMessage { // GmmHeader Octet1 protocolDiscriminator securityHeaderType // Octet2 MessageType + type GmmHeader struct { Octet [3]uint8 } diff --git a/nasMessage/NAS_CommInfoIE.go b/nasMessage/NAS_CommInfoIE.go index b704197..02375d8 100644 --- a/nasMessage/NAS_CommInfoIE.go +++ b/nasMessage/NAS_CommInfoIE.go @@ -274,7 +274,7 @@ const ( SessionAMBRUnit256Pbps uint8 = 0x19 ) -//TS 24.008 10.5.6.3 +// TS 24.008 10.5.6.3 const ( PCSCFIPv6AddressRequestUL uint16 = 0x0001 IMCNSubsystemSignalingFlagUL uint16 = 0x0002 diff --git a/nasMessage/NAS_DLNASTransport.go b/nasMessage/NAS_DLNASTransport.go index 1128977..81f98a4 100644 --- a/nasMessage/NAS_DLNASTransport.go +++ b/nasMessage/NAS_DLNASTransport.go @@ -9,8 +9,8 @@ import ( "bytes" "encoding/binary" "fmt" - "net" "github.com/omec-project/nas/nasType" + "net" ) type DLNASTransport struct { diff --git a/nasType/NAS_AllowedSSCMode_test.go b/nasType/NAS_AllowedSSCMode_test.go index b1c0704..33bc42c 100644 --- a/nasType/NAS_AllowedSSCMode_test.go +++ b/nasType/NAS_AllowedSSCMode_test.go @@ -21,7 +21,7 @@ func TestNasTypeNewAllowedSSCMode(t *testing.T) { assert.NotNil(t, a) } -//var nasTypePDUSessionEstablishmentRejectAllowedSSCModeOut = (nasMessage.PDUSessionEstablishmentRejectAllowedSSCModeType & 15) << 4 +// var nasTypePDUSessionEstablishmentRejectAllowedSSCModeOut = (nasMessage.PDUSessionEstablishmentRejectAllowedSSCModeType & 15) << 4 var nasTypePDUSessionEstablishmentRejectAllowedSSCModeTable = []NasTypeIeiData{ {pDUSessionEstablishmentRejectAllowedSSCModeIeiInput, pDUSessionEstablishmentRejectAllowedSSCModeIeiInput}, } diff --git a/nasType/NAS_PDUSessionStatus_test.go b/nasType/NAS_PDUSessionStatus_test.go index 1e29d7e..ae62eaa 100644 --- a/nasType/NAS_PDUSessionStatus_test.go +++ b/nasType/NAS_PDUSessionStatus_test.go @@ -391,11 +391,11 @@ type testPDUSessionStatusDataTemplate struct { } /* - For the 1st testcase with len 2, our input for SetSpare function will not be read - as the len size is too small(< 3). However, SetSpare function won't raise any error - since the "make" function in golang will create a zero-length slice instead of nil slice. +For the 1st testcase with len 2, our input for SetSpare function will not be read +as the len size is too small(< 3). However, SetSpare function won't raise any error +since the "make" function in golang will create a zero-length slice instead of nil slice. - REFERENCE: https://programming.guide/go/nil-slice-vs-empty-slice.html +REFERENCE: https://programming.guide/go/nil-slice-vs-empty-slice.html */ var PDUSessionStatusTestData = []nasType.PDUSessionStatus{ {nasMessage.ServiceRequestPDUSessionStatusType, 2, []uint8{}}, diff --git a/nasType/NAS_UplinkDataStatus_test.go b/nasType/NAS_UplinkDataStatus_test.go index a4d5d24..758270e 100644 --- a/nasType/NAS_UplinkDataStatus_test.go +++ b/nasType/NAS_UplinkDataStatus_test.go @@ -391,11 +391,11 @@ type testUplinkDataStatusDataTemplate struct { } /* - For the 1st testcase with len 2, our input for SetSpare function will not be read - as the len size is too small(< 3). However, SetSpare function won't raise any error - since the "make" function in golang will create a zero-length slice instead of nil slice. +For the 1st testcase with len 2, our input for SetSpare function will not be read +as the len size is too small(< 3). However, SetSpare function won't raise any error +since the "make" function in golang will create a zero-length slice instead of nil slice. - REFERENCE: https://programming.guide/go/nil-slice-vs-empty-slice.html +REFERENCE: https://programming.guide/go/nil-slice-vs-empty-slice.html */ var UplinkDataStatusTestData = []nasType.UplinkDataStatus{ {nasMessage.ServiceRequestUplinkDataStatusType, 2, []uint8{}},