+ sessionfree = session[new_sess].next;
+ memset(&session[new_sess], 0, sizeof(session[new_sess]));
+
+ if (new_sess > config->cluster_highest_sessionid)
+ config->cluster_highest_sessionid = new_sess;
+
+ session[new_sess].opened = time_now;
+ session[new_sess].tunnel = t;
+ session[new_sess].last_packet = session[s].last_data = time_now;
+
+ session[new_sess].ppp.phase = Establish;
+ session[new_sess].ppp.lcp = Starting;
+ session[s].ppp.phase = Establish;
+
+ LOG(2, 0, t, "Open New session to REMOTE LNS %s for user: %s\n", fmtaddr(htonl(tunnel[t].ip), 0), puser);
+ // Sent ICRQ Incoming-call-request
+ lac_send_ICRQ(t, new_sess);
+
+ // Set session to forward to another LNS
+ session[s].forwardtosession = new_sess;
+ session[new_sess].forwardtosession = s;
+ strncpy(session[s].user, puser, sizeof(session[s].user) - 1);
+ strncpy(session[new_sess].user, puser, sizeof(session[new_sess].user) - 1);
+
+ STAT(session_created);
+ }
+ else
+ {
+ lac_tunnelshutdown(t, "Shutting down", 6, 0, 0);
+ }
+ }
+ else
+ {
+ /** TODO **/
+ LOG(1, 0, t, "(REMOTE LNS) tunnel is not open\n");
+ }
+
+ return 1;
+}
+// Check if session must be forwarded to another LNS
+// return 1 if the session must be forwarded (and Creating a tunnel/session has been started)
+// else 0.
+// Note: check from the configuration read on the startup-config (see setforward)
+int lac_conf_forwardtoremotelns(sessionidt s, char * puser)