Initial commit
FossilOrigin-Name: 3d8398d54a499bcf828446169487797f213f3c1d4321afe77dc32462d7562200
This commit is contained in:
parent
5d8080c95c
commit
57f1daa247
21
src/mod/capwap/capwap_out_get_session_id.c
Normal file
21
src/mod/capwap/capwap_out_get_session_id.c
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
#include "cw/conn.h"
|
||||||
|
#include "cw/rand.h"
|
||||||
|
#include "cw/log.h"
|
||||||
|
#include "cw/capwap_items.h"
|
||||||
|
|
||||||
|
|
||||||
|
struct mbag_item * capwap_out_get_session_id(struct conn *conn,struct cw_action_out * a)
|
||||||
|
{
|
||||||
|
uint8_t session_id[16];
|
||||||
|
|
||||||
|
int slen=16;
|
||||||
|
|
||||||
|
int l = cw_rand(session_id,slen);
|
||||||
|
if ( l!=slen ) {
|
||||||
|
cw_log(LOG_ERR,"Can't init session ID.");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
return mbag_set_bstrn(conn->local,CW_ITEM_SESSION_ID,session_id,slen);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user