code: func (n *NetworkServerAPI) CreateMulticastGroup(ctx context.Context, req *ns.CreateMulticastGroupRequest) (*ns.CreateMulticastGroupResponse, error) {
  	if req.MulticastGroup == nil {
  		return nil, grpc.Errorf(codes.InvalidArgument, "multicast_group must not be nil")
  	}
  
  	mg := storage.MulticastGroup{
  		FCnt:           req.MulticastGroup.FCnt,
  		DR:             int(req.MulticastGroup.Dr),
  		Frequency:      int(req.MulticastGroup.Frequency),
  		PingSlotPeriod: int(req.MulticastGroup.PingSlotPeriod),
  	}
  
  	switch req.MulticastGroup.GroupType {
  	case ns.MulticastGroupType_CLASS_B:
  		mg.GroupType = storage.MulticastGroupB
  	case ns.MulticastGroupType_CLASS_C:
  		mg.GroupType = storage.MulticastGroupC
  	default:
  		return nil, grpc.Errorf(codes.InvalidArgument, "invalid group_type")
  	}
  
  	copy(mg.ID[:], req.MulticastGroup.Id)
  	copy(mg.MCAddr[:], req.MulticastGroup.McAddr)
  	copy(mg.MCNwkSKey[:], req.MulticastGroup.McNwkSKey)
  	copy(mg.ServiceProfileID[:], req.MulticastGroup.ServiceProfileId)
  	copy(mg.RoutingProfileID[:], req.MulticastGroup.RoutingProfileId)
  
  	if err := storage.CreateMulticastGroup(storage.DB(), &mg); err != nil {
  		return nil, errToRPCError(err)
  	}
  
  	return &ns.CreateMulticastGroupResponse{
  		Id: mg.ID.Bytes(),
  	}, nil
  }
docs: // CreateMulticastGroup creates the given multicast-group.