Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add freeradius vendor specific dictionary #88

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 7 additions & 5 deletions server-packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ func (s *PacketServer) Serve(conn net.PacketConn) error {
return
}

if !s.InsecureSkipVerify && !IsAuthenticRequest(buff, secret) {
isAuthentic := IsAuthenticRequest(buff, secret)
if !s.InsecureSkipVerify && !isAuthentic {
s.logf("radius: packet validation failed; bad secret")
return
}
Expand Down Expand Up @@ -192,10 +193,11 @@ func (s *PacketServer) Serve(conn net.PacketConn) error {
}()

request := Request{
LocalAddr: conn.LocalAddr(),
RemoteAddr: remoteAddr,
Packet: packet,
ctx: s.ctx,
LocalAddr: conn.LocalAddr(),
RemoteAddr: remoteAddr,
IsAuthentic: isAuthentic,
Packet: packet,
ctx: s.ctx,
}

s.Handler.ServeRADIUS(&response, &request)
Expand Down
2 changes: 2 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ type Request struct {
// RemoteAddr is the address from which the incoming RADIUS request
// was sent.
RemoteAddr net.Addr
// IsAuthentic is true if the secret that was used matches the one we have
IsAuthentic bool

// Packet is the RADIUS packet sent in the request.
*Packet
Expand Down
64 changes: 64 additions & 0 deletions vendors/alcatel/dictionary.alcatel
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# -*- text -*-
##############################################################################
#
# Alcatel Broadband Access Server dictionary.
#
# $Id: dictionary.alcatel, 2006/04/18 17:50:50 aland Exp $
#
##############################################################################

#Alcatel Dictionary file for FreeRadius Servers

VENDOR Alcatel 800

BEGIN-VENDOR Alcatel

ATTRIBUTE Alcatel-Auth-Group 1 integer
ATTRIBUTE Alcatel-Slot-Port 2 string
ATTRIBUTE Alcatel-Time-of-Day 3 string
ATTRIBUTE Alcatel-Client-IP-Addr 4 ipaddr
ATTRIBUTE Alcatel-Group-Desc 5 string
ATTRIBUTE Alcatel-Port-Desc 6 string

ATTRIBUTE Alcatel-Auth-Group-Protocol 8 string
ATTRIBUTE Alcatel-Asa-Access 9 string
ATTRIBUTE Alcatel-End-User-Profile 10 string

ATTRIBUTE AAT-Primary-Home-Agent 12 string
ATTRIBUTE AAT-Secondary-Home-Agent 13 string
ATTRIBUTE AAT-Home-Agent-Password 14 string
ATTRIBUTE AAT-Home-Network-Name 15 string

ATTRIBUTE Alcatel-Access-Priv 16 integer
VALUE Alcatel-Access-Priv Alcatel-Read-Priv 1
VALUE Alcatel-Access-Priv Alcatel-Write-Priv 2
VALUE Alcatel-Access-Priv Alcatel-Admin-Priv 3

ATTRIBUTE Alcatel-Nms-Group 20 string
ATTRIBUTE Alcatel-Nms-First-Name 21 string
ATTRIBUTE Alcatel-Nms-Last-Name 22 string
ATTRIBUTE Alcatel-Nms-Description 23 string

ATTRIBUTE Alcatel-Acce-Priv-R1 33 octets
ATTRIBUTE Alcatel-Acce-Priv-R2 34 octets
ATTRIBUTE Alcatel-Acce-Priv-W1 35 octets
ATTRIBUTE Alcatel-Acce-Priv-W2 36 octets
ATTRIBUTE Alcatel-Acce-Priv-G1 37 octets
ATTRIBUTE Alcatel-Acce-Priv-G2 38 octets
ATTRIBUTE Alcatel-Acce-Priv-F-R1 39 octets
ATTRIBUTE Alcatel-Acce-Priv-F-R2 40 octets
ATTRIBUTE Alcatel-Acce-Priv-F-W1 41 octets
ATTRIBUTE Alcatel-Acce-Priv-F-W2 42 octets
ATTRIBUTE Alcatel-Acce-Priv-F-R3 43 octets
ATTRIBUTE Alcatel-Acce-Priv-F-R4 44 octets
ATTRIBUTE Alcatel-Acce-Priv-F-W3 45 octets
ATTRIBUTE Alcatel-Acce-Priv-F-W4 46 octets

ATTRIBUTE Alcatel-Policy-List 100 string
ATTRIBUTE Alcatel-Redirect-Url 101 string
ATTRIBUTE Alcatel-Device-Name 152 string
ATTRIBUTE Alcatel-Device-Location 153 string
ATTRIBUTE Alcatel-AP-Group 154 string
ATTRIBUTE Alcatel-Device-Psk 155 string

END-VENDOR Alcatel
3 changes: 3 additions & 0 deletions vendors/alcatel/generate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//go:generate go run ../../cmd/radius-dict-gen/main.go -package alcatel -output generated.go dictionary.alcatel

package alcatel
Loading