MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sppp_ipcp_open

Function sppp_ipcp_open

freebsd/net/if_spppsubr.c:2852–2891  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2850}
2851
2852static void
2853sppp_ipcp_open(struct sppp *sp)
2854{
2855 STDDCL;
2856 u_long myaddr, hisaddr;
2857
2858 sp->ipcp.flags &= ~(IPCP_HISADDR_SEEN | IPCP_MYADDR_SEEN |
2859 IPCP_MYADDR_DYN | IPCP_VJ);
2860 sp->ipcp.opts = 0;
2861
2862 sppp_get_ip_addrs(sp, &myaddr, &hisaddr, 0);
2863 /*
2864 * If we don't have his address, this probably means our
2865 * interface doesn't want to talk IP at all. (This could
2866 * be the case if somebody wants to speak only IPX, for
2867 * example.) Don't open IPCP in this case.
2868 */
2869 if (hisaddr == 0L) {
2870 /* XXX this message should go away */
2871 if (debug)
2872 log(LOG_DEBUG, SPP_FMT "ipcp_open(): no IP interface\n",
2873 SPP_ARGS(ifp));
2874 return;
2875 }
2876 if (myaddr == 0L) {
2877 /*
2878 * I don't have an assigned address, so i need to
2879 * negotiate my address.
2880 */
2881 sp->ipcp.flags |= IPCP_MYADDR_DYN;
2882 sp->ipcp.opts |= (1 << IPCP_OPT_ADDRESS);
2883 } else
2884 sp->ipcp.flags |= IPCP_MYADDR_SEEN;
2885 if (sp->confflags & CONF_ENABLE_VJ) {
2886 sp->ipcp.opts |= (1 << IPCP_OPT_COMPRESSION);
2887 sp->ipcp.max_state = MAX_STATES - 1;
2888 sp->ipcp.compress_cid = 1;
2889 }
2890 sppp_open_event(&ipcp, sp);
2891}
2892
2893static void
2894sppp_ipcp_close(struct sppp *sp)

Callers

nothing calls this directly

Calls 3

sppp_get_ip_addrsFunction · 0.85
sppp_open_eventFunction · 0.85
logFunction · 0.50

Tested by

no test coverage detected