def METHOD_NAME(self, name, triples, members):
    self.fp.write_string(name)
    for triple in triples:
        m = _netgroup_triple_re.match(triple)
        if m:
            self.fp.write_int32(constants.NSLCD_NETGROUP_TYPE_TRIPLE)
            self.fp.write_string(m.group('host'))
            self.fp.write_string(m.group('user'))
            self.fp.write_string(m.group('domain'))
    for member in members:
        self.fp.write_int32(constants.NSLCD_NETGROUP_TYPE_NETGROUP)
        self.fp.write_string(member)
    self.fp.write_int32(constants.NSLCD_NETGROUP_TYPE_END)