Add a NGM_PPPOE_SESSIONID message to the ng_pppoe node.

This message is sent to the control socket when the SessionID
is established.

Approved by:	archie (after a very cursory glance)
This commit is contained in:
Brian Somers 2002-05-14 12:32:41 +00:00
parent 8fed82b9af
commit 87c4cce00e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=96578
2 changed files with 21 additions and 1 deletions

View File

@ -908,6 +908,23 @@ send_acname(sessp sp, struct pppoe_tag *tag)
return (error);
}
static int
send_sessionid(sessp sp)
{
int error;
struct ng_mesg *msg;
NG_MKMESSAGE(msg, NGM_PPPOE_COOKIE, NGM_PPPOE_SESSIONID,
sizeof(u_int16_t), M_NOWAIT);
if (msg == NULL)
return (ENOMEM);
*(u_int16_t *)msg->data = sp->Session_ID;
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
@ -1139,6 +1156,7 @@ AAA
neg->pkt->pkt_header.ph.sid =
htons(sp->Session_ID
= get_new_sid(node));
send_sessionid(sp);
neg->timeout = 0;
/*
* start working out the tags to respond with.
@ -1206,6 +1224,7 @@ AAA
neg->timeout_handle);
neg->pkt->pkt_header.ph.sid = wh->ph.sid;
sp->Session_ID = ntohs(wh->ph.sid);
send_sessionid(sp);
neg->timeout = 0;
sp->state = PPPOE_CONNECTED;
/*

View File

@ -76,7 +76,8 @@ enum cmd {
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
NGM_PPPOE_GET_STATUS = 10, /* data in/out */
NGM_PPPOE_SESSIONID = 11 /* Session_ID for informational purposes */
};
/***********************