當前位置: 首頁>>代碼示例>>Golang>>正文


Golang dns.DNS類代碼示例

本文整理匯總了Golang中parser/dns.DNS的典型用法代碼示例。如果您正苦於以下問題:Golang DNS類的具體用法?Golang DNS怎麽用?Golang DNS使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了DNS類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: RD

func RD(d dns.DNS) {
	fmt.Printf("RD: ")
	if d.GetRD() {
		fmt.Println("Recursion Desired")
	} else {
		fmt.Println("Recursion not Desired")
	}
}
開發者ID:raphting,項目名稱:dns-spoofer,代碼行數:8,代碼來源:printer.go

示例2: AA

func AA(d dns.DNS) {
	fmt.Printf("AA: ")
	if d.GetAA() {
		fmt.Println("Authorative")
	} else {
		fmt.Println("Non authorative")
	}
}
開發者ID:raphting,項目名稱:dns-spoofer,代碼行數:8,代碼來源:printer.go

示例3: QNAME

func QNAME(d dns.DNS, num int) {
	qname, err := d.GetQNAME(num)
	if err != nil {
		fmt.Println(err.Error(), "\n")
		return
	}
	fmt.Println("QNAME: ", qname)
}
開發者ID:raphting,項目名稱:dns-spoofer,代碼行數:8,代碼來源:printer.go

示例4: RA

func RA(d dns.DNS) {
	fmt.Printf("RA: ")
	if d.GetRA() {
		fmt.Println("Recursion Available")
	} else {
		fmt.Println("Recursion not Available")
	}
}
開發者ID:raphting,項目名稱:dns-spoofer,代碼行數:8,代碼來源:printer.go

示例5: Z

func Z(d dns.DNS) {
	fmt.Printf("Z: ")
	if d.GetZ() == 0 {
		fmt.Println("Reserved")
	} else {
		fmt.Printf("Should be 0 but is %d \n", d.GetZ())
	}
}
開發者ID:raphting,項目名稱:dns-spoofer,代碼行數:8,代碼來源:printer.go

示例6: QR

func QR(d dns.DNS) {
	fmt.Printf("QR: ")
	if d.GetQR() {
		fmt.Println("1 Response")
	} else {
		fmt.Println("0 Query")
	}
}
開發者ID:raphting,項目名稱:dns-spoofer,代碼行數:8,代碼來源:printer.go

示例7: TC

func TC(d dns.DNS) {
	fmt.Printf("TC: ")
	if d.GetTC() {
		fmt.Println("Truncated")
	} else {
		fmt.Println("Not truncated")
	}
}
開發者ID:raphting,項目名稱:dns-spoofer,代碼行數:8,代碼來源:printer.go

示例8: QTYPE

func QTYPE(d dns.DNS, num int) {
	field, err := d.GetQTYPE(num)

	if err != nil {
		fmt.Println(err.Error(), "\n")
		return
	}

	fmt.Printf("QTYPE: ")
	switch field {
	case 1:
		fmt.Println("A")
	case 2:
		fmt.Println("NS")
	case 3:
		fmt.Println("MD")
	case 4:
		fmt.Println("MF")
	case 5:
		fmt.Println("CNAME")
	case 6:
		fmt.Println("SOA")
	case 7:
		fmt.Println("MB")
	case 8:
		fmt.Println("MG")
	case 9:
		fmt.Println("MR")
	case 10:
		fmt.Println("NULL")
	case 11:
		fmt.Println("WKS")
	case 12:
		fmt.Println("PTR")
	case 13:
		fmt.Println("HINFO")
	case 14:
		fmt.Println("MINFO")
	case 15:
		fmt.Println("MX")
	case 16:
		fmt.Println("TXT")
	case 28:
		fmt.Println("AAAA")
	case 252:
		fmt.Println("AXFR")
	case 253:
		fmt.Println("MAILB")
	case 254:
		fmt.Println("MAILA")
	case 255:
		fmt.Println("*")
	default:
		fmt.Printf("NOT VALID %d \n", field)
	}
}
開發者ID:raphting,項目名稱:dns-spoofer,代碼行數:56,代碼來源:printer.go

示例9: OPCODE

func OPCODE(d dns.DNS) {
	fmt.Printf("OPCODE: ")
	switch d.GetOPCODE() {
	case 0:
		fmt.Println("0 QUERY")
	case 1:
		fmt.Println("1 IQUERY")
	default:
		fmt.Println(">1 RESERVED")
	}
}
開發者ID:raphting,項目名稱:dns-spoofer,代碼行數:11,代碼來源:printer.go

示例10: RCODE

func RCODE(d dns.DNS) {
	fmt.Printf("RCODE: ")
	switch d.GetRCODE() {
	case 0:
		fmt.Println("0 No error condition")
	case 1:
		fmt.Println("1 Format error")
	case 2:
		fmt.Println("2 Server failure")
	case 3:
		if d.GetAA() {
			fmt.Println("3 Name error")
		} else {
			fmt.Println("3 ERROR! Only meaningful if AA is set")
		}
	case 4:
		fmt.Println("4 Not implemented")
	case 5:
		fmt.Println("5 Refused")
	default:
		fmt.Println(">5 Reserved for future use")
	}
}
開發者ID:raphting,項目名稱:dns-spoofer,代碼行數:23,代碼來源:printer.go

示例11: QCLASS

func QCLASS(d dns.DNS, num int) {
	field, err := d.GetQCLASS(num)

	if err != nil {
		fmt.Println(err.Error(), "\n")
		return
	}

	fmt.Printf("QCLASS: ")
	switch field {
	case 1:
		fmt.Println("IN")
	case 2:
		fmt.Println("CS")
	case 3:
		fmt.Println("CH")
	case 4:
		fmt.Println("HS")
	case 255:
		fmt.Println("*")
	default:
		fmt.Printf("NOT VALID %d \n", field)
	}
}
開發者ID:raphting,項目名稱:dns-spoofer,代碼行數:24,代碼來源:printer.go

示例12: ARNAME

func ARNAME(d dns.DNS, num int, field string) {
	var resString string
	var ident string

	resString = ""
	switch field {
	case "an":
		resString, _ = d.GetANNAME(num)
		ident = "ANNAME:"
	case "ns":
		resString, _ = d.GetNSNAME(num)
		ident = "NSNAME:"
	case "ar":
		resString, _ = d.GetARNAME(num)
		ident = "ARNAME:"
	}

	fmt.Println(ident, resString)
	rdata, _ := d.GetANRDATA(num)
	fmt.Println("RDATA", rdata)
}
開發者ID:raphting,項目名稱:dns-spoofer,代碼行數:21,代碼來源:printer.go

示例13: QDCOUNT

func QDCOUNT(d dns.DNS) {
	fmt.Println("QDCOUNT:", d.GetQDCOUNT())
}
開發者ID:raphting,項目名稱:dns-spoofer,代碼行數:3,代碼來源:printer.go

示例14: ID

func ID(d dns.DNS) {
	fmt.Println("ID:", d.GetID())
}
開發者ID:raphting,項目名稱:dns-spoofer,代碼行數:3,代碼來源:printer.go

示例15: NSCOUNT

func NSCOUNT(d dns.DNS) {
	fmt.Println("NSCOUNT:", d.GetNSCOUNT())
}
開發者ID:raphting,項目名稱:dns-spoofer,代碼行數:3,代碼來源:printer.go


注:本文中的parser/dns.DNS類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。