Send a NGM_PPPOE_ACNAME message to userland when a node is connected.
Submitted by: Andre Albsmeier <andre@albsmeier.net> Shuffled about by: brian Approved by: julian
This commit is contained in:
parent
ad827f33f7
commit
c53e73d628
@ -888,6 +888,26 @@ AAA
|
||||
sendpacket(sp);
|
||||
}
|
||||
|
||||
static int
|
||||
send_acname(sessp sp, struct pppoe_tag *tag)
|
||||
{
|
||||
int error;
|
||||
struct ng_mesg *msg;
|
||||
struct ngpppoe_sts *sts;
|
||||
|
||||
NG_MKMESSAGE(msg, NGM_PPPOE_COOKIE, NGM_PPPOE_ACNAME,
|
||||
sizeof(struct ngpppoe_sts), M_NOWAIT);
|
||||
if (msg == NULL)
|
||||
return (ENOMEM);
|
||||
|
||||
sts = (struct ngpppoe_sts *)msg->data;
|
||||
strncpy(sts->hook, tag->tag_data,
|
||||
min(NG_HOOKLEN + 1, ntohs(tag->tag_len)));
|
||||
NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, NULL);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Receive data, and do something with it.
|
||||
* The caller will never free m or meta, so
|
||||
@ -1063,8 +1083,10 @@ AAA
|
||||
insert_tag(sp, utag); /* Host Unique */
|
||||
if ((tag = get_tag(ph, PTT_AC_COOKIE)))
|
||||
insert_tag(sp, tag); /* return cookie */
|
||||
if ((tag = get_tag(ph, PTT_AC_NAME)))
|
||||
if ((tag = get_tag(ph, PTT_AC_NAME))) {
|
||||
insert_tag(sp, tag); /* return it */
|
||||
send_acname(sp, tag);
|
||||
}
|
||||
insert_tag(sp, &neg->service.hdr); /* Service */
|
||||
scan_tags(sp, ph);
|
||||
make_packet(sp);
|
||||
|
@ -64,7 +64,7 @@
|
||||
|
||||
/**********************************************************************
|
||||
* Netgraph commands understood by this node type.
|
||||
* FAIL, SUCCESS and CLOSE are sent by the node rather than received.
|
||||
* FAIL, SUCCESS, CLOSE and ACNAME are sent by the node rather than received.
|
||||
********************************************************************/
|
||||
enum cmd {
|
||||
NGM_PPPOE_SET_FLAG = 1,
|
||||
@ -75,6 +75,7 @@ enum cmd {
|
||||
NGM_PPPOE_FAIL = 6, /* State machine could not connect */
|
||||
NGM_PPPOE_CLOSE = 7, /* Session closed down */
|
||||
NGM_PPPOE_SERVICE = 8, /* additional Service to advertise (in PADO) */
|
||||
NGM_PPPOE_ACNAME = 9, /* AC_NAME for informational purposes */
|
||||
NGM_PPPOE_GET_STATUS
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user