当前位置: 首页>>代码示例>>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;未经允许,请勿转载。