code: func (s *Stack) createNIC(id tcpip.NICID, name string, linkEP tcpip.LinkEndpointID, enabled, loopback bool) *tcpip.Error {
  	ep := FindLinkEndpoint(linkEP)
  	if ep == nil {
  		return tcpip.ErrBadLinkEndpoint
  	}
  
  	s.mu.Lock()
  	defer s.mu.Unlock()
  
  	// Make sure id is unique.
  	if _, ok := s.nics[id]; ok {
  		return tcpip.ErrDuplicateNICID
  	}
  
  	n := newNIC(s, id, name, ep, loopback)
  
  	s.nics[id] = n
  	if enabled {
  		n.attachLinkEndpoint()
  	}
  
  	return nil
  }
docs: // createNIC creates a NIC with the provided id and link-layer endpoint, and
  // optionally enable it.