code: func (rule *edns0VariableRule) ruleData(w dns.ResponseWriter, r *dns.Msg) ([]byte, error) {
  
  	req := request.Request{W: w, Req: r}
  	switch rule.variable {
  	case queryName:
  		//Query name is written as ascii string
  		return []byte(req.QName()), nil
  
  	case queryType:
  		return rule.uint16ToWire(req.QType()), nil
  
  	case clientIP:
  		return rule.ipToWire(req.Family(), req.IP())
  
  	case clientPort:
  		return rule.portToWire(req.Port())
  
  	case protocol:
  		// Proto is written as ascii string
  		return []byte(req.Proto()), nil
  
  	case serverIP:
  		ip, _, err := net.SplitHostPort(w.LocalAddr().String())
  		if err != nil {
  			ip = w.RemoteAddr().String()
  		}
  		return rule.ipToWire(rule.family(w.RemoteAddr()), ip)
  
  	case serverPort:
  		_, port, err := net.SplitHostPort(w.LocalAddr().String())
  		if err != nil {
  			port = "0"
  		}
  		return rule.portToWire(port)
  	}
  
  	return nil, fmt.Errorf("Unable to extract data for variable %s", rule.variable)
  }
docs: // ruleData returns the data specified by the variable