Make every struct have a header header and not inherit the header

This commit is contained in:
PhatPhuckDave
2024-07-22 22:51:41 +02:00
parent 98fb872fc1
commit abfba3b5a7
12 changed files with 23 additions and 23 deletions

View File

@@ -3,4 +3,4 @@ package pdu
type ( type (
ALERT_NOTIFICATION struct{} ALERT_NOTIFICATION struct{}
ALERT_NOTIFICATION_RESP struct{} ALERT_NOTIFICATION_RESP struct{}
) )

View File

@@ -2,7 +2,7 @@ package pdu
type ( type (
BIND struct { BIND struct {
PDU_HEADER header PDU_HEADER
system_id string system_id string
password string password string
system_type string system_type string
@@ -12,7 +12,7 @@ type (
address_range string address_range string
} }
BIND_RESP struct { BIND_RESP struct {
PDU_HEADER header PDU_HEADER
system_id string system_id string
sc_interface_version uint8 sc_interface_version uint8
} }
@@ -34,11 +34,11 @@ type (
BIND_TRANSCIEVER_RESP struct { BIND_TRANSCIEVER_RESP struct {
BIND_RESP BIND_RESP
} }
UNBIND struct { UNBIND struct {
PDU_HEADER PDU_HEADER
} }
UNBIND_RESP struct { UNBIND_RESP struct {
PDU_HEADER PDU_HEADER
} }
) )

View File

@@ -2,7 +2,7 @@ package pdu
type ( type (
CANCEL_SM struct { CANCEL_SM struct {
PDU_HEADER header PDU_HEADER
service_type string service_type string
message_id string message_id string
source_addr_ton uint8 source_addr_ton uint8
@@ -13,6 +13,6 @@ type (
destination_addr string destination_addr string
} }
CANCEL_SM_RESP struct { CANCEL_SM_RESP struct {
PDU_HEADER header PDU_HEADER
} }
) )

View File

@@ -156,4 +156,4 @@ var COMMAND_STATUS = struct {
ESME_RINVOPTPARAMVAL: 0x000000C4, // Invalid Optional Parameter Value ESME_RINVOPTPARAMVAL: 0x000000C4, // Invalid Optional Parameter Value
ESME_RDELIVERYFAILURE: 0x000000FE, // Delivery Failure (used for ESME_RDELIVERYFAILURE: 0x000000FE, // Delivery Failure (used for
ESME_RUNKNOWNERR: 0x000000FF, // Unknown Error ESME_RUNKNOWNERR: 0x000000FF, // Unknown Error
} }

View File

@@ -3,4 +3,4 @@ package pdu
type ( type (
DATA_SM struct{} DATA_SM struct{}
DATA_SM_RESP struct{} DATA_SM_RESP struct{}
) )

View File

@@ -2,11 +2,11 @@ package pdu
type ( type (
DELIVER_SM struct { DELIVER_SM struct {
PDU_HEADER header PDU_HEADER
SUBMIT_SM SUBMIT_SM
} }
DELIVER_SM_RESP struct { DELIVER_SM_RESP struct {
PDU_HEADER header PDU_HEADER
SUBMIT_SM_RESP SUBMIT_SM_RESP
} }
) )

View File

@@ -2,9 +2,9 @@ package pdu
type ( type (
ENQUIRE_LINK struct { ENQUIRE_LINK struct {
PDU_HEADER header PDU_HEADER
} }
ENQUIRE_LINK_RESP struct { ENQUIRE_LINK_RESP struct {
PDU_HEADER header PDU_HEADER
} }
) )

View File

@@ -22,7 +22,7 @@ type (
} }
GENERIC_NACK struct { GENERIC_NACK struct {
PDU_HEADER header PDU_HEADER
} }
) )
@@ -63,4 +63,4 @@ func (p *PDU_HEADER) Decode(data []uint8) error {
} }
func (p *PDU_HEADER) Size() uint32 { func (p *PDU_HEADER) Size() uint32 {
return 16 return 16
} }

View File

@@ -448,4 +448,4 @@ func TestSizeReturns16(t *testing.T) {
if p.Size() != 16 { if p.Size() != 16 {
t.Errorf("Expected size to be 16, got %d", p.Size()) t.Errorf("Expected size to be 16, got %d", p.Size())
} }
} }

View File

@@ -3,4 +3,4 @@ package pdu
type ( type (
QUERY_SM struct{} QUERY_SM struct{}
QUERY_SM_RESP struct{} QUERY_SM_RESP struct{}
) )

View File

@@ -3,4 +3,4 @@ package pdu
type ( type (
REPLACE_SM struct{} REPLACE_SM struct{}
REPLACE_SM_RESP struct{} REPLACE_SM_RESP struct{}
) )

View File

@@ -2,7 +2,7 @@ package pdu
type ( type (
SUBMIT_SM struct { SUBMIT_SM struct {
PDU_HEADER header PDU_HEADER
service_type string service_type string
source_addr_ton uint8 source_addr_ton uint8
source_addr_npi uint8 source_addr_npi uint8
@@ -51,7 +51,7 @@ type (
// ussd_service_op uint8 // ussd_service_op uint8
} }
SUBMIT_SM_RESP struct { SUBMIT_SM_RESP struct {
PDU_HEADER header PDU_HEADER
message_id string message_id string
} }
SUBMIT_MULTI struct{} SUBMIT_MULTI struct{}