Skip to content

Commit 79ab2fd

Browse files
berezovskyi-oleksandrisergieienkovSuperQ
authored
feat: make parse Interface and Station infos public (#120)
* feat: make parse Interface and Station infos public --------- Co-authored-by: Iegor Sergieienkov <[email protected]> Co-authored-by: Ben Kochie <[email protected]>
1 parent 927637e commit 79ab2fd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

client_linux.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func (c *client) Interfaces() ([]*Interface, error) {
9898
return nil, err
9999
}
100100

101-
return parseInterfaces(msgs)
101+
return ParseInterfaces(msgs)
102102
}
103103

104104
// Connect starts connecting the interface to the specified ssid.
@@ -225,7 +225,7 @@ func (c *client) StationInfo(ifi *Interface) ([]*StationInfo, error) {
225225

226226
stations := make([]*StationInfo, len(msgs))
227227
for i := range msgs {
228-
if stations[i], err = parseStationInfo(msgs[i].Data); err != nil {
228+
if stations[i], err = ParseStationInfo(msgs[i].Data); err != nil {
229229
return nil, err
230230
}
231231
}
@@ -510,7 +510,7 @@ func parseGetScanResult(msgs []genetlink.Message) ([]*BSS, error) {
510510

511511
// parseInterfaces parses zero or more Interfaces from nl80211 interface
512512
// messages.
513-
func parseInterfaces(msgs []genetlink.Message) ([]*Interface, error) {
513+
func ParseInterfaces(msgs []genetlink.Message) ([]*Interface, error) {
514514
ifis := make([]*Interface, 0, len(msgs))
515515
for _, m := range msgs {
516516
attrs, err := netlink.UnmarshalAttributes(m.Data)
@@ -673,9 +673,9 @@ func (b *BSS) parseAttributes(attrs []netlink.Attribute) error {
673673
return nil
674674
}
675675

676-
// parseStationInfo parses StationInfo attributes from a byte slice of
676+
// ParseStationInfo parses StationInfo attributes from a byte slice of
677677
// netlink attributes.
678-
func parseStationInfo(b []byte) (*StationInfo, error) {
678+
func ParseStationInfo(b []byte) (*StationInfo, error) {
679679
attrs, err := netlink.UnmarshalAttributes(b)
680680
if err != nil {
681681
return nil, err

0 commit comments

Comments
 (0)